Define two locals always; to avoid GCC warning
[yaz-moved-to-github.git] / src / cqltransform.c
index b2422c9..aea8bdc 100644 (file)
@@ -500,8 +500,7 @@ static int cql_pr_prox(cql_transform_t ct, struct cql_node *mods,
                        void *client_data)
 {
     int exclusion = 0;
-    int distance;               /* to be filled in later depending on unit */
-    int distance_defined = 0;
+    int distance = -1;
     int ordered = 0;
     int proxrel = 2;            /* less than or equal */
     int unit = 2;               /* word */
@@ -514,7 +513,6 @@ static int cql_pr_prox(cql_transform_t ct, struct cql_node *mods,
 
         if (!strcmp(name, "distance")) {
             distance = strtol(term, (char**) 0, 0);
-            distance_defined = 1;
             if (!strcmp(relation, "="))
                 proxrel = 3;
             else if (!strcmp(relation, ">"))
@@ -564,7 +562,7 @@ static int cql_pr_prox(cql_transform_t ct, struct cql_node *mods,
         mods = mods->u.st.modifiers;
     }
 
-    if (!distance_defined)
+    if (distance == -1)
         distance = (unit == 2) ? 1 : 0;
 
     cql_pr_int(exclusion, pr, client_data);