Remove gcc (4.0.x) warning about uninitialized value by explicitly setting
authorThomas Wouters <thomas@python.org>
Wed, 1 Mar 2006 21:58:30 +0000 (21:58 +0000)
committerThomas Wouters <thomas@python.org>
Wed, 1 Mar 2006 21:58:30 +0000 (21:58 +0000)
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?)

Modules/unicodedata.c

index be966f096450a88fcba091bbb7952c2c050faa0b..90f2ca502e6004600fb3b4ce722a6421996757dc 100644 (file)
@@ -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;