pspp-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pspp-cvs] pspp/src data/ChangeLog data/procedure.c data/p...


From: Ben Pfaff
Subject: [Pspp-cvs] pspp/src data/ChangeLog data/procedure.c data/p...
Date: Sat, 06 May 2006 18:01:13 +0000

CVSROOT:        /cvsroot/pspp
Module name:    pspp
Branch:         
Changes by:     Ben Pfaff <address@hidden>      06/05/06 18:01:13

Modified files:
        src/data       : ChangeLog procedure.c procedure.h 
        src/language/data-io: get.c 
        src/language/stats: aggregate.c autorecode.c 

Log message:
        Continue reforming procedure execution.  In this phase, add `const' to
        the case passed to procedure()'s callback.
        
        Updated all users of procedure() as well.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/data/ChangeLog.diff?tr1=1.33&tr2=1.34&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/data/procedure.c.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/data/procedure.h.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/language/data-io/get.c.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/language/stats/aggregate.c.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/language/stats/autorecode.c.diff?tr1=1.6&tr2=1.7&r1=text&r2=text

Patches:
Index: pspp/src/data/ChangeLog
diff -u pspp/src/data/ChangeLog:1.33 pspp/src/data/ChangeLog:1.34
--- pspp/src/data/ChangeLog:1.33        Sat May  6 17:57:46 2006
+++ pspp/src/data/ChangeLog     Sat May  6 18:01:13 2006
@@ -1,3 +1,20 @@
+Sat May  6 10:58:05 2006  Ben Pfaff  <address@hidden>
+
+       Continue reforming procedure execution.  In this phase, add
+       `const' to the case passed to procedure()'s callback.
+
+       Updated all users of procedure() as well.
+       
+       * procedure.c: (struct write_case_data) Add "const" to ccase
+       parameter for case_func member.
+       (procedure) Add "const" to ccase parameter for proc_func
+       parameter.
+       (multipass_case_func) Make ccase parameter const.
+       (internal_procedure) Add "const" to ccase parameter for case_func
+       parameter.
+       (split_procedure_case_func) Make ccase parameter const.
+       (multipass_split_case_func) Make ccase parameter const.
+       
 Sat May  6 10:30:33 2006  Ben Pfaff  <address@hidden>
 
        Continue reforming procedure execution.  In this phase, get rid of
