Clean up possibly-uninitialized-variable warnings reported by gcc 4.x.
authorTom Lane
Sat, 24 Sep 2005 23:07:18 +0000 (23:07 +0000)
committerTom Lane
Sat, 24 Sep 2005 23:07:18 +0000 (23:07 +0000)
contrib/intarray/_int_bool.c
contrib/ltree/ltxtquery_io.c
contrib/tsearch2/query.c

index 06759c44e3403643174af521f20ffa299c0d888e..824dc5b677569018d8a5f64465fb988b946df95e 100644 (file)
@@ -58,6 +58,8 @@ gettoken(WORKSTATE * state, int4 *val)
    char        nnn[16],
               *curnnn;
 
+   *val = 0;                   /* default result */
+
    curnnn = nnn;
    while (1)
    {
index ade0c4c03324c7b474479493ac5be961426be555..1f72e7197021a9e97c628e927a1fb8464afadfdc 100644 (file)
@@ -197,13 +197,13 @@ pushval_asis(QPRS_STATE * state, int type, char *strval, int lenval, uint16 flag
 static int4
 makepol(QPRS_STATE * state)
 {
-   int4        val,
+   int4        val = 0,
                type;
-   int4        lenval;
-   char       *strval;
+   int4        lenval = 0;
+   char       *strval = NULL;
    int4        stack[STACKDEPTH];
    int4        lenstack = 0;
-   uint16      flag;
+   uint16      flag = 0;
 
    while ((type = gettoken_query(state, &val, &lenval, &strval, &flag)) != END)
    {
index db45de56be1721899a1fc234efc2603905012059..96812729256060202d5682975718dcc062b09b60 100644 (file)
@@ -317,13 +317,13 @@ pushval_morph(QPRS_STATE * state, int typeval, char *strval, int lenval, int2 we
 static int4
 makepol(QPRS_STATE * state, void (*pushval) (QPRS_STATE *, int, char *, int, int2))
 {
-   int4        val,
+   int4        val = 0,
                type;
-   int4        lenval;
-   char       *strval;
+   int4        lenval = 0;
+   char       *strval = NULL;
    int4        stack[STACKDEPTH];
    int4        lenstack = 0;
-   int2        weight;
+   int2        weight = 0;
 
    while ((type = gettoken_query(state, &val, &lenval, &strval, &weight)) != END)
    {