m4-patches
[Top][All Lists]
Advanced

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

ABI change on master


From: Eric Blake
Subject: ABI change on master
Date: Sat, 02 Feb 2008 16:20:00 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

In the previous patch, I noticed that I had coded up 'unsigned int argc'
but 'size_t arraylen' in struct m4_macro_args.   This inconsistency could
lead to inadvertent overflow bugs if one type is smaller than the other;
plus, a smaller type is contrary to the GNU philosophy of no arbitrary
limits (although I really doubt anyone intends to pass more than 2 billion
arguments to a macro :).  So I'm committing this patch that makes all
argument counts size_t.  This is an ABI-incompatible change for platforms
with 32-bit int and 64-bit size_t; any modules compiled prior to this
point will fail when loaded by the libm4 after this patch.  But since the
master branch has never been through a formal release, I don't feel bad
about changing the module interface; besides, I still have a TODO item to
update the module interface to use functions instead of data entry points
for defining builtins, so the interface is not stable yet.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHpPqg84KuGfSFAYARAlpoAJ9Tx5f7uAKNCikTIqP/TWMKOlW+ngCgkvaC
yc5sw7ayXs6NDFkOOSA4pCE=
=C1Td
-----END PGP SIGNATURE-----
>From 9123df1a730177cdfcd9cbbe17c5275c9473bccf Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Sat, 2 Feb 2008 14:55:08 -0700
Subject: [PATCH] Consistently use size_t for number of arguments.

* m4/m4module.h (m4_builtin_func): Alter prototype.
(struct m4_builtin): Adjust type of min_args, max_args.
(M4BUILTIN, M4BUILTIN_HANDLER): Adjust all builtins.
(m4_bad_argc, m4_dump_args, m4_macro_call, m4_arg_argc)
(m4_arg_symbol, m4_is_arg_text, m4_is_arg_func, m4_arg_text)
(m4_arg_equal, m4_arg_empty, m4_arg_len, m4_arg_func)
(m4_arg_print, m4_push_arg): Adjust all clients.
* m4/m4private.h (struct m4__symbol_chain, m4_symbol_value)
(m4_macro_args): Adjust type of various fields.
(m4__push_arg_quote): Adjust all clients.
* m4/input.c (m4_pop_wrapup): Likewise.
* m4/macro.c (m4_macro_call, trace_pre, make_argv_ref)
(arg_symbol, m4_arg_symbol, m4_is_arg_text, m4_is_arg_func)
(m4_arg_text, m4_arg_equal, m4_arg_empty, m4_arg_len)
(m4_arg_func, m4_arg_print, m4_make_argv_ref, m4_push_arg)
(m4__push_arg_quote, m4_push_args, m4_arg_argc): Likewise.
* m4/utility.c (m4_bad_argc, m4_dump_args): Likewise.
* modules/evalparse.c (m4_evaluate): Likewise.
* modules/gnu.c (changesyntax): Likewise.
* modules/m4.c (m4_dump_symbols, undefine, popdef, ifelse, defn)
(undivert, traceon, traceoff): Likewise.
* modules/m4.h (m4_dump_symbols_func): Likewise.
* modules/perl.c (perleval): Likewise.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog           |   25 +++++++++++++++++++++++++
 m4/input.c          |    3 +--
 m4/m4module.h       |   45 +++++++++++++++++++++------------------------
 m4/m4private.h      |   10 +++++-----
 m4/macro.c          |   43 +++++++++++++++++++++----------------------
 m4/utility.c        |   12 ++++++------
 modules/evalparse.c |    7 +++----
 modules/gnu.c       |    2 +-
 modules/m4.c        |   21 ++++++++++-----------
 modules/m4.h        |    6 +++---
 modules/perl.c      |    5 +++--
 11 files changed, 99 insertions(+), 80 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a732959..8ee5d0f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,30 @@
 2008-02-02  Eric Blake  <address@hidden>
 