Index: pspp/src/data/procedure.c
diff -u pspp/src/data/procedure.c:1.4 pspp/src/data/procedure.c:1.5
--- pspp/src/data/procedure.c:1.4       Sat May  6 17:46:52 2006
+++ pspp/src/data/procedure.c   Sat May  6 18:01:13 2006
@@ -52,8 +52,8 @@
 struct write_case_data
   {
     /* Function to call for each case. */
-    bool (*case_func) (struct ccase *, void *); /* Function. */
-    void *aux;                                 /* Auxiliary data. */ 
+    bool (*case_func) (const struct ccase *, void *);
+    void *aux;
 
     struct ccase trns_case;     /* Case used for transformations. */
     struct ccase sink_case;     /* Case written to sink, if
@@ -96,7 +96,8 @@
 static void add_filter_trns (void);
 static void add_process_if_trns (void);
 
-static bool internal_procedure (bool (*case_func) (struct ccase *, void *),
+static bool internal_procedure (bool (*case_func) (const struct ccase *,
+                                                   void *),
                                 bool (*end_func) (void *),
                                 void *aux);
 static void update_last_vfm_invocation (void);
@@ -136,7 +137,7 @@
 
    Returns true if successful, false if an I/O error occurred. */
 bool
-procedure (bool (*proc_func) (struct ccase *, void *), void *aux)
+procedure (bool (*proc_func) (const struct ccase *, void *), void *aux)
 {
   return internal_procedure (proc_func, NULL, aux);
 }
@@ -153,7 +154,7 @@
 
 /* Case processing function for multipass_procedure(). */
 static bool
-multipass_case_func (struct ccase *c, void *aux_data_) 
+multipass_case_func (const struct ccase *c, void *aux_data_) 
 {
   struct multipass_aux_data *aux_data = aux_data_;
   return casefile_append (aux_data->casefile, c);
@@ -198,7 +199,7 @@
    Returns true if successful, false if an I/O error occurred (or
    if CASE_FUNC or END_FUNC ever returned false). */
 static bool
-internal_procedure (bool (*case_func) (struct ccase *, void *),
+internal_procedure (bool (*case_func) (const struct ccase *, void *),
                     bool (*end_func) (void *),
                     void *aux) 
 {
@@ -484,8 +485,8 @@
   };
 
 static int equal_splits (const struct ccase *, const struct ccase *);
-static bool split_procedure_case_func (struct ccase *c, void *split_aux_);
-static bool split_procedure_end_func (void *split_aux_);
+static bool split_procedure_case_func (const struct ccase *c, void *);
+static bool split_procedure_end_func (void *);
 
 /* Like procedure(), but it automatically breaks the case stream
    into SPLIT FILE break groups.  Before each group of cases with
@@ -530,7 +531,7 @@
 
 /* Case callback used by procedure_with_splits(). */
 static bool
-split_procedure_case_func (struct ccase *c, void *split_aux_) 
+split_procedure_case_func (const struct ccase *c, void *split_aux_) 
 {
   struct split_aux_data *split_aux = split_aux_;
 
@@ -590,7 +591,7 @@
     void *func_aux;                            /* Auxiliary data. */ 
   };
 
-static bool multipass_split_case_func (struct ccase *c, void *aux_);
+static bool multipass_split_case_func (const struct ccase *c, void *aux_);
 static bool multipass_split_end_func (void *aux_);
 static bool multipass_split_output (struct multipass_split_aux_data *);
 
@@ -618,7 +619,7 @@
 
 /* Case callback used by multipass_procedure_with_splits(). */
 static bool
-multipass_split_case_func (struct ccase *c, void *aux_)
+multipass_split_case_func (const struct ccase *c, void *aux_)
 {
   struct multipass_split_aux_data *aux = aux_;
   bool ok = true;
Index: pspp/src/data/procedure.h
diff -u pspp/src/data/procedure.h:1.2 pspp/src/data/procedure.h:1.3
--- pspp/src/data/procedure.h:1.2       Sat May  6 17:46:52 2006
+++ pspp/src/data/procedure.h   Sat May  6 18:01:13 2006
@@ -62,7 +62,7 @@
 void proc_set_sink (struct case_sink *);
 struct casefile *proc_capture_output (void);
 
-bool procedure (bool (*proc_func) (struct ccase *, void *),
+bool procedure (bool (*proc_func) (const struct ccase *, void *),
                 void *aux);
 bool procedure_with_splits (void (*begin_func) (const struct ccase *, void *),
                             bool (*proc_func) (const struct ccase *, void *),
Index: pspp/src/language/data-io/get.c
diff -u pspp/src/language/data-io/get.c:1.8 pspp/src/language/data-io/get.c:1.9
--- pspp/src/language/data-io/get.c:1.8 Fri May  5 04:53:12 2006
+++ pspp/src/language/data-io/get.c     Sat May  6 18:01:13 2006
@@ -450,7 +450,7 @@
 
 /* Writes case C to writer AW. */
 static bool
-case_writer_write_case (struct case_writer *aw, struct ccase *c) 
+case_writer_write_case (struct case_writer *aw, const struct ccase *c) 
 {
   if (aw->map != NULL) 
     {
@@ -462,7 +462,7 @@
 
 /* SAVE and EXPORT. */
 
-static bool output_proc (struct ccase *, void *);
+static bool output_proc (const struct ccase *, void *);
 
 /* Parses and performs the SAVE or EXPORT procedure. */
 static int
@@ -489,7 +489,7 @@
 
 /* Writes case C to file. */
 static bool
-output_proc (struct ccase *c, void *aw_) 
+output_proc (const struct ccase *c, void *aw_) 
 {
   struct case_writer *aw = aw_;
   return case_writer_write_case (aw, c);
@@ -793,7 +793,7 @@
 
 static bool mtf_read_nonactive_records (void *);
 static bool mtf_processing_finish (void *);
-static bool mtf_processing (struct ccase *, void *);
+static bool mtf_processing (const struct ccase *, void *);
 
 static char *var_type_description (struct variable *);
 
@@ -1305,10 +1305,10 @@
 static inline int
 mtf_compare_BY_values (struct mtf_proc *mtf,
                        struct mtf_file *a, struct mtf_file *b,
-                       struct ccase *c)
+                       const struct ccase *c)
 {
-  struct ccase *ca = case_is_null (&a->input) ? c : &a->input;
-  struct ccase *cb = case_is_null (&b->input) ? c : &b->input;
+  const struct ccase *ca = case_is_null (&a->input) ? c : &a->input;
+  const struct ccase *cb = case_is_null (&b->input) ? c : &b->input;
   assert ((a == NULL) + (b == NULL) + (c == NULL) <= 1);
   return case_compare_2dict (ca, cb, a->by, b->by, mtf->by_cnt);
 }
@@ -1316,7 +1316,7 @@
 /* Perform one iteration of steps 3...7 above.
    Returns true if successful, false if an I/O error occurred. */
 static bool
-mtf_processing (struct ccase *c, void *mtf_)
+mtf_processing (const struct ccase *c, void *mtf_)
 {
   struct mtf_proc *mtf = mtf_;
 
@@ -1420,7 +1420,7 @@
          
              if (mv != NULL && mtf->seq_nums[mv->index] != mtf->seq_num) 
                 {
-                  struct ccase *record
+                  const struct ccase *record
                     = case_is_null (&iter->input) ? c : &iter->input;
                   union value *out = case_data_rw (&mtf->mtf_case, mv->fv);
 
Index: pspp/src/language/stats/aggregate.c
diff -u pspp/src/language/stats/aggregate.c:1.7 
pspp/src/language/stats/aggregate.c:1.8
--- pspp/src/language/stats/aggregate.c:1.7     Fri May  5 04:53:13 2006
+++ pspp/src/language/stats/aggregate.c Sat May  6 18:01:13 2006
@@ -154,10 +154,10 @@
 static void dump_aggregate_info (struct agr_proc *agr, struct ccase *output);
 
 /* Aggregating to the active file. */
-static bool agr_to_active_file (struct ccase *, void *aux);
+static bool agr_to_active_file (const struct ccase *, void *aux);
 
 /* Aggregating to a system file. */
-static bool presorted_agr_to_sysfile (struct ccase *, void *aux);
+static bool presorted_agr_to_sysfile (const struct ccase *, void *aux);
 
 /* Parsing. */
 
@@ -1074,7 +1074,7 @@
    are dropped.
    Returns true if successful, false if an I/O error occurred. */
 static bool
-agr_to_active_file (struct ccase *c, void *agr_)
+agr_to_active_file (const struct ccase *c, void *agr_)
 {
   struct agr_proc *agr = agr_;
 
@@ -1087,7 +1087,7 @@
 /* Aggregate the current case and output it if we passed a
    breakpoint. */
 static bool
-presorted_agr_to_sysfile (struct ccase *c, void *agr_) 
+presorted_agr_to_sysfile (const struct ccase *c, void *agr_) 
 {
   struct agr_proc *agr = agr_;
 
Index: pspp/src/language/stats/autorecode.c
diff -u pspp/src/language/stats/autorecode.c:1.6 
pspp/src/language/stats/autorecode.c:1.7
--- pspp/src/language/stats/autorecode.c:1.6    Fri May  5 04:53:13 2006
+++ pspp/src/language/stats/autorecode.c        Sat May  6 18:01:13 2006
@@ -85,7 +85,7 @@
 
 static trns_proc_func autorecode_trns_proc;
 static trns_free_func autorecode_trns_free;
-static bool autorecode_proc_func (struct ccase *, void *);
+static bool autorecode_proc_func (const struct ccase *, void *);
 static hsh_compare_func compare_alpha_value, compare_numeric_value;
 static hsh_hash_func hash_alpha_value, hash_numeric_value;
 
@@ -338,7 +338,7 @@
 }
 
 static bool
-autorecode_proc_func (struct ccase *c, void *arc_)
+autorecode_proc_func (const struct ccase *c, void *arc_)
 {
   struct autorecode_pgm *arc = arc_;
   size_t i;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]