Rename struct floc to typedef gmk_floc as an externally scoped symbol.
authorPaul Smith <psmith@gnu.org>
Sun, 20 Jan 2013 18:16:46 +0000 (13:16 -0500)
committerPaul Smith <psmith@gnu.org>
Sun, 20 Jan 2013 18:16:46 +0000 (13:16 -0500)
12 files changed:
ChangeLog
commands.h
expand.c
function.c
guile.c
job.c
load.c
makeint.h
misc.c
read.c
variable.c
variable.h

index 92302a386b2d2b1dfa9bc38e15495ffb545bcd39..2d75dc58d2fa675824dc396819a18084a337f255 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2013-01-20  Paul Smith  <psmith@gnu.org>
 
+       * makeint.h: Change struct floc to gmk_floc typedef.
+       * Many: Use the new typedef.
+
        * make.h: Rename to makeint.h.
        * Many: Use the new name makeint.h.
 
index b2f9bdf9c0df20a6a7bb3684653c298b2f9e815a..5bc32ba4ea04f8d5be32bd42ec49ea071fe8ab84 100644 (file)
@@ -19,20 +19,20 @@ this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 struct commands
   {
-    struct floc fileinfo;      /* Where commands were defined.  */
-    char *commands;            /* Commands text.  */
-    char **command_lines;      /* Commands chopped up into lines.  */
-    char *lines_flags;         /* One set of flag bits for each line.  */
+    gmk_floc fileinfo;          /* Where commands were defined.  */
+    char *commands;             /* Commands text.  */
+    char **command_lines;       /* Commands chopped up into lines.  */
+    char *lines_flags;          /* One set of flag bits for each line.  */
     unsigned short ncommand_lines;/* Number of command lines.  */
     char recipe_prefix;         /* Recipe prefix for this command set.  */
     unsigned int any_recurse:1; /* Nonzero if any 'lines_flags' elt has */
-                               /* the COMMANDS_RECURSE bit set.  */
+                                /* the COMMANDS_RECURSE bit set.  */
   };
 
 /* Bits in 'lines_flags'.  */
-#define        COMMANDS_RECURSE        1 /* Recurses: + or $(MAKE).  */
-#define        COMMANDS_SILENT         2 /* Silent: @.  */
-#define        COMMANDS_NOERROR        4 /* No errors: -.  */
+#define COMMANDS_RECURSE        1 /* Recurses: + or $(MAKE).  */
+#define COMMANDS_SILENT         2 /* Silent: @.  */
+#define COMMANDS_NOERROR        4 /* No errors: -.  */
 
 void execute_file_commands (struct file *file);
 void print_commands (const struct commands *cmds);
index cce3bcde668888716d1ae0e9350b537845ba6f30..22a5a3511f1a988ebb231352a6fdff0f1a10c6b6 100644 (file)
--- a/expand.c
+++ b/expand.c
@@ -26,7 +26,7 @@ this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* Initially, any errors reported when expanding strings will be reported
    against the file where the error appears.  */
-const struct floc **expanding_var = &reading_file;
+const gmk_floc **expanding_var = &reading_file;
 
 /* The next two describe the variable output buffer.
    This buffer is used to hold the variable-expansion of a line of the
@@ -96,8 +96,8 @@ char *
 recursively_expand_for_file (struct variable *v, struct file *file)
 {
   char *value;
-  const struct floc *this_var;
-  const struct floc **saved_varp;
+  const gmk_floc *this_var;
+  const gmk_floc **saved_varp;
   struct variable_set_list *save = 0;
   int set_reading = 0;
 
@@ -463,7 +463,7 @@ variable_expand_for_file (const char *line, struct file *file)
 {
   char *result;
   struct variable_set_list *savev;
-  const struct floc *savef;
+  const gmk_floc *savef;
 
   if (file == 0)
     return variable_expand (line);
index d1b00ccca99daf4f33c77858627952ff7f061813..15b7aea6d55cc876cda760114fdbd4a187efe8de 100644 (file)
@@ -2484,7 +2484,7 @@ func_call (char *o, char **argv, const char *funcname UNUSED)
 }
 
 void
-define_new_function(const struct floc *flocp,
+define_new_function(const gmk_floc *flocp,
                     const char *name, int min, int max, int expand,
                     char *(*func)(char *, char **, const char *))
 {
diff --git a/guile.c b/guile.c
index 5a652d9e2f0f01a4ff39879802ef9a3e2f375474..47a21f90c459790fc355c396e225159b2743e736 100644 (file)
--- a/guile.c
+++ b/guile.c
@@ -107,7 +107,7 @@ func_guile (char *o, char **argv, const char *funcname UNUSED)
 /* We could send the flocp to define_new_function(), but since guile is
    "kind of" built-in, that didn't seem so useful.  */
 int