+       Consistently use size_t for number of arguments.
+       * m4/m4module.h (m4_builtin_func): Alter prototype.
+       (struct m4_builtin): Adjust type of min_args, max_args.
+       (M4BUILTIN, M4BUILTIN_HANDLER): Adjust all builtins.
+       (m4_bad_argc, m4_dump_args, m4_macro_call, m4_arg_argc)
+       (m4_arg_symbol, m4_is_arg_text, m4_is_arg_func, m4_arg_text)
+       (m4_arg_equal, m4_arg_empty, m4_arg_len, m4_arg_func)
+       (m4_arg_print, m4_push_arg): Adjust all clients.
+       * m4/m4private.h (struct m4__symbol_chain, m4_symbol_value)
+       (m4_macro_args): Adjust type of various fields.
+       (m4__push_arg_quote): Adjust all clients.
+       * m4/input.c (m4_pop_wrapup): Likewise.
+       * m4/macro.c (m4_macro_call, trace_pre, make_argv_ref)
+       (arg_symbol, m4_arg_symbol, m4_is_arg_text, m4_is_arg_func)
+       (m4_arg_text, m4_arg_equal, m4_arg_empty, m4_arg_len)
+       (m4_arg_func, m4_arg_print, m4_make_argv_ref, m4_push_arg)
+       (m4__push_arg_quote, m4_push_args, m4_arg_argc): Likewise.
+       * m4/utility.c (m4_bad_argc, m4_dump_args): Likewise.
+       * modules/evalparse.c (m4_evaluate): Likewise.
+       * modules/gnu.c (changesyntax): Likewise.
+       * modules/m4.c (m4_dump_symbols, undefine, popdef, ifelse, defn)
+       (undivert, traceon, traceoff): Likewise.
+       * modules/m4.h (m4_dump_symbols_func): Likewise.
+       * modules/perl.c (perleval): Likewise.
+
        Stage 14b: allow pushing argv references.
        Push a $@ reference to the input engine in one go, rather than
        pushing each element.  For now, argument collection still gets one
diff --git a/m4/input.c b/m4/input.c
index 1815009..025ae0d 100644
--- a/m4/input.c
+++ b/m4/input.c
@@ -1035,8 +1035,7 @@ m4_pop_wrapup (m4 *context)
     }
 
   m4_debug_message (context, M4_DEBUG_TRACE_INPUT,
-                   _("input from m4wrap recursion level %lu"),
-                   (unsigned long int) ++level);
+                   _("input from m4wrap recursion level %zu"), ++level);
 
   current_input = wrapup_stack;
   wrapup_stack = (m4_obstack *) xmalloc (sizeof *wrapup_stack);
diff --git a/m4/m4module.h b/m4/m4module.h
index 77cfa52..bdb31a3 100644
--- a/m4/m4module.h
+++ b/m4/m4module.h
@@ -42,8 +42,7 @@ typedef struct m4_string_pair m4_string_pair;
 
 typedef struct obstack         m4_obstack;
 
-typedef void   m4_builtin_func  (m4 *, m4_obstack *, unsigned int,
-                                m4_macro_args *);
+typedef void   m4_builtin_func  (m4 *, m4_obstack *, size_t, m4_macro_args *);
 
 /* The value of m4_builtin flags is built from these:  */
 enum {
@@ -67,9 +66,9 @@ struct m4_builtin
   m4_builtin_func * func;      /* implementation of the builtin */
   const char *     name;       /* name found by builtin, printed by dumpdef */
   int              flags;      /* bitwise OR of M4_BUILTIN_* bits */
-  unsigned int     min_args;   /* 0-based minimum number of arguments */
+  size_t           min_args;   /* 0-based minimum number of arguments */
   /* max arguments, UINT_MAX if unlimited; must be >= min_args */
-  unsigned int     max_args;
+  size_t           max_args;
 };
 
 struct m4_macro
@@ -89,11 +88,11 @@ struct m4_string_pair
 
 #define M4BUILTIN(name)                                                        
\
   static void CONC (builtin_, name)                                    \
