ONEWAY: Fix declaration-after-statement warning.
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 18 Sep 2010 04:17:43 +0000 (21:17 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sat, 18 Sep 2010 13:51:41 +0000 (06:51 -0700)
C90 requires declarations to precede statements within a block.

src/language/stats/oneway.c

index ba7fc5b2a1102a2fcba010f06c21d0811425ef2a..aa8a255211192852f78318940d68179e046ec28c 100644 (file)
@@ -360,14 +360,14 @@ updateit (void *user_data,
 
   const union value *valx = case_data (c, varp);
 
+  struct descriptive_data *dd_total = aux2;
+
+  double weight;
+
   if ( var_is_value_missing (varp, valx, exclude))
     return;
 
-  struct descriptive_data *dd_total = aux2;
-
-  double weight = 1.0;
-  if (wv)
-    weight = case_data (c, wv)->f;
+  weight = wv != NULL ? case_data (c, wv)->f : 1.0;
 
   moments1_add (dd->mom, valx->f, weight);
   if (valx->f * weight < dd->minimum)