pspp-cvs
[Top][All Lists]
Advanced

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

[Pspp-cvs] pspp/src language/control/control-stack.c langu...


From: John Darrington
Subject: [Pspp-cvs] pspp/src language/control/control-stack.c langu...
Date: Sun, 22 Oct 2006 11:07:52 +0000

CVSROOT:        /sources/pspp
Module name:    pspp
Changes by:     John Darrington <jmd>   06/10/22 11:07:52

Modified files:
        src/language/control: control-stack.c control-stack.h do-if.c 
                              loop.c 
        src/language/data-io: matrix-data.c 
        src/language/stats: correlations.q crosstabs.q frequencies.q 
                            oneway.q rank.q 
        src/output     : ascii.c html.c htmlP.h manager.c manager.h 
                         output.c output.h postscript.c table.c 

Log message:
        More constness/namespace policing

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/control/control-stack.c?cvsroot=pspp&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/control/control-stack.h?cvsroot=pspp&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/control/do-if.c?cvsroot=pspp&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/control/loop.c?cvsroot=pspp&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/data-io/matrix-data.c?cvsroot=pspp&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/stats/correlations.q?cvsroot=pspp&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/stats/crosstabs.q?cvsroot=pspp&r1=1.16&r2=1.17
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/stats/frequencies.q?cvsroot=pspp&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/stats/oneway.q?cvsroot=pspp&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/stats/rank.q?cvsroot=pspp&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/pspp/src/output/ascii.c?cvsroot=pspp&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/pspp/src/output/html.c?cvsroot=pspp&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/pspp/src/output/htmlP.h?cvsroot=pspp&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/pspp/src/output/manager.c?cvsroot=pspp&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/pspp/src/output/manager.h?cvsroot=pspp&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/pspp/src/output/output.c?cvsroot=pspp&r1=1.16&r2=1.17
http://cvs.savannah.gnu.org/viewcvs/pspp/src/output/output.h?cvsroot=pspp&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/pspp/src/output/postscript.c?cvsroot=pspp&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/pspp/src/output/table.c?cvsroot=pspp&r1=1.13&r2=1.14

Patches:
Index: language/control/control-stack.c
===================================================================
RCS file: /sources/pspp/pspp/src/language/control/control-stack.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- language/control/control-stack.c    20 Oct 2006 11:32:57 -0000      1.4
+++ language/control/control-stack.c    22 Oct 2006 11:07:52 -0000      1.5
@@ -11,7 +11,7 @@
 
 struct ctl_struct
   {
-    struct ctl_class *class;    /* Class of control structure. */
+    const struct ctl_class *class;    /* Class of control structure. */
     struct ctl_struct *down;   /* Points toward the bottom of ctl_stack. */
     void *private;              /* Private data. */
   };
@@ -31,7 +31,7 @@
 }
 
 void
-ctl_stack_push (struct ctl_class *class, void *private) 
+ctl_stack_push (const struct ctl_class *class, void *private) 
 {
   struct ctl_struct *ctl;
 
@@ -44,7 +44,7 @@
 }
 
 void *
-ctl_stack_top (struct ctl_class *class) 
+ctl_stack_top (const struct ctl_class *class) 
 {
   struct ctl_struct *top = ctl_stack;
   if (top != NULL && top->class == class)
@@ -61,7 +61,7 @@
 }
 
 void *
-ctl_stack_search (struct ctl_class *class) 
+ctl_stack_search (const struct ctl_class *class) 
 {
   struct ctl_struct *ctl;
   

Index: language/control/control-stack.h
===================================================================
RCS file: /sources/pspp/pspp/src/language/control/control-stack.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- language/control/control-stack.h    4 Mar 2006 01:11:57 -0000       1.1
+++ language/control/control-stack.h    22 Oct 2006 11:07:52 -0000      1.2
@@ -30,9 +30,9 @@
   };
 
 void ctl_stack_clear (void);
-void ctl_stack_push (struct ctl_class *, void *private);
-void *ctl_stack_top (struct ctl_class *);
-void *ctl_stack_search (struct ctl_class *);
+void ctl_stack_push (const struct ctl_class *, void *private);
+void *ctl_stack_top (const struct ctl_class *);
+void *ctl_stack_search (const struct ctl_class *);
 void ctl_stack_pop (void *);
 bool ctl_stack_is_empty (void);
 

