summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2006-03-01 21:58:30 (GMT)
committerThomas Wouters <thomas@python.org>2006-03-01 21:58:30 (GMT)
commit1e365b265ab77c58d8c8ee8d3341c8c0ad9650c9 (patch)
tree15cd4b07b1868822a5d6f1730124605343a2e53d
parent9bc844e7be40b6d947d0f8fa4b2b7d17cb17a091 (diff)
downloadcpython-1e365b265ab77c58d8c8ee8d3341c8c0ad9650c9.zip
cpython-1e365b265ab77c58d8c8ee8d3341c8c0ad9650c9.tar.gz
cpython-1e365b265ab77c58d8c8ee8d3341c8c0ad9650c9.tar.bz2
Remove gcc (4.0.x) warning about uninitialized value by explicitly setting
the sentinel value in the main function, rather than the helper. This function could possibly do with an early-out if any of the helper calls ends up with a len of 0, but I doubt it really matters (how common are malformed hangul syllables, really?)
-rw-r--r--Modules/unicodedata.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Modules/unicodedata.c b/Modules/unicodedata.c
index be966f0..90f2ca5 100644
--- a/Modules/unicodedata.c
+++ b/Modules/unicodedata.c
@@ -799,7 +799,6 @@ find_syllable(const char *str, int *len, int *pos, int count, int column)
}
if (*len == -1) {
*len = 0;
- *pos = -1;
}
}
@@ -812,7 +811,7 @@ _getcode(const char* name, int namelen, Py_UCS4* code)
/* Check for hangul syllables. */
if (strncmp(name, "HANGUL SYLLABLE ", 16) == 0) {
- int L, V, T, len;
+ int len, L = -1, V = -1, T = -1;
const char *pos = name + 16;
find_syllable(pos, &len, &L, LCount, 0);
pos += len;