Rename section_value to occurrence.
authorBen Pfaff <bpfaff@vmware.com>
Thu, 24 Feb 2022 00:25:29 +0000 (16:25 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 13 Mar 2022 23:56:03 +0000 (16:56 -0700)
src/language/stats/ctables.c

index bf3425b49e67c369dc0847fabae2e56ed706afef..05fb957439772a87d4ee66f02d7ba86592f49bc9 100644 (file)
@@ -358,7 +358,7 @@ struct ctables_value
     int leaf;
   };
 
-struct ctables_section_value
+struct ctables_occurrence
   {
     struct hmap_node node;
     union value value;
@@ -2904,15 +2904,15 @@ ctables_add_occurrence (const struct variable *var,
   int width = var_get_width (var);
   unsigned int hash = value_hash (value, width, 0);
 
-  struct ctables_section_value *sv;
-  HMAP_FOR_EACH_WITH_HASH (sv, struct ctables_section_value, node, hash,
+  struct ctables_occurrence *o;
+  HMAP_FOR_EACH_WITH_HASH (o, struct ctables_occurrence, node, hash,
                            occurrences)
-    if (value_equal (value, &sv->value, width))
+    if (value_equal (value, &o->value, width))
       return;
 
-  sv = xmalloc (sizeof *sv);
-  value_clone (&sv->value, value, width);
-  hmap_insert (occurrences, &sv->node, hash);
+  o = xmalloc (sizeof *o);
+  value_clone (&o->value, value, width);
+  hmap_insert (occurrences, &o->node, hash);
 }
 
 static void
@@ -3952,12 +3952,12 @@ ctables_section_recurse_add_empty_categories (
         var_get_dict_index (var)];
       int width = var_get_width (var);
       const struct hmap *occurrences = &s->occurrences[a][a_idx];
-      const struct ctables_section_value *sv;
-      HMAP_FOR_EACH (sv, struct ctables_section_value, node, occurrences)
+      const struct ctables_occurrence *o;
+      HMAP_FOR_EACH (o, struct ctables_occurrence, node, occurrences)
         {
           union value *value = case_data_rw (c, var);
           value_destroy (value, width);
-          value_clone (value, &sv->value, width);
+          value_clone (value, &o->value, width);
           cats[a][a_idx] = ctables_categories_match (categories, value, var);
           assert (cats[a][a_idx] != NULL);
           ctables_section_recurse_add_empty_categories (s, cats, c, a, a_idx + 1);