Index: language/control/do-if.c
===================================================================
RCS file: /sources/pspp/pspp/src/language/control/do-if.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- language/control/do-if.c    19 Oct 2006 15:04:53 -0000      1.7
+++ language/control/do-if.c    22 Oct 2006 11:07:52 -0000      1.8
@@ -80,7 +80,7 @@
     int past_END_IF_index;      /* Transformation just past last clause. */
   };
 
-static struct ctl_class do_if_class;
+static const struct ctl_class do_if_class;
 
 static int parse_clause (struct do_if_trns *);
 static void add_clause (struct do_if_trns *,
@@ -285,7 +285,7 @@
 }
 
 /* DO IF control structure class definition. */
-static struct ctl_class do_if_class = 
+static const struct ctl_class do_if_class = 
   {
     "DO IF",
     "END IF",

Index: language/control/loop.c
===================================================================
RCS file: /sources/pspp/pspp/src/language/control/loop.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- language/control/loop.c     19 Oct 2006 15:04:53 -0000      1.8
+++ language/control/loop.c     22 Oct 2006 11:07:52 -0000      1.9
@@ -79,7 +79,7 @@
     int past_END_LOOP_index;    /* Just past END LOOP transformation. */
   };
 
-static struct ctl_class loop_class;
+static const struct ctl_class loop_class;
 
 static trns_finalize_func loop_trns_finalize;
 static trns_proc_func loop_trns_proc, end_loop_trns_proc, break_trns_proc;
@@ -371,7 +371,7 @@
 }
 
 /* LOOP control structure class definition. */
-static struct ctl_class loop_class =
+static const struct ctl_class loop_class =
   {
     "LOOP",
     "END LOOP",

Index: language/data-io/matrix-data.c
===================================================================
RCS file: /sources/pspp/pspp/src/language/data-io/matrix-data.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- language/data-io/matrix-data.c      19 Oct 2006 15:04:53 -0000      1.12
+++ language/data-io/matrix-data.c      22 Oct 2006 11:07:52 -0000      1.13
@@ -115,7 +115,7 @@
   };
 
 /* Name of each content type. */
-static const char *content_names[PROX + 1] =
+static const char *const content_names[PROX + 1] =
   {
     "N", "N", "N_MATRIX", "MEAN", "STDDEV", "COUNT", "MSE",
     "DFE", "MAT", "COV", "CORR", "PROX",

Index: language/stats/correlations.q
===================================================================
RCS file: /sources/pspp/pspp/src/language/stats/correlations.q,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- language/stats/correlations.q       19 Oct 2006 15:04:53 -0000      1.11
+++ language/stats/correlations.q       22 Oct 2006 11:07:52 -0000      1.12
@@ -41,9 +41,9 @@
     size_t nv1, nv2;
   };
 
-struct cor_set *cor_list, *cor_last;
+static struct cor_set *cor_list, *cor_last;
 
-struct file_handle *matrix_file;
+static struct file_handle *matrix_file;
 
 static void free_correlations_state (void);
 static int internal_cmd_correlations (void);

Index: language/stats/crosstabs.q
===================================================================
RCS file: /sources/pspp/pspp/src/language/stats/crosstabs.q,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- language/stats/crosstabs.q  19 Oct 2006 15:04:53 -0000      1.16
+++ language/stats/crosstabs.q  22 Oct 2006 11:07:52 -0000      1.17
@@ -950,7 +950,7 @@
 static int ns_cols, ns_rows;
 
 /* Crosstabulation. */
-static struct crosstab *x;
+static const struct crosstab *x;
 
 /* Number of variables from the crosstabulation to consider.  This is
    either x->nvar, if pivoting is on, or 2, if pivoting is off. */

Index: language/stats/frequencies.q
===================================================================
RCS file: /sources/pspp/pspp/src/language/stats/frequencies.q,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- language/stats/frequencies.q        20 Oct 2006 11:32:57 -0000      1.17
+++ language/stats/frequencies.q        22 Oct 2006 11:07:52 -0000      1.18
@@ -118,7 +118,7 @@
   };
 
 /* Table of statistics, indexed by dsc_*. */