-guile_gmake_setup (const struct floc *flocp UNUSED)
+guile_gmake_setup (const gmk_floc *flocp UNUSED)
 {
   /* Initialize the Guile interpreter.  */
   scm_with_guile (guile_init, NULL);
diff --git a/job.c b/job.c
index aa8748f99c71ec155b768641fbe448a8f5dce104..2e2d3ffc579bb446a6d3e5c7e457cb78bf8e0da4 100644 (file)
--- a/job.c
+++ b/job.c
@@ -469,7 +469,7 @@ child_error (const struct file *file,
   const char *pre = "*** ";
   const char *post = "";
   const char *dump = "";
-  struct floc *flocp = &file->cmds->fileinfo;
+  gmk_floc *flocp = &file->cmds->fileinfo;
 
   if (ignored && silent_flag)
     return;
diff --git a/load.c b/load.c
index 3e06982df52100e948f6a54d18ac4e354d8338b2..0ed05f9ad7764b65c9c8b69a8706c1c65bc9b0bc 100644 (file)
--- a/load.c
+++ b/load.c
@@ -33,7 +33,7 @@ static void *global_dl = NULL;
 #include "variable.h"
 
 static int
-init_symbol (const struct floc *flocp, const char *ldname, load_func_t symp)
+init_symbol (const gmk_floc *flocp, const char *ldname, load_func_t symp)
 {
   int r;
   const char *p;
@@ -58,7 +58,7 @@ init_symbol (const struct floc *flocp, const char *ldname, load_func_t symp)
 }
 
 int
-load_file (const struct floc *flocp, const char **ldname, int noerror)
+load_file (const gmk_floc *flocp, const char **ldname, int noerror)
 {
   load_func_t symp;
   const char *fp;
@@ -159,7 +159,7 @@ load_file (const struct floc *flocp, const char **ldname, int noerror)
 #else
 
 int
-load_file (const struct floc *flocp, const char **ldname, int noerror)
+load_file (const gmk_floc *flocp, const char **ldname, int noerror)
 {
   if (! noerror)
     fatal (flocp, _("The 'load' operation is not supported on this platform."));
index 60ffb4ce48e0faa582e379147935378841d0e4e1..920ea07cb2162550ca9acea0764ce97af3cf9f18 100644 (file)
--- a/makeint.h
+++ b/makeint.h
@@ -362,12 +362,12 @@ extern int unixy_shell;
 extern struct rlimit stack_limit;
 #endif
 
-struct floc
+typedef struct
   {
     const char *filenm;
     unsigned long lineno;
-  };
-#define NILF ((struct floc *)0)
+  } gmk_floc;
+#define NILF ((gmk_floc *)0)
 
 #define CSTRLEN(_s) (sizeof (_s)-1)
 #define STRING_SIZE_TUPLE(_s) (_s), CSTRLEN(_s)
@@ -386,9 +386,9 @@ struct floc
 const char *concat (unsigned int, ...);
 void message (int prefix, const char *fmt, ...)
               __attribute__ ((__format__ (__printf__, 2, 3)));
-void error (const struct floc *flocp, const char *fmt, ...)
+void error (const gmk_floc *flocp, const char *fmt, ...)
             __attribute__ ((__format__ (__printf__, 2, 3)));
-void fatal (const struct floc *flocp, const char *fmt, ...)
+void fatal (const gmk_floc *flocp, const char *fmt, ...)
                    __attribute__ ((noreturn, __format__ (__printf__, 2, 3)));
 #else
 const char *concat ();
@@ -473,12 +473,12 @@ int strcache_setbufsize (unsigned int size);
 
 /* Guile support  */
 #ifdef HAVE_GUILE
-int guile_gmake_setup (const struct floc *flocp);
+int guile_gmake_setup (const gmk_floc *flocp);
 #endif
 
 /* Loadable object support.  Sets to the strcached name of the loaded file.  */
-typedef int (*load_func_t)(const struct floc *flocp);
-int load_file (const struct floc *flocp, const char **filename, int noerror);
+typedef int (*load_func_t)(const gmk_floc *flocp);
+int load_file (const gmk_floc *flocp, const char **filename, int noerror);
 
 #ifdef  HAVE_VFORK_H
 # include <vfork.h>
@@ -527,8 +527,8 @@ int strncasecmp (const char *s1, const char *s2, int n);
 # endif
 #endif
 
-extern const struct floc *reading_file;
-extern const struct floc **expanding_var;
+extern const gmk_floc *reading_file;
+extern const gmk_floc **expanding_var;
 
 extern char **environ;
 
diff --git a/misc.c b/misc.c
index e6151512c6b760d9ef5b8aa7e4026d4a75dd7d89..37fa1e17066bbace893adde32b3d1af4c88b0ad4 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -255,10 +255,10 @@ message (prefix, fmt, va_alist)
 
 void
 #if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H
-error (const struct floc *flocp, const char *fmt, ...)
+error (const gmk_floc *flocp, const char *fmt, ...)
 #else
 error (flocp, fmt, va_alist)
-     const struct floc *flocp;
+     const gmk_floc *flocp;
      const char *fmt;
      va_dcl
 #endif
@@ -288,10 +288,10 @@ error (flocp, fmt, va_alist)
 
 void
 #if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H
-fatal (const struct floc *flocp, const char *fmt, ...)
+fatal (const gmk_floc *flocp, const char *fmt, ...)
 #else
 fatal (flocp, fmt, va_alist)
-     const struct floc *flocp;
+     const gmk_floc *flocp;
      const char *fmt;
      va_dcl
 #endif
diff --git a/read.c b/read.c
index 0c682ad354a85d77a400af16f55db517c1fb9075..68287b7347c40cc46791393928048908bb19a8c8 100644 (file)
--- a/read.c
+++ b/read.c
@@ -51,7 +51,7 @@ struct ebuffer
     char *bufstart;     /* Start of the entire buffer.  */
     unsigned int size;  /* Malloc'd size of buffer. */
     FILE *fp;           /* File, or NULL if this is an internal buffer.  */
-    struct floc floc;   /* Info on the file in fp (if any).  */
+    gmk_floc floc;   /* Info on the file in fp (if any).  */
   };
 
 /* Track the modifiers we can have on variable assignments */
@@ -125,7 +125,7 @@ static unsigned int max_incl_len;
 /* The filename and pointer to line number of the
    makefile currently being read in.  */
 
-const struct floc *reading_file = 0;
+const gmk_floc *reading_file = 0;
 
 /* The chain of files read by read_all_makefiles.  */
 
@@ -139,16 +139,16 @@ static void do_undefine (char *name, enum variable_origin origin,
                          struct ebuffer *ebuf);
 static struct variable *do_define (char *name, enum variable_origin origin,
                                    struct ebuffer *ebuf);
-static int conditional_line (char *line, int len, const struct floc *flocp);
+static int conditional_line (char *line, int len, const gmk_floc *flocp);
 static void record_files (struct nameseq *filenames, const char *pattern,
                           const char *pattern_percent, char *depstr,
                           unsigned int cmds_started, char *commands,
                           unsigned int commands_idx, int two_colon,
-                          char prefix, const struct floc *flocp);
+                          char prefix, const gmk_floc *flocp);
 static void record_target_var (struct nameseq *filenames, char *defn,
                                enum variable_origin origin,
                                struct vmodifiers *vmod,
-                               const struct floc *flocp);
+                               const gmk_floc *flocp);
 static enum make_word_type get_next_mword (char *buffer, char *delim,
                                            char **startp, unsigned int *length);
 static void remove_comments (char *line);