-   (m4 *context, m4_obstack *obs, unsigned int argc, m4_macro_args *argv);
+   (m4 *context, m4_obstack *obs, size_t argc, m4_macro_args *argv);
 
 #define M4BUILTIN_HANDLER(name)                                                
\
   static void CONC (builtin_, name)                                    \
-   (m4 *context, m4_obstack *obs, unsigned int argc, m4_macro_args *argv)
+   (m4 *context, m4_obstack *obs, size_t argc, m4_macro_args *argv)
 
 #define M4INIT_HANDLER(name)                                           \
   void CONC (name, CONC (_LTX_, m4_init_module))                       \
@@ -121,10 +120,10 @@ struct m4_string_pair
    scope.  */
 #define M4ARGLEN(i) m4_arg_len (argv, i)
 
-extern bool    m4_bad_argc        (m4 *, int, const char *,
-                                   unsigned int, unsigned int, bool);
+extern bool    m4_bad_argc        (m4 *, int, const char *, size_t, size_t,
+                                   bool);
 extern bool    m4_numeric_arg     (m4 *, const char *, const char *, int *);
-extern void    m4_dump_args       (m4 *, m4_obstack *, unsigned int,
+extern void    m4_dump_args       (m4 *, m4_obstack *, size_t,
                                    m4_macro_args *, const char *, bool);
 extern bool    m4_parse_truth_arg (m4 *, const char *, const char *, bool);
 
@@ -313,27 +312,25 @@ extern const m4_builtin   *m4_builtin_find_by_func 
(m4_module *,
 /* --- MACRO MANAGEMENT --- */
 
 extern void    m4_macro_expand_input   (m4 *);
-extern void    m4_macro_call           (m4 *, m4_symbol_value *,
-                                        m4_obstack *, unsigned int,
-                                        m4_macro_args *);
-extern unsigned int m4_arg_argc                (m4_macro_args *);
-extern m4_symbol_value *m4_arg_symbol  (m4_macro_args *, unsigned int);
-extern bool    m4_is_arg_text          (m4_macro_args *, unsigned int);
-extern bool    m4_is_arg_func          (m4_macro_args *, unsigned int);
-extern const char *m4_arg_text         (m4 *, m4_macro_args *, unsigned int);
-extern bool    m4_arg_equal            (m4_macro_args *, unsigned int,
-                                        unsigned int);
-extern bool    m4_arg_empty            (m4_macro_args *, unsigned int);
-extern size_t  m4_arg_len              (m4_macro_args *, unsigned int);
-extern m4_builtin_func *m4_arg_func    (m4_macro_args *, unsigned int);
+extern void    m4_macro_call           (m4 *, m4_symbol_value *, m4_obstack *,
+                                        size_t, m4_macro_args *);
+extern size_t  m4_arg_argc             (m4_macro_args *);
+extern m4_symbol_value *m4_arg_symbol  (m4_macro_args *, size_t);
+extern bool    m4_is_arg_text          (m4_macro_args *, size_t);
+extern bool    m4_is_arg_func          (m4_macro_args *, size_t);
+extern const char *m4_arg_text         (m4 *, m4_macro_args *, size_t);
+extern bool    m4_arg_equal            (m4_macro_args *, size_t, size_t);
+extern bool    m4_arg_empty            (m4_macro_args *, size_t);
+extern size_t  m4_arg_len              (m4_macro_args *, size_t);
+extern m4_builtin_func *m4_arg_func    (m4_macro_args *, size_t);
 extern m4_obstack *m4_arg_scratch      (m4 *);
 extern bool    m4_arg_print            (m4_obstack *, m4_macro_args *,
-                                        unsigned int, const m4_string_pair *,
+                                        size_t, const m4_string_pair *,
                                         size_t *, bool);
 extern m4_macro_args *m4_make_argv_ref (m4 *, m4_macro_args *, const char *,
                                         size_t, bool, bool);
 extern void    m4_push_arg             (m4 *, m4_obstack *, m4_macro_args *,
-                                        unsigned int);
+                                        size_t);
 extern void    m4_push_args            (m4 *, m4_obstack *, m4_macro_args *,
                                         bool, bool);
 
diff --git a/m4/m4private.h b/m4/m4private.h
index 1ce5813..28ac867 100644
--- a/m4/m4private.h
+++ b/m4/m4private.h
@@ -218,7 +218,7 @@ struct m4__symbol_chain
     struct
     {
       m4_macro_args *argv;             /* Reference to earlier address@hidden  
*/
-      unsigned int index;              /* Argument index within argv.  */
+      size_t index;                    /* Argument index within argv.  */
       bool_bitfield flatten : 1;       /* True to treat builtins as text.  */
       bool_bitfield comma : 1;         /* True when `,' is next input.  */
       const m4_string_pair *quotes;    /* NULL for $*, quotes for 
address@hidden  */
@@ -235,8 +235,8 @@ struct m4_symbol_value
   unsigned int         flags;
 
   m4_hash *            arg_signature;
-  unsigned int         min_args;
-  unsigned int         max_args;
+  size_t               min_args;
+  size_t               max_args;
   size_t               pending_expansions;
 
   m4__symbol_type      type;
@@ -266,7 +266,7 @@ struct m4_macro_args
   /* One more than the highest actual argument.  May be larger than
      arraylen since the array can refer to multiple arguments via a
      single $@ reference.  */
-  unsigned int argc;
+  size_t argc;
   /* False unless the macro expansion refers to $@; determines whether
      this object can be freed at end of macro expansion or must wait
      until all references have been rescanned.  */
@@ -305,7 +305,7 @@ struct m4__macro_arg_stacks
 extern size_t  m4__adjust_refcount     (m4 *, size_t, bool);
 extern bool    m4__arg_adjust_refcount (m4 *, m4_macro_args *, bool);
 extern void    m4__push_arg_quote      (m4 *, m4_obstack *, m4_macro_args *,
-                                        unsigned int, const m4_string_pair *);
+                                        size_t, const m4_string_pair *);
 
 #define VALUE_NEXT(T)          ((T)->next)
 #define VALUE_MODULE(T)                ((T)->module)
diff --git a/m4/macro.c b/m4/macro.c
index 29c8c1b..708be58 100644
--- a/m4/macro.c
+++ b/m4/macro.c
@@ -630,7 +630,7 @@ collect_arguments (m4 *context, const char *name, size_t 
len,
    the obstack EXPANSION.  Macro tracing is also handled here.  */
 void
 m4_macro_call (m4 *context, m4_symbol_value *value, m4_obstack *expansion,
-              unsigned int argc, m4_macro_args *argv)
+              size_t argc, m4_macro_args *argv)
 {
   if (m4_bad_argc (context, argc, argv->argv0,
                   VALUE_MIN_ARGS (value), VALUE_MAX_ARGS (value),
@@ -889,8 +889,8 @@ trace_prepre (m4 *context, const char *name, size_t id, 
m4_symbol_value *value)
 static void
 trace_pre (m4 *context, size_t id, m4_macro_args *argv)
 {
-  unsigned int i;
-  unsigned int argc = m4_arg_argc (argv);
+  size_t i;
+  size_t argc = m4_arg_argc (argv);
 
   trace_header (context, id);
   trace_format (context, "%s", M4ARG (0));
@@ -1016,7 +1016,7 @@ arg_mark (m4_macro_args *argv)
    empty.  */
 static m4_symbol_value *
 make_argv_ref (m4_symbol_value *value, m4_obstack *obs, size_t level,
-              m4_macro_args *argv, unsigned int index, bool flatten,
+              m4_macro_args *argv, size_t index, bool flatten,
               const m4_string_pair *quotes)
 {
   m4__symbol_chain *chain;
@@ -1064,9 +1064,9 @@ make_argv_ref (m4_symbol_value *value, m4_obstack *obs, 
size_t level,
    must be non-zero.  *LEVEL is set to the obstack level that contains
    the symbol (which is not necessarily the level of ARGV).  */
 static m4_symbol_value *
-arg_symbol (m4_macro_args *argv, unsigned int index, size_t *level)
+arg_symbol (m4_macro_args *argv, size_t index, size_t *level)
 {
-  unsigned int i;
+  size_t i;
   m4_symbol_value *value;
 
   assert (index);
@@ -1105,7 +1105,7 @@ arg_symbol (m4_macro_args *argv, unsigned int index, 
size_t *level)
 /* Given ARGV, return the symbol value at the specified INDEX, which
    must be non-zero.  */
 m4_symbol_value *
-m4_arg_symbol (m4_macro_args *argv, unsigned int index)
+m4_arg_symbol (m4_macro_args *argv, size_t index)
 {
   size_t dummy;
   return arg_symbol (argv, index, &dummy);
@@ -1114,7 +1114,7 @@ m4_arg_symbol (m4_macro_args *argv, unsigned int index)
 /* Given ARGV, return true if argument INDEX is text.  Index 0 is
    always text, as are indices beyond argc.  */
 bool
-m4_is_arg_text (m4_macro_args *argv, unsigned int index)
+m4_is_arg_text (m4_macro_args *argv, size_t index)
 {
   m4_symbol_value *value;
   if (index == 0 || argv->argc <= index)
@@ -1129,7 +1129,7 @@ m4_is_arg_text (m4_macro_args *argv, unsigned int index)
 /* Given ARGV, return true if argument INDEX is a builtin function.
    Only non-zero indices less than argc can return true.  */
 bool
-m4_is_arg_func (m4_macro_args *argv, unsigned int index)
+m4_is_arg_func (m4_macro_args *argv, size_t index)
 {
   if (index == 0 || argv->argc <= index)
     return false;
@@ -1141,7 +1141,7 @@ m4_is_arg_func (m4_macro_args *argv, unsigned int index)
    argc return the empty string.  The result is always NUL-terminated,
    even if it includes embedded NUL characters.  */
 const char *
-m4_arg_text (m4 *context, m4_macro_args *argv, unsigned int index)
+m4_arg_text (m4 *context, m4_macro_args *argv, size_t index)
 {
   m4_symbol_value *value;
   m4__symbol_chain *chain;
@@ -1175,7 +1175,7 @@ m4_arg_text (m4 *context, m4_macro_args *argv, unsigned 
int index)
    !strcmp (m4_arg_text (context, argv, indexa),
            m4_arg_text (context, argv, indexb)).  */
 bool
-m4_arg_equal (m4_macro_args *argv, unsigned int indexa, unsigned int indexb)
+m4_arg_equal (m4_macro_args *argv, size_t indexa, size_t indexb)
 {
   m4_symbol_value *sa = m4_arg_symbol (argv, indexa);
   m4_symbol_value *sb = m4_arg_symbol (argv, indexb);
@@ -1265,7 +1265,7 @@ m4_arg_equal (m4_macro_args *argv, unsigned int indexa, 
unsigned int indexb)
    This gives the same result as comparing m4_arg_len against 0, but
    is often faster.  */
 bool
-m4_arg_empty (m4_macro_args *argv, unsigned int index)
+m4_arg_empty (m4_macro_args *argv, size_t index)
 {
   return (index ? m4_arg_symbol (argv, index) == &empty_symbol
          : !argv->argv0_len);
@@ -1274,7 +1274,7 @@ m4_arg_empty (m4_macro_args *argv, unsigned int index)
 /* Given ARGV, return the length of argument INDEX.  Abort if the
    argument is not text.  Indices beyond argc return 0.  */
 size_t
-m4_arg_len (m4_macro_args *argv, unsigned int index)
+m4_arg_len (m4_macro_args *argv, size_t index)
 {
   m4_symbol_value *value;
   m4__symbol_chain *chain;
@@ -1304,7 +1304,7 @@ m4_arg_len (m4_macro_args *argv, unsigned int index)
 /* Given ARGV, return the builtin function referenced by argument
    INDEX.  Abort if it is not a single builtin.  */
 m4_builtin_func *
-m4_arg_func (m4_macro_args *argv, unsigned int index)
+m4_arg_func (m4_macro_args *argv, size_t index)
 {
   return m4_get_symbol_value_func (m4_arg_symbol (argv, index));
 }
@@ -1317,11 +1317,11 @@ m4_arg_func (m4_macro_args *argv, unsigned int index)
    MODULE, print any details about originating modules.  QUOTES count
    against the truncation length, but not module names.  */
 bool
-m4_arg_print (m4_obstack *obs, m4_macro_args *argv, unsigned int index,
+m4_arg_print (m4_obstack *obs, m4_macro_args *argv, size_t index,
              const m4_string_pair *quotes, size_t *max_len, bool module)
 {
   size_t len = max_len ? *max_len : SIZE_MAX;
-  unsigned int i;
+  size_t i;
   bool comma = false;
 
   for (i = index; i < argv->argc; i++)
@@ -1358,7 +1358,7 @@ m4_make_argv_ref (m4 *context, m4_macro_args *argv, const 
char *argv0,
   m4_macro_args *new_argv;
   m4_symbol_value *value;
   m4_symbol_value *new_value;
-  unsigned int index = skip ? 2 : 1;
+  size_t index = skip ? 2 : 1;
   m4_obstack *obs = m4_arg_scratch (context);
 
   new_value = (m4_symbol_value *) obstack_alloc (obs, sizeof *value);
@@ -1394,8 +1394,7 @@ m4_make_argv_ref (m4 *context, m4_macro_args *argv, const 
char *argv0,
 /* Push argument INDEX from ARGV, which must be a text token, onto the
    expansion stack OBS for rescanning.  */
 void
-m4_push_arg (m4 *context, m4_obstack *obs, m4_macro_args *argv,
-            unsigned int index)
+m4_push_arg (m4 *context, m4_obstack *obs, m4_macro_args *argv, size_t index)
 {
   m4_symbol_value value;
 
@@ -1416,7 +1415,7 @@ m4_push_arg (m4 *context, m4_obstack *obs, m4_macro_args 
*argv,
    reference was created.  */
 void
 m4__push_arg_quote (m4 *context, m4_obstack *obs, m4_macro_args *argv,
-                   unsigned int index, const m4_string_pair *quotes)
+                   size_t index, const m4_string_pair *quotes)
 {
   size_t level;
   m4_symbol_value *value = arg_symbol (argv, index, &level);
@@ -1442,7 +1441,7 @@ m4_push_args (m4 *context, m4_obstack *obs, m4_macro_args 
*argv, bool skip,
   m4_symbol_value tmp;
   m4_symbol_value *value;
   m4__symbol_chain *chain;
-  unsigned int i = skip ? 2 : 1;
+  size_t i = skip ? 2 : 1;
   const m4_string_pair *quotes = m4_get_syntax_quotes (M4SYNTAX);
   char *str = NULL;
   size_t len = obstack_object_size (obs);
@@ -1490,7 +1489,7 @@ m4_push_args (m4 *context, m4_obstack *obs, m4_macro_args 
*argv, bool skip,
 /* Given ARGV, return one greater than the number of arguments it
    describes.  */
 #undef m4_arg_argc
-unsigned int
+size_t
 m4_arg_argc (m4_macro_args *argv)
 {
   return argv->argc;
diff --git a/m4/utility.c b/m4/utility.c
index d95e44e..69349fe 100644
--- a/m4/utility.c
+++ b/m4/utility.c
@@ -40,8 +40,8 @@ static const char *skip_space (m4 *, const char *);
    Return true if the macro is guaranteed to expand to the empty
    string, false otherwise.  */
 bool
-m4_bad_argc (m4 *context, int argc, const char *caller, unsigned int min,
-            unsigned int max, bool side_effect)
+m4_bad_argc (m4 *context, int argc, const char *caller, size_t min, size_t max,
+            bool side_effect)
 {
   if (argc - 1 < min)
     {
@@ -99,13 +99,13 @@ m4_numeric_arg (m4 *context, const char *caller, const char 
*arg, int *valuep)
    index START, separated by SEP, and quoted by the current quotes, if
    QUOTED is true.  */
 void
-m4_dump_args (m4 *context, m4_obstack *obs, unsigned int start,
-             m4_macro_args *argv, const char *sep, bool quoted)
+m4_dump_args (m4 *context, m4_obstack *obs, size_t start, m4_macro_args *argv,
+             const char *sep, bool quoted)
 {
-  unsigned int i;
+  size_t i;
   size_t len = strlen (sep);
   bool need_sep = false;
-  unsigned int argc = m4_arg_argc (argv);
+  size_t argc = m4_arg_argc (argv);
 
   for (i = start; i < argc; i++)
     {
diff --git a/modules/evalparse.c b/modules/evalparse.c
index 39b0d41..890816d 100644
--- a/modules/evalparse.c
+++ b/modules/evalparse.c
@@ -1,6 +1,6 @@
 /* GNU m4 -- A simple macro processor
-   Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2001, 2006, 2007
-   Free Software Foundation, Inc.
+   Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2001, 2006, 2007,
+   2008 Free Software Foundation, Inc.
 
    This file is part of GNU M4.
 
@@ -885,8 +885,7 @@ simple_term (m4 *context, eval_token et, number *v1)
 
 /* Main entry point, called from "eval" and "mpeval" builtins.  */
 void
-m4_evaluate (m4 *context, m4_obstack *obs, unsigned int argc,
-             m4_macro_args *argv)
+m4_evaluate (m4 *context, m4_obstack *obs, size_t argc, m4_macro_args *argv)
 {
   const char * me      = M4ARG (0);
   const char * str     = M4ARG (1);
diff --git a/modules/gnu.c b/modules/gnu.c
index 841e660..1f6bf29 100644
--- a/modules/gnu.c
+++ b/modules/gnu.c
@@ -499,7 +499,7 @@ M4BUILTIN_HANDLER (changesyntax)
 
   if (m4_expand_ranges)
     {
-      unsigned int i;
+      size_t i;
       for (i = 1; i < argc; i++)
        {
          const char *spec = M4ARG (i);
diff --git a/modules/m4.c b/modules/m4.c
index cd4c230..ccc847c 100644
--- a/modules/m4.c
+++ b/modules/m4.c
@@ -50,8 +50,7 @@
 extern void m4_set_sysval    (int value);
 extern void m4_sysval_flush  (m4 *context, bool report);
 extern void m4_dump_symbols  (m4 *context, m4_dump_symbol_data *data,
-                             unsigned int argc, m4_macro_args *argv,
-                             bool complain);
+                             size_t argc, m4_macro_args *argv, bool complain);
 extern const char *m4_expand_ranges (const char *s, m4_obstack *obs);
 extern void m4_make_temp     (m4 *context, m4_obstack *obs, const char *macro,
                              const char *name, size_t len, bool dir);
@@ -175,7 +174,7 @@ M4BUILTIN_HANDLER (define)
 M4BUILTIN_HANDLER (undefine)
 {
   const char *me = M4ARG (0);
-  unsigned int i;
+  size_t i;
   for (i = 1; i < argc; i++)
     {
       const char *name = M4ARG (i);
@@ -203,7 +202,7 @@ M4BUILTIN_HANDLER (pushdef)
 M4BUILTIN_HANDLER (popdef)
 {
   const char *me = M4ARG (0);
-  unsigned int i;
+  size_t i;
   for (i = 1; i < argc; i++)
     {
       const char *name = M4ARG (i);
@@ -230,7 +229,7 @@ M4BUILTIN_HANDLER (ifdef)
 M4BUILTIN_HANDLER (ifelse)
 {
   const char *me = M4ARG (0);
-  unsigned int index;
+  size_t index;
 
   /* The valid ranges of argc for ifelse is discontinuous, we cannot
      rely on the regular mechanisms.  */
@@ -305,7 +304,7 @@ dump_symbol_CB (m4_symbol_table *ignored, const char *name, 
m4_symbol *symbol,
 /* If there are no arguments, build a sorted list of all defined
    symbols, otherwise, only the specified symbols.  */
 void
-m4_dump_symbols (m4 *context, m4_dump_symbol_data *data, unsigned int argc,
+m4_dump_symbols (m4 *context, m4_dump_symbol_data *data, size_t argc,
                 m4_macro_args *argv, bool complain)
 {
   const char *me = M4ARG (0);
@@ -316,7 +315,7 @@ m4_dump_symbols (m4 *context, m4_dump_symbol_data *data, 
unsigned int argc,
     m4_symtab_apply (M4SYMTAB, false, dump_symbol_CB, data);
   else
     {
-      unsigned int i;
+      size_t i;
       m4_symbol *symbol;
 
       for (i = 1; i < argc; i++)
@@ -374,7 +373,7 @@ M4BUILTIN_HANDLER (dumpdef)
 M4BUILTIN_HANDLER (defn)
 {
   const char *me = M4ARG (0);
-  unsigned int i;
+  size_t i;
 
   for (i = 1; i < argc; i++)
     {
@@ -577,7 +576,7 @@ M4BUILTIN_HANDLER (divnum)
 
 M4BUILTIN_HANDLER (undivert)
 {
-  unsigned int i = 0;
+  size_t i = 0;
   const char *me = M4ARG (0);
 
   if (argc == 1)
@@ -861,7 +860,7 @@ M4BUILTIN_HANDLER (m4wrap)
 
 M4BUILTIN_HANDLER (traceon)
 {
-  unsigned int i;
+  size_t i;
 
   if (argc == 1)
     m4_set_debug_level_opt (context, (m4_get_debug_level_opt (context)
@@ -874,7 +873,7 @@ M4BUILTIN_HANDLER (traceon)
 /* Disable tracing of all specified macros, or all, if none is specified.  */
 M4BUILTIN_HANDLER (traceoff)
 {
-  unsigned int i;
+  size_t i;
 
   if (argc == 1)
     m4_set_debug_level_opt (context, (m4_get_debug_level_opt (context)
diff --git a/modules/m4.h b/modules/m4.h
index 81dfef4..e1c3f96 100644
--- a/modules/m4.h
+++ b/modules/m4.h
@@ -1,5 +1,5 @@
 /* GNU m4 -- A simple macro processor
-   Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2006, 2007, 2008 Free Software Foundation, Inc.
 
    This file is part of GNU M4.
 
@@ -39,12 +39,12 @@ typedef struct
 typedef void m4_sysval_flush_func (m4 *context, bool report);
 typedef void m4_set_sysval_func (int value);
 typedef void m4_dump_symbols_func (m4 *context, m4_dump_symbol_data *data,
-                                  unsigned int argc, m4_macro_args *argv,
+                                  size_t argc, m4_macro_args *argv,
                                   bool complain);
 typedef const char *m4_expand_ranges_func (const char *s, m4_obstack *obs);
 typedef void m4_make_temp_func (m4 *context, m4_obstack *obs,
                                const char *macro, const char *name,
-                                size_t len, bool dir);
+                               size_t len, bool dir);
 
 END_C_DECLS
 
diff --git a/modules/perl.c b/modules/perl.c
index f129af0..46cf2cd 100644
--- a/modules/perl.c
+++ b/modules/perl.c
@@ -1,5 +1,6 @@
 /* GNU m4 -- A simple macro processor
-   Copyright (C) 1999, 2000, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2006, 2007, 2008 Free Software
+   Foundation, Inc.
 
    This file is part of GNU M4.
 
@@ -114,7 +115,7 @@ M4FINISH_HANDLER (perl)
 M4BUILTIN_HANDLER (perleval)
 {
   SV *val;
-  unsigned int i;
+  size_t i;
 
   for (i = 1; i < argc; i++)
     {
-- 
1.5.3.8


reply via email to

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