-static struct frq_info st_name[frq_n_stats + 1] =
+static const struct frq_info st_name[frq_n_stats + 1] =
 {
   {FRQ_ST_MEAN, N_("Mean")},
   {FRQ_ST_SEMEAN, N_("S.E. Mean")},

Index: language/stats/oneway.q
===================================================================
RCS file: /sources/pspp/pspp/src/language/stats/oneway.q,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- language/stats/oneway.q     19 Oct 2006 15:04:53 -0000      1.11
+++ language/stats/oneway.q     22 Oct 2006 11:07:52 -0000      1.12
@@ -88,7 +88,7 @@
 
 /* The number of distinct values of the independent variable, when all 
    missing values are disregarded */
-static int ostensible_number_of_groups=-1;
+static int ostensible_number_of_groups = -1;
 
 
 /* Function to use for testing for missing values */

Index: language/stats/rank.q
===================================================================
RCS file: /sources/pspp/pspp/src/language/stats/rank.q,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- language/stats/rank.q       19 Oct 2006 15:04:53 -0000      1.14
+++ language/stats/rank.q       22 Oct 2006 11:07:52 -0000      1.15
@@ -117,7 +117,7 @@
   {FMT_F, 8, 4}  /* savage */
 };
 
-static const char *function_name[n_RANK_FUNCS] = {
+static const char * const function_name[n_RANK_FUNCS] = {
   "RANK",
   "NORMAL",
   "PERCENT",
@@ -128,7 +128,7 @@
   "SAVAGE"
 };
 
-static rank_function_t rank_func[n_RANK_FUNCS] = {
+static const rank_function_t rank_func[n_RANK_FUNCS] = {
   rank_rank,
   rank_normal,
   rank_percent,

Index: output/ascii.c
===================================================================
RCS file: /sources/pspp/pspp/src/output/ascii.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- output/ascii.c      8 Jul 2006 03:05:52 -0000       1.10
+++ output/ascii.c      22 Oct 2006 11:07:52 -0000      1.11
@@ -247,7 +247,7 @@
     output_file_arg
   };
 
-static struct outp_option option_tab[] =
+static const struct outp_option option_tab[] =
   {
     {"headers", boolean_arg, 0},
     {"paginate", boolean_arg, 1},
@@ -734,7 +734,7 @@
   
 }
 
-struct outp_class ascii_class =
+const struct outp_class ascii_class =
 {
   "ascii",
   0,

Index: output/html.c
===================================================================
RCS file: /sources/pspp/pspp/src/output/html.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- output/html.c       8 Oct 2006 01:49:15 -0000       1.14
+++ output/html.c       22 Oct 2006 11:07:52 -0000      1.15
@@ -149,7 +149,7 @@
   };
 
 /* All the options that the HTML driver supports. */
-static struct outp_option option_tab[] =
+static const struct outp_option option_tab[] =
   {
     {"output-file",            string_arg,     0},
     {"chart-files",            string_arg,     1},
@@ -401,7 +401,7 @@
 
 
 /* HTML driver class. */
-struct outp_class html_class =
+const struct outp_class html_class =
   {
     "html",
     1,

Index: output/htmlP.h
===================================================================
RCS file: /sources/pspp/pspp/src/output/htmlP.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- output/htmlP.h      3 Jul 2006 17:39:07 -0000       1.6
+++ output/htmlP.h      22 Oct 2006 11:07:52 -0000      1.7
@@ -32,7 +32,7 @@
     size_t chart_cnt;
   };
 
-extern struct outp_class html_class;
+extern const struct outp_class html_class;
 
 struct outp_driver;
 void html_put_cell_contents (struct outp_driver *this,

Index: output/manager.c
===================================================================
RCS file: /sources/pspp/pspp/src/output/manager.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- output/manager.c    8 Jul 2006 03:05:52 -0000       1.9
+++ output/manager.c    22 Oct 2006 11:07:52 -0000      1.10
@@ -62,10 +62,10 @@
 }
 
 /* Driver. */
-static struct outp_driver *d=0;
+static struct outp_driver *d = 0;
 
 /* Table. */
-static struct som_entity *t=0;
+static struct som_entity *t = 0;
 
 /* Flags. */
 static unsigned flags;

Index: output/manager.h
===================================================================
RCS file: /sources/pspp/pspp/src/output/manager.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- output/manager.h    4 Mar 2006 01:11:58 -0000       1.1
+++ output/manager.h    22 Oct 2006 11:07:52 -0000      1.2
@@ -47,7 +47,7 @@
 /* Entity (Table or Chart) . */
 struct som_entity
   {
-    struct som_table_class *class;     /* Table class. */
+    const struct som_table_class *class;       /* Table class. */
     enum som_type type;                 /* Table or Chart */ 
     void *ext;                         /* Owned by */
   };

Index: output/output.c
===================================================================
RCS file: /sources/pspp/pspp/src/output/output.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- output/output.c     14 Oct 2006 00:25:21 -0000      1.16
+++ output/output.c     22 Oct 2006 11:07:52 -0000      1.17
@@ -70,12 +70,12 @@
 /* A list of driver classes. */
 struct outp_driver_class_list
   {
-    struct outp_class *class;
+    const struct outp_class *class;
     struct outp_driver_class_list *next;
   };
 
-struct outp_driver_class_list *outp_class_list;
-struct outp_driver *outp_driver_list;
+static struct outp_driver_class_list *outp_class_list;
+static struct outp_driver *outp_driver_list;
 
 char *outp_title;
 char *outp_subtitle;
@@ -91,7 +91,7 @@
 
 /* Add a class to the class list. */
 static void
-add_class (struct outp_class *class)
+add_class (const struct outp_class *class)
 {
   struct outp_driver_class_list *new_list = xmalloc (sizeof *new_list);
 
@@ -227,7 +227,6 @@
 {
   extern struct outp_class ascii_class;
   extern struct outp_class postscript_class;
-  extern struct outp_class html_class;
 
   char def[] = "default";
 
@@ -797,7 +796,7 @@
    code and stores subcategory in *SUBCAT on success.  Returns -1
    on failure. */
 int
-outp_match_keyword (const char *s, struct outp_option *tab, int *subcat)
+outp_match_keyword (const char *s, const struct outp_option *tab, int *subcat)
 {
   for (; tab->keyword != NULL; tab++)
     if (!strcmp (s, tab->keyword))

Index: output/output.h
===================================================================
RCS file: /sources/pspp/pspp/src/output/output.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- output/output.h     14 Oct 2006 00:25:21 -0000      1.6
+++ output/output.h     22 Oct 2006 11:07:52 -0000      1.7
@@ -103,7 +103,7 @@
 struct outp_driver
   {
     struct outp_driver *next, *prev; /* List of drivers. */
-    struct outp_class *class;  /* Driver class. */
+    const struct outp_class *class;    /* Driver class. */
     char *name;                        /* Name of this driver. */
     bool page_open;            /* 1=page is open, 0=page is closed. */
     int device;                        /* Zero or more of OUTP_DEV_*. */
@@ -128,8 +128,6 @@
     int subcat;                        /* Subcategory. */
   };
 
-/* List of configured output drivers. */
-extern struct outp_driver *outp_driver_list;
 
 /* Title, subtitle. */
 extern char *outp_title;
@@ -152,7 +150,7 @@
                          bool (*) (struct outp_driver *, const char *key,
                                    const struct string *value),
                          struct outp_driver *);
-int outp_match_keyword (const char *, struct outp_option *, int *);
+int outp_match_keyword (const char *, const struct outp_option *, int *);
 
 int outp_evaluate_dimension (char *, char **);
 bool outp_get_paper_size (char *, int *h, int *v);

Index: output/postscript.c
===================================================================
RCS file: /sources/pspp/pspp/src/output/postscript.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- output/postscript.c 20 Oct 2006 11:32:57 -0000      1.20
+++ output/postscript.c 22 Oct 2006 11:07:52 -0000      1.21
@@ -270,7 +270,7 @@
 };
 
 /* All the options that the PostScript driver supports. */
-static struct outp_option option_tab[] =
+static const struct outp_option option_tab[] =
 {
   {"output-file",              output_file_arg,0},
   {"paper-size",               paper_size_arg, 0},
@@ -1426,7 +1426,7 @@
 }
 
 /* PostScript driver class. */
-struct outp_class postscript_class =
+const struct outp_class postscript_class =
 {
   "postscript",
   0,

Index: output/table.c
===================================================================
RCS file: /sources/pspp/pspp/src/output/table.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- output/table.c      20 Oct 2006 11:32:57 -0000      1.13
+++ output/table.c      22 Oct 2006 11:07:52 -0000      1.14
@@ -38,7 +38,7 @@
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
 
-struct som_table_class tab_table_class;
+const struct som_table_class tab_table_class;
 static char *command_name;
 
 /* Returns the font to use for a cell with the given OPTIONS. */
@@ -1220,7 +1220,7 @@
   y = render_rows (y, c0, c1, (t->nr - t->b) * 2, t->nr * 2 + 1);
 }
 
-struct som_table_class tab_table_class =
+const struct som_table_class tab_table_class =
   {
     tabi_table,
     tabi_driver,




reply via email to

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