@@ -319,7 +319,7 @@ eval_makefile (const char *filename, int flags)
 {
   struct dep *deps;
   struct ebuffer ebuf;
-  const struct floc *curfile;
+  const gmk_floc *curfile;
   char *expanded = 0;
   int makefile_errno;
 
@@ -440,7 +440,7 @@ eval_buffer (char *buffer)
   struct ebuffer ebuf;
   struct conditionals *saved;
   struct conditionals new;
-  const struct floc *curfile;
+  const gmk_floc *curfile;
 
   /* Evaluate the buffer */
 
@@ -564,8 +564,8 @@ eval (struct ebuffer *ebuf, int set_default)
   char prefix = cmd_prefix;
   const char *pattern = 0;
   const char *pattern_percent;
-  struct floc *fstart;
-  struct floc fi;
+  gmk_floc *fstart;
+  gmk_floc fi;
 
 #define record_waiting_files()                                                \
   do                                                                          \
@@ -1417,7 +1417,7 @@ do_define (char *name, enum variable_origin origin, struct ebuffer *ebuf)
 {
   struct variable *v;
   struct variable var;
-  struct floc defstart;
+  gmk_floc defstart;
   int nlevels = 1;
   unsigned int length = 100;
   char *definition = xmalloc (length);
@@ -1533,7 +1533,7 @@ do_define (char *name, enum variable_origin origin, struct ebuffer *ebuf)
    1 if following text should be ignored.  */
 
 static int
-conditional_line (char *line, int len, const struct floc *flocp)
+conditional_line (char *line, int len, const gmk_floc *flocp)
 {
   char *cmdname;
   enum { c_ifdef, c_ifndef, c_ifeq, c_ifneq, c_else, c_endif } cmdtype;
@@ -1802,7 +1802,7 @@ conditional_line (char *line, int len, const struct floc *flocp)
 static void
 record_target_var (struct nameseq *filenames, char *defn,
                    enum variable_origin origin, struct vmodifiers *vmod,
-                   const struct floc *flocp)
+                   const gmk_floc *flocp)
 {
   struct nameseq *nextf;
   struct variable_set_list *global;
@@ -1907,7 +1907,7 @@ record_files (struct nameseq *filenames, const char *pattern,
               const char *pattern_percent, char *depstr,
               unsigned int cmds_started, char *commands,
               unsigned int commands_idx, int two_colon,
-              char prefix, const struct floc *flocp)
+              char prefix, const gmk_floc *flocp)
 {
   struct commands *cmds;
   struct dep *deps;
index 0a544ad7302f1acc6fbf57e782c68075f81393c7..51f936bb2350a3dff0dad97c2dc68bd4870c844c 100644 (file)
@@ -193,7 +193,7 @@ struct variable *
 define_variable_in_set (const char *name, unsigned int length,
                         const char *value, enum variable_origin origin,
                         int recursive, struct variable_set *set,
-                        const struct floc *flocp)
+                        const gmk_floc *flocp)
 {
   struct variable *v;
   struct variable **var_slot;
@@ -1136,7 +1136,7 @@ shell_result (const char *p)
    See the try_variable_definition() function for details on the parameters. */
 
 struct variable *
-do_variable_definition (const struct floc *flocp, const char *varname,
+do_variable_definition (const gmk_floc *flocp, const char *varname,
                         const char *value, enum variable_origin origin,
                         enum variable_flavor flavor, int target_var)
 {
@@ -1572,7 +1572,7 @@ assign_variable_definition (struct variable *v, char *line)
    returned.  */
 
 struct variable *
-try_variable_definition (const struct floc *flocp, char *line,
+try_variable_definition (const gmk_floc *flocp, char *line,
                          enum variable_origin origin, int target_var)
 {
   struct variable v;
index 9f4f6e92d9583a8c3272b03df3b210f191927581..ac096d459307eddeeaa17e9576d4706c59e93811 100644 (file)
@@ -20,14 +20,14 @@ this program.  If not, see <http://www.gnu.org/licenses/>.  */
    Increasing numeric values signify less-overridable definitions.  */
 enum variable_origin
   {
-    o_default,         /* Variable from the default set.  */
-    o_env,             /* Variable from environment.  */
-    o_file,            /* Variable given in a makefile.  */
-    o_env_override,    /* Variable from environment, if -e.  */
-    o_command,         /* Variable given by user.  */
-    o_override,        /* Variable from an 'override' directive.  */
-    o_automatic,       /* Automatic variable -- cannot be set.  */
-    o_invalid          /* Core dump time.  */
+    o_default,          /* Variable from the default set.  */
+    o_env,              /* Variable from environment.  */
+    o_file,             /* Variable given in a makefile.  */
+    o_env_override,     /* Variable from environment, if -e.  */
+    o_command,          /* Variable given by user.  */
+    o_override,         /* Variable from an 'override' directive.  */
+    o_automatic,        /* Automatic variable -- cannot be set.  */
+    o_invalid           /* Core dump time.  */
   };
 
 enum variable_flavor
@@ -49,34 +49,34 @@ enum variable_flavor
 
 struct variable
   {
-    char *name;                        /* Variable name.  */
-    char *value;               /* Variable value.  */
-    struct floc fileinfo;       /* Where the variable was defined.  */
-    int length;                        /* strlen (name) */
-    unsigned int recursive:1;  /* Gets recursively re-evaluated.  */
-    unsigned int append:1;     /* Nonzero if an appending target-specific
+    char *name;                 /* Variable name.  */
+    char *value;                /* Variable value.  */
+    gmk_floc fileinfo;          /* Where the variable was defined.  */
+    int length;                 /* strlen (name) */
+    unsigned int recursive:1;   /* Gets recursively re-evaluated.  */
+    unsigned int append:1;      /* Nonzero if an appending target-specific
                                    variable.  */
     unsigned int conditional:1; /* Nonzero if set with a ?=. */
-    unsigned int per_target:1; /* Nonzero if a target-specific variable.  */
+    unsigned int per_target:1;  /* Nonzero if a target-specific variable.  */
     unsigned int special:1;     /* Nonzero if this is a special variable.  */
     unsigned int exportable:1;  /* Nonzero if the variable _could_ be
                                    exported.  */
-    unsigned int expanding:1;  /* Nonzero if currently being expanded.  */
+    unsigned int expanding:1;   /* Nonzero if currently being expanded.  */
     unsigned int private_var:1; /* Nonzero avoids inheritance of this
                                    target-specific variable.  */
     unsigned int exp_count:EXP_COUNT_BITS;
                                 /* If >1, allow this many self-referential
                                    expansions.  */
     enum variable_flavor
-      flavor ENUM_BITFIELD (3);        /* Variable flavor.  */
+      flavor ENUM_BITFIELD (3); /* Variable flavor.  */
     enum variable_origin
-      origin ENUM_BITFIELD (3);        /* Variable origin.  */
+      origin ENUM_BITFIELD (3); /* Variable origin.  */
     enum variable_export
       {
-       v_export,               /* Export this variable.  */
-       v_noexport,             /* Don't export this variable.  */
-       v_ifset,                /* Export it if it has a non-default value.  */
-       v_default               /* Decide in target_environment.  */
+        v_export,               /* Export this variable.  */
+        v_noexport,             /* Don't export this variable.  */
+        v_ifset,                /* Export it if it has a non-default value.  */
+        v_default               /* Decide in target_environment.  */
       } export ENUM_BITFIELD (2);
   };
 
@@ -84,15 +84,15 @@ struct variable
 
 struct variable_set
   {
-    struct hash_table table;   /* Hash table of variables.  */
+    struct hash_table table;    /* Hash table of variables.  */
   };
 
 /* Structure that represents a list of variable sets.  */
 
 struct variable_set_list
   {
-    struct variable_set_list *next;    /* Link in the chain.  */
-    struct variable_set *set;          /* Variable set.  */
+    struct variable_set_list *next;     /* Link in the chain.  */
+    struct variable_set *set;           /* Variable set.  */
     int next_is_parent;                 /* True if next is a parent target.  */
   };
 
@@ -116,7 +116,7 @@ char *variable_buffer_output (char *ptr, const char *string, unsigned int length
 char *variable_expand (const char *line);
 char *variable_expand_for_file (const char *line, struct file *file);
 char *allocated_variable_expand_for_file (const char *line, struct file *file);
-#define        allocated_variable_expand(line) \
+#define allocated_variable_expand(line) \
   allocated_variable_expand_for_file (line, (struct file *) 0)
 char *expand_argument (const char *str, const char *end);
 char *variable_expand_string (char *line, const char *string, long length);
@@ -152,7 +152,7 @@ void print_file_variables (const struct file *file);
 void print_target_variables (const struct file *file);
 void merge_variable_set_lists (struct variable_set_list **to_list,
                                struct variable_set_list *from_list);
-struct variable *do_variable_definition (const struct floc *flocp,
+struct variable *do_variable_definition (const gmk_floc *flocp,
                                          const char *name, const char *value,
                                          enum variable_origin origin,
                                          enum variable_flavor flavor,
@@ -160,12 +160,12 @@ struct variable *do_variable_definition (const struct floc *flocp,
 char *parse_variable_definition (const char *line,
                                  struct variable *v);
 struct variable *assign_variable_definition (struct variable *v, char *line);
-struct variable *try_variable_definition (const struct floc *flocp, char *line,
+struct variable *try_variable_definition (const gmk_floc *flocp, char *line,
                                           enum variable_origin origin,
                                           int target_var);
 void init_hash_global_variable_set (void);
 void hash_init_function_table (void);
-void define_new_function(const struct floc *flocp,
+void define_new_function(const gmk_floc *flocp,
                          const char *name, int min, int max, int expand,
                          char *(*func)(char *, char **, const char *));
 struct variable *lookup_variable (const char *name, unsigned int length);
@@ -177,7 +177,7 @@ struct variable *define_variable_in_set (const char *name, unsigned int length,
                                          enum variable_origin origin,
                                          int recursive,
                                          struct variable_set *set,
-                                         const struct floc *flocp);
+                                         const gmk_floc *flocp);
 
 /* Define a variable in the current variable set.  */