bug-gnulib
[Top][All Lists]
Advanced

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

Re: [Bug-gnulib] 03-getndelim2-c89.diff


From: Derek Robert Price
Subject: Re: [Bug-gnulib] 03-getndelim2-c89.diff
Date: Wed, 23 Jul 2003 14:35:24 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1

Paul Eggert wrote:

Derek Robert Price <address@hidden> writes:
I was toying with the idea of writing a script that could convert the
pre-ANSI function declarations in CVS to ANSI declarations for
neatness, completeness, because I think the Perl script required is
going to be on the order of 10-20 lines, and because the pre-ANSI
declarations have always irritated me ;).

Feel free, though I should warn you that the conversion is a bit
trickier than it might appear at first.

Can you use the 'protoize' command supplied by GCC?

protoize did the trick, though I must admit, I was a little bit disappointed. I had almost finished the Perl script to do the same thing. I could detect the function decl lines and was most of the way through munging the data into proper output. :)

Anyway, here's the patch. Most of the changes in it were automated, except for regex.c. I noticed while I was formatting the protoized versions of the function decls to max out at 80 characters that there were some functions that hadn't been converted due to the state of the defines and I converted them by hand. I checked the diff twice, but it might be worth running regex.c through a test suite if there is one before committing it.

    * bcopy.c: Protoize pre-ANSI C function declarations.
    * gethostname.c: Ditto.
    * getloadavg.c: Ditto.
    * getusershell.c: Ditto.
    * md5.c: Ditto.
    * memchr.c: Ditto.
    * memmove.c: Ditto.
    * readtokens.c: Ditto.
    * realloc.c: Ditto.
    * regex.c: Ditto.
    * rmdir.c: Ditto.
    * strchrnul.c: Ditto.
    * strerror.c: Ditto.
    * xgethostname.c: Ditto.
    * xstrtod.c: Ditto.
    * yesno.c: Ditto.

Index: bcopy.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/bcopy.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 bcopy.c
--- bcopy.c     8 Nov 1992 02:50:45 -0000       1.1.1.1
+++ bcopy.c     23 Jul 2003 18:32:47 -0000
@@ -4,9 +4,7 @@
   By David MacKenzie <address@hidden>.  */

void
-bcopy (source, dest, length)
-     char *source, *dest;
-     unsigned length;
+bcopy (char *source, char *dest, unsigned int length)
{
  if (source < dest)
    /* Moving from low mem to hi mem; start at end.  */
Index: gethostname.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/gethostname.c,v
retrieving revision 1.5
diff -u -r1.5 gethostname.c
--- gethostname.c       7 Aug 2000 15:48:18 -0000       1.5
+++ gethostname.c       23 Jul 2003 18:32:47 -0000
@@ -30,9 +30,7 @@
   Return 0 if ok, -1 if error.  */

int
-gethostname (name, len)
-     char *name;
-     int len;
+gethostname (char *name, int len)
{
#ifdef HAVE_UNAME
  struct utsname uts;
Index: getloadavg.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/getloadavg.c,v
retrieving revision 1.16
diff -u -r1.16 getloadavg.c
--- getloadavg.c        19 Jun 2000 07:25:01 -0000      1.16
+++ getloadavg.c        23 Jul 2003 18:32:47 -0000
@@ -552,9 +552,7 @@
   or -1 if an error occurred.  */

int
-getloadavg (loadavg, nelem)
-     double loadavg[];
-     int nelem;
+getloadavg (double *loadavg, int nelem)
{
  int elem = 0;                 /* Return value.  */

@@ -1046,9 +1044,7 @@

#ifdef TEST
void
-main (argc, argv)
-     int argc;
-     char **argv;
+main (int argc, char **argv)
{
  int naptime = 0;

Index: getusershell.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/getusershell.c,v
retrieving revision 1.14
diff -u -r1.14 getusershell.c
--- getusershell.c      17 Nov 2001 13:29:42 -0000      1.14
+++ getusershell.c      23 Jul 2003 18:32:47 -0000
@@ -82,7 +82,7 @@
   Return NULL if there are no more entries.  */

char *
-getusershell ()
+getusershell (void)
{
  if (default_index > 0)
    {
@@ -114,7 +114,7 @@
/* Rewind the shells file. */

void
-setusershell ()
+setusershell (void)
{
  default_index = 0;
  if (shellstream)
@@ -124,7 +124,7 @@
/* Close the shells file. */

void
-endusershell ()
+endusershell (void)
{
  if (shellstream)
    {
@@ -142,10 +142,7 @@
   if some nonempty sequence was found, otherwise 0.  */

static int
-readname (name, size, stream)
-     char **name;
-     int *size;
-     FILE *stream;
+readname (char **name, int *size, FILE *stream)
{
  int c;
  int name_index = 0;
Index: md5.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/md5.c,v
retrieving revision 1.13
diff -u -r1.13 md5.c
--- md5.c       17 Nov 2001 13:29:42 -0000      1.13
+++ md5.c       23 Jul 2003 18:32:47 -0000
@@ -61,8 +61,7 @@
/* Initialize structure containing state of computation.
   (RFC 1321, 3.3: Step 3)  */
void
-md5_init_ctx (ctx)
-     struct md5_ctx *ctx;
+md5_init_ctx (struct md5_ctx *ctx)
{
  ctx->A = 0x67452301;
  ctx->B = 0xefcdab89;
@@ -79,9 +78,7 @@
   IMPORTANT: On some systems it is required that RESBUF is correctly
   aligned for a 32 bits value.  */
void *
-md5_read_ctx (ctx, resbuf)
-     const struct md5_ctx *ctx;
-     void *resbuf;
+md5_read_ctx (const struct md5_ctx *ctx, void *resbuf)
{
  ((md5_uint32 *) resbuf)[0] = SWAP (ctx->A);
  ((md5_uint32 *) resbuf)[1] = SWAP (ctx->B);
@@ -97,9 +94,7 @@
   IMPORTANT: On some systems it is required that RESBUF is correctly
   aligned for a 32 bits value.  */
void *
-md5_finish_ctx (ctx, resbuf)
-     struct md5_ctx *ctx;
-     void *resbuf;
+md5_finish_ctx (struct md5_ctx *ctx, void *resbuf)
{
  /* Take yet unprocessed bytes into account.  */
  md5_uint32 bytes = ctx->buflen;
@@ -128,9 +123,7 @@
   resulting message digest number will be written into the 16 bytes
   beginning at RESBLOCK.  */
int
-md5_stream (stream, resblock)
-     FILE *stream;
-     void *resblock;
+md5_stream (FILE *stream, void *resblock)
{
  /* Important: BLOCKSIZE must be a multiple of 64.  */
#define BLOCKSIZE 4096
@@ -185,10 +178,7 @@
   output yields to the wanted ASCII representation of the message
   digest.  */
void *
-md5_buffer (buffer, len, resblock)
-     const char *buffer;
-     size_t len;
-     void *resblock;
+md5_buffer (const char *buffer, size_t len, void *resblock)
{
  struct md5_ctx ctx;

@@ -204,10 +194,7 @@


void
-md5_process_bytes (buffer, len, ctx)
-     const void *buffer;
-     size_t len;
-     struct md5_ctx *ctx;
+md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx)
{
  /* When we already have some bits in our internal buffer concatenate
     both inputs first.  */
@@ -262,10 +249,7 @@
   It is assumed that LEN % 64 == 0.  */

void
-md5_process_block (buffer, len, ctx)
-     const void *buffer;
-     size_t len;
-     struct md5_ctx *ctx;
+md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx)
{
  md5_uint32 correct_words[16];
  const md5_uint32 *words = buffer;
Index: memchr.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/memchr.c,v
retrieving revision 1.15
diff -u -r1.15 memchr.c
--- memchr.c    28 Oct 2000 08:22:11 -0000      1.15
+++ memchr.c    23 Jul 2003 18:32:47 -0000
@@ -67,10 +67,7 @@

/* Search no more than N bytes of S for C.  */
__ptr_t
-__memchr (s, c_in, n)
-     const __ptr_t s;
-     int c_in;
-     size_t n;
+__memchr (const void *s, int c_in, size_t n)
{
  const unsigned char *char_ptr;
  const unsigned long int *longword_ptr;
Index: memmove.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/memmove.c,v
retrieving revision 1.7
diff -u -r1.7 memmove.c
--- memmove.c   17 Oct 1996 03:05:09 -0000      1.7
+++ memmove.c   23 Jul 2003 18:32:47 -0000
@@ -8,10 +8,7 @@
#endif

void *
-memmove (dest, source, length)
-     char *dest;
-     const char *source;
-     unsigned length;
+memmove (char *dest, const char *source, unsigned int length)
{
  char *d0 = dest;
  if (source < dest)
Index: readtokens.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/readtokens.c,v
retrieving revision 1.11
diff -u -r1.11 readtokens.c
--- readtokens.c        7 Jun 2003 10:16:29 -0000       1.11
+++ readtokens.c        23 Jul 2003 18:32:47 -0000
@@ -58,8 +58,7 @@
/* Initialize a tokenbuffer. */

void
-init_tokenbuffer (tokenbuffer)
-     token_buffer *tokenbuffer;
+init_tokenbuffer (token_buffer *tokenbuffer)
{
  tokenbuffer->size = INITIAL_TOKEN_LENGTH;
  tokenbuffer->buffer = xmalloc (INITIAL_TOKEN_LENGTH);
Index: realloc.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/realloc.c,v
retrieving revision 1.7
diff -u -r1.7 realloc.c
--- realloc.c   4 Jun 2003 19:22:29 -0000       1.7
+++ realloc.c   23 Jul 2003 18:32:47 -0000
@@ -32,9 +32,7 @@
   use malloc.  */

char *
-rpl_realloc (p, n)
-     char *p;
-     size_t n;
+rpl_realloc (char *p, size_t n)
{
  if (n == 0)
    n = 1;
Index: regex.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/regex.c,v
retrieving revision 1.79
diff -u -r1.79 regex.c
--- regex.c     25 Nov 2002 00:17:33 -0000      1.79
+++ regex.c     23 Jul 2003 18:32:49 -0000
@@ -276,7 +276,7 @@
static void init_syntax_once PARAMS ((void));

static void
-init_syntax_once ()
+init_syntax_once (void)
{
   register int c;
   static int done = 0;
@@ -688,9 +688,7 @@
# ifdef DEBUG
static void PREFIX(extract_number) _RE_ARGS ((int *dest, UCHAR_T *source));
static void
-PREFIX(extract_number) (dest, source)
-    int *dest;
-    UCHAR_T *source;
+PREFIX(extract_number) (int *dest, UCHAR_T *source)
{
#  ifdef WCHAR
  *dest = *source;
@@ -721,9 +719,7 @@
static void PREFIX(extract_number_and_incr) _RE_ARGS ((int *destination,
                                                       UCHAR_T **source));
static void
-PREFIX(extract_number_and_incr) (destination, source)
-    int *destination;
-    UCHAR_T **source;
+PREFIX(extract_number_and_incr) (int *destination, UCHAR_T **source)
{
  PREFIX(extract_number) (destination, *source);
  *source += OFFSET_ADDRESS_SIZE;
@@ -774,8 +770,7 @@

#  ifndef DEFINED_ONCE
void
-print_fastmap (fastmap)
-    char *fastmap;
+print_fastmap (char *fastmap)
{
  unsigned was_a_range = 0;
  unsigned i = 0;
@@ -807,9 +802,7 @@
   the START pointer into it and ending just before the pointer END.  */

void
-PREFIX(print_partial_compiled_pattern) (start, end)
-    UCHAR_T *start;
-    UCHAR_T *end;
+PREFIX(print_partial_compiled_pattern) (UCHAR_T *start, UCHAR_T *end)
{
  int mcnt, mcnt2;
  UCHAR_T *p1;
@@ -1142,8 +1135,7 @@


void
-PREFIX(print_compiled_pattern) (bufp)
-    struct re_pattern_buffer *bufp;
+PREFIX(print_compiled_pattern) (struct re_pattern_buffer *bufp)
{
  UCHAR_T *buffer = (UCHAR_T*) bufp->buffer;

@@ -1175,12 +1167,8 @@


void
-PREFIX(print_double_string) (where, string1, size1, string2, size2)
-    const CHAR_T *where;
-    const CHAR_T *string1;
-    const CHAR_T *string2;
-    int size1;
-    int size2;
+PREFIX(print_double_string) (const CHAR_T *where, const CHAR_T *string1,
+                            int size1, const CHAR_T *string2, int size2)
{
  int this_char;

@@ -1213,8 +1201,7 @@

#  ifndef DEFINED_ONCE
void
-printchar (c)
-     int c;
+printchar (int c)
{
  putc (c, stderr);
}
@@ -1247,15 +1234,9 @@
   We assume offset_buffer and is_binary is already allocated
   enough space.  */

-static size_t convert_mbs_to_wcs (CHAR_T *dest, const unsigned char* src,
-                                 size_t len, int *offset_buffer,
-                                 char *is_binary);
static size_t
-convert_mbs_to_wcs (dest, src, len, offset_buffer, is_binary)
-     CHAR_T *dest;
-     const unsigned char* src;
-     size_t len; /* the length of multibyte string.  */
-
+convert_mbs_to_wcs (CHAR_T *dest, const unsigned char* src,
+                   size_t len, /* the length of multibyte string.  */
     /* It hold correspondances between src(char string) and
        dest(wchar_t string) for optimization.
        e.g. src  = "xxxyzz"
@@ -1265,8 +1246,7 @@
          offset_buffer = {0, 0+3("xxx"), 0+3+1("y"), 0+3+1+2("zz")}
                        = {0, 3, 4, 6}
     */
-     int *offset_buffer;
-     char *is_binary;
+                   int *offset_buffer, char *is_binary)
{
  wchar_t *pdest = dest;
  const unsigned char *psrc = src;
@@ -1333,8 +1313,7 @@
   defined in regex.h.  We return the old syntax.  */

reg_syntax_t
-re_set_syntax (syntax)
-    reg_syntax_t syntax;
+re_set_syntax (reg_syntax_t syntax)
{
  reg_syntax_t ret = re_syntax_options;

@@ -2293,8 +2272,7 @@
   but don't make them smaller.  */

static void
-PREFIX(regex_grow_registers) (num_regs)
-     int num_regs;
+PREFIX(regex_grow_registers) (int num_regs)
{
  if (num_regs > regs_allocated_size)
    {
@@ -2348,11 +2326,9 @@
# endif /* WCHAR */

static reg_errcode_t
-PREFIX(regex_compile) (ARG_PREFIX(pattern), ARG_PREFIX(size), syntax, bufp)
-     const char *ARG_PREFIX(pattern);
-     size_t ARG_PREFIX(size);
-     reg_syntax_t syntax;
-     struct re_pattern_buffer *bufp;
+PREFIX(regex_compile) (const char *ARG_PREFIX(pattern),
+                      size_t ARG_PREFIX(size), reg_syntax_t syntax,
+                      struct re_pattern_buffer *bufp)
{
  /* We fetch characters from PATTERN here.  Even though PATTERN is
     `char *' (i.e., signed), we declare these variables as unsigned, so
@@ -4292,10 +4268,7 @@
/* ifdef WCHAR, integer parameter is 1 wchar_t.  */

static void
-PREFIX(store_op1) (op, loc, arg)
-    re_opcode_t op;
-    UCHAR_T *loc;
-    int arg;
+PREFIX(store_op1) (re_opcode_t op, UCHAR_T *loc, int arg)
{
  *loc = (UCHAR_T) op;
  STORE_NUMBER (loc + 1, arg);
@@ -4306,10 +4279,7 @@
/* ifdef WCHAR, integer parameter is 1 wchar_t.  */

static void
-PREFIX(store_op2) (op, loc, arg1, arg2)
-    re_opcode_t op;
-    UCHAR_T *loc;
-    int arg1, arg2;
+PREFIX(store_op2) (re_opcode_t op, UCHAR_T *loc, int arg1, int arg2)
{
  *loc = (UCHAR_T) op;
  STORE_NUMBER (loc + 1, arg1);
@@ -4322,11 +4292,7 @@
/* ifdef WCHAR, integer parameter is 1 wchar_t.  */

static void
-PREFIX(insert_op1) (op, loc, arg, end)
-    re_opcode_t op;
-    UCHAR_T *loc;
-    int arg;
-    UCHAR_T *end;
+PREFIX(insert_op1) ( re_opcode_t op, UCHAR_T *loc, int arg, UCHAR_T *end)
{
  register UCHAR_T *pfrom = end;
  register UCHAR_T *pto = end + 1 + OFFSET_ADDRESS_SIZE;
@@ -4342,11 +4308,8 @@
/* ifdef WCHAR, integer parameter is 1 wchar_t.  */

static void
-PREFIX(insert_op2) (op, loc, arg1, arg2, end)
-    re_opcode_t op;
-    UCHAR_T *loc;
-    int arg1, arg2;
-    UCHAR_T *end;
+PREFIX(insert_op2) (re_opcode_t op, UCHAR_T *loc, int arg1, int arg2,
+                   UCHAR_T *end)
{
  register UCHAR_T *pfrom = end;
  register UCHAR_T *pto = end + 1 + 2 * OFFSET_ADDRESS_SIZE;
@@ -4363,9 +4326,8 @@
   least one character before the ^.  */

static boolean
-PREFIX(at_begline_loc_p) (pattern, p, syntax)
-    const CHAR_T *pattern, *p;
-    reg_syntax_t syntax;
+PREFIX(at_begline_loc_p) (const CHAR_T *pattern, const CHAR_T *p,
+                         reg_syntax_t syntax)
{
  const CHAR_T *prev = p - 2;
  boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\';
@@ -4382,9 +4344,8 @@
   at least one character after the $, i.e., `P < PEND'.  */

static boolean
-PREFIX(at_endline_loc_p) (p, pend, syntax)
-    const CHAR_T *p, *pend;
-    reg_syntax_t syntax;
+PREFIX(at_endline_loc_p) (const CHAR_T *p, const CHAR_T *pend,
+                         reg_syntax_t syntax)
{
  const CHAR_T *next = p;
  boolean next_backslash = *next == '\\';
@@ -4405,9 +4366,7 @@
   false if it's not.  */

static boolean
-group_in_compile_stack (compile_stack, regnum)
-    compile_stack_type compile_stack;
-    regnum_t regnum;
+group_in_compile_stack (compile_stack_type compile_stack, regnum_t regnum)
{
  int this_element;

@@ -4427,10 +4386,7 @@
/* This insert space, which size is "num", into the pattern at "loc".
   "end" must point the end of the allocated buffer.  */
static void
-insert_space (num, loc, end)
-     int num;
-     CHAR_T *loc;
-     CHAR_T *end;
+insert_space (int num, CHAR_T *loc, CHAR_T *end)
{
  register CHAR_T *pto = end;
  register CHAR_T *pfrom = end - num;
@@ -4442,13 +4398,9 @@

#ifdef WCHAR
static reg_errcode_t
-wcs_compile_range (range_start_char, p_ptr, pend, translate, syntax, b,
-                  char_set)
-     CHAR_T range_start_char;
-     const CHAR_T **p_ptr, *pend;
-     CHAR_T *char_set, *b;
-     RE_TRANSLATE_TYPE translate;
-     reg_syntax_t syntax;
+wcs_compile_range (CHAR_T range_start_char, const CHAR_T **p_ptr,
+                  const CHAR_T *pend, RE_TRANSLATE_TYPE translate,
+                  reg_syntax_t syntax, CHAR_T *b, CHAR_T *char_set)
{
  const CHAR_T *p = *p_ptr;
  CHAR_T range_start, range_end;
@@ -4529,12 +4481,9 @@
   `regex_compile' itself.  */

static reg_errcode_t
-byte_compile_range (range_start_char, p_ptr, pend, translate, syntax, b)
-     unsigned int range_start_char;
-     const char **p_ptr, *pend;
-     RE_TRANSLATE_TYPE translate;
-     reg_syntax_t syntax;
-     unsigned char *b;
+byte_compile_range (unsigned int range_start_char, const char **p_ptr,
+                   const char *pend, char *translate, reg_syntax_t syntax,
+                   unsigned char *b)
{
  unsigned this_char;
  const char *p = *p_ptr;
@@ -4615,8 +4564,7 @@
static unsigned char truncate_wchar (CHAR_T c);

static unsigned char
-truncate_wchar (c)
-     CHAR_T c;
+truncate_wchar (CHAR_T c)
{
  unsigned char buf[MB_CUR_MAX];
  mbstate_t state;
@@ -4628,8 +4576,7 @@
#endif /* WCHAR */

static int
-PREFIX(re_compile_fastmap) (bufp)
-     struct re_pattern_buffer *bufp;
+PREFIX(re_compile_fastmap) (struct re_pattern_buffer *bufp)
{
  int j, k;
#ifdef MATCH_MAY_ALLOCATE
@@ -4948,8 +4895,7 @@
#else /* not INSIDE_RECURSION */

int
-re_compile_fastmap (bufp)
-     struct re_pattern_buffer *bufp;
+re_compile_fastmap (struct re_pattern_buffer *bufp)
{
# ifdef MBS_SUPPORT
  if (MB_CUR_MAX != 1)
@@ -4977,11 +4923,8 @@
   freeing the old data.  */

void
-re_set_registers (bufp, regs, num_regs, starts, ends)
-    struct re_pattern_buffer *bufp;
-    struct re_registers *regs;
-    unsigned num_regs;
-    regoff_t *starts, *ends;
+re_set_registers (struct re_pattern_buffer *bufp, struct re_registers *regs,
+                 unsigned int num_regs, regoff_t *starts, regoff_t *ends)
{
  if (num_regs)
    {
@@ -5007,11 +4950,8 @@
   doesn't let you say where to stop matching.  */

int
-re_search (bufp, string, size, startpos, range, regs)
-     struct re_pattern_buffer *bufp;
-     const char *string;
-     int size, startpos, range;
-     struct re_registers *regs;
+re_search (struct re_pattern_buffer *bufp, const char *string, int size,
+          int startpos, int range, struct re_registers *regs)
{
  return re_search_2 (bufp, NULL, 0, string, size, startpos, range,
                      regs, size);
@@ -5043,14 +4983,9 @@
   stack overflow).  */

int
-re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
-     struct re_pattern_buffer *bufp;
-     const char *string1, *string2;
-     int size1, size2;
-     int startpos;
-     int range;
-     struct re_registers *regs;
-     int stop;
+re_search_2 (struct re_pattern_buffer *bufp, const char *string1, int size1,
+            const char *string2, int size2, int startpos, int range,
+            struct re_registers *regs, int stop)
{
# ifdef MBS_SUPPORT
  if (MB_CUR_MAX != 1)
@@ -5106,15 +5041,10 @@


static int
-PREFIX(re_search_2) (bufp, string1, size1, string2, size2, startpos, range,
-                    regs, stop)
-     struct re_pattern_buffer *bufp;
-     const char *string1, *string2;
-     int size1, size2;
-     int startpos;
-     int range;
-     struct re_registers *regs;
-     int stop;
+PREFIX(re_search_2) (struct re_pattern_buffer *bufp,
+                    const char *string1, int size1, const char *string2,
+                    int size2, int startpos, int range,
+                    struct re_registers *regs, int stop)
{
  int val;
  register char *fastmap = bufp->fastmap;
@@ -5497,11 +5427,8 @@
/* re_match is like re_match_2 except it takes only a single string.  */

int
-re_match (bufp, string, size, pos, regs)
-     struct re_pattern_buffer *bufp;
-     const char *string;
-     int size, pos;
-     struct re_registers *regs;
+re_match (struct re_pattern_buffer *bufp, const char *string, int size,
+         int pos, struct re_registers *regs)
{
  int result;
# ifdef MBS_SUPPORT
@@ -5555,13 +5482,9 @@
   matched substring.  */

int
-re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
-     struct re_pattern_buffer *bufp;
-     const char *string1, *string2;
-     int size1, size2;
-     int pos;
-     struct re_registers *regs;
-     int stop;
+re_match_2 (struct re_pattern_buffer *bufp, const char *string1, int size1,
+           const char *string2, int size2, int pos, struct re_registers *regs,
+           int stop)
{
  int result;
# ifdef MBS_SUPPORT
@@ -5598,9 +5521,7 @@
   See convert_mbs_to_wcs.  */

static int
-count_mbs_length(offset_buffer, length)
-     int *offset_buffer;
-     int length;
+count_mbs_length (int *offset_buffer, int length)
{
  int upper, lower;

@@ -5640,34 +5561,25 @@
/* This is a separate function so that we can force an alloca cleanup
   afterwards.  */
#ifdef WCHAR
+/* string1 == string2 == NULL means string1/2, size1/2 and
+   mbs_offset1/2 need seting up in this function.  */
+/* We need wchar_t* buffers correspond to cstring1, cstring2.  */
+/* We need the size of wchar_t buffers correspond to csize1, csize2.  */
+/* mbs_offset1 & mbsoffset2 are offset buffer for optimizatoin.  See
+   convert_mbs_to_wc.  */
static int
-wcs_re_match_2_internal (bufp, cstring1, csize1, cstring2, csize2, pos,
-                        regs, stop, string1, size1, string2, size2,
-                        mbs_offset1, mbs_offset2)
-     struct re_pattern_buffer *bufp;
-     const char *cstring1, *cstring2;
-     int csize1, csize2;
-     int pos;
-     struct re_registers *regs;
-     int stop;
-     /* string1 == string2 == NULL means string1/2, size1/2 and
-       mbs_offset1/2 need seting up in this function.  */
-     /* We need wchar_t* buffers correspond to cstring1, cstring2.  */
-     wchar_t *string1, *string2;
-     /* We need the size of wchar_t buffers correspond to csize1, csize2.  */
-     int size1, size2;
-     /* offset buffer for optimizatoin. See convert_mbs_to_wc.  */
-     int *mbs_offset1, *mbs_offset2;
+wcs_re_match_2_internal (struct re_pattern_buffer *bufp;
+                        const char *cstring1, int csize1,
+                        const char *cstring2, int csize2, int pos,
+                        struct re_registers *regs, int stop,
+                        wchar_t *string1, int size1,
+                        wchar_t *string2, int size2,
+                        int *mbs_offset1, int *mbs_offset2)
#else /* BYTE */
static int
-byte_re_match_2_internal (bufp, string1, size1,string2, size2, pos,
-                         regs, stop)
-     struct re_pattern_buffer *bufp;
-     const char *string1, *string2;
-     int size1, size2;
-     int pos;
-     struct re_registers *regs;
-     int stop;
+byte_re_match_2_internal (struct re_pattern_buffer *bufp, const char *string1,
+                         int size1, const char *string2, int size2, int pos,
+                         struct re_registers *regs, int stop)
#endif /* BYTE */
{
  /* General temporaries.  */
@@ -7696,9 +7608,8 @@
   We don't handle duplicates properly (yet).  */

static boolean
-PREFIX(group_match_null_string_p) (p, end, reg_info)
-    UCHAR_T **p, *end;
-    PREFIX(register_info_type) *reg_info;
+PREFIX(group_match_null_string_p) (UCHAR_T **p, UCHAR_T *end,
+                                  PREFIX(register_info_type) *reg_info)
{
  int mcnt;
  /* Point to after the args to the start_memory.  */
@@ -7808,9 +7719,8 @@
   byte past the last. The alternative can contain groups.  */

static boolean
-PREFIX(alt_match_null_string_p) (p, end, reg_info)
-    UCHAR_T *p, *end;
-    PREFIX(register_info_type) *reg_info;
+PREFIX(alt_match_null_string_p) (UCHAR_T *p, UCHAR_T *end,
+                                PREFIX(register_info_type) *reg_info)
{
  int mcnt;
  UCHAR_T *p1 = p;
@@ -7845,9 +7755,8 @@
   Sets P to one after the op and its arguments, if any.  */

static boolean
-PREFIX(common_op_match_null_string_p) (p, end, reg_info)
-    UCHAR_T **p, *end;
-    PREFIX(register_info_type) *reg_info;
+PREFIX(common_op_match_null_string_p) (UCHAR_T **p, UCHAR_T *end,
+                                      PREFIX(register_info_type) *reg_info)
{
  int mcnt;
  boolean ret;
@@ -7933,10 +7842,8 @@
   bytes; nonzero otherwise.  */

static int
-PREFIX(bcmp_translate) (s1, s2, len, translate)
-     const CHAR_T *s1, *s2;
-     register int len;
-     RE_TRANSLATE_TYPE translate;
+PREFIX(bcmp_translate) (const CHAR_T *s1, const CHAR_T *s2, register int len,
+                       RE_TRANSLATE_TYPE translate)
{
  register const UCHAR_T *p1 = (const UCHAR_T *) s1;
  register const UCHAR_T *p2 = (const UCHAR_T *) s2;
@@ -7969,10 +7876,8 @@
   We call regex_compile to do the actual compilation.  */

const char *
-re_compile_pattern (pattern, length, bufp)
-     const char *pattern;
-     size_t length;
-     struct re_pattern_buffer *bufp;
+re_compile_pattern (const char *pattern, size_t length,
+                   struct re_pattern_buffer *bufp)
{
  reg_errcode_t ret;

@@ -8018,8 +7923,7 @@
   regcomp/regexec below without link errors.  */
weak_function
#endif
-re_comp (s)
-    const char *s;
+re_comp (const char *s)
{
  reg_errcode_t ret;

@@ -8069,8 +7973,7 @@
#ifdef _LIBC
weak_function
#endif
-re_exec (s)
-    const char *s;
+re_exec (const char *s)
{
  const int len = strlen (s);
  return
@@ -8119,10 +8022,7 @@
   the return codes and their meanings.)  */

int
-regcomp (preg, pattern, cflags)
-    regex_t *preg;
-    const char *pattern;
-    int cflags;
+regcomp (regex_t *preg, const char *pattern, int cflags)
{
  reg_errcode_t ret;
  reg_syntax_t syntax
@@ -8215,12 +8115,8 @@
   We return 0 if we find a match and REG_NOMATCH if not.  */

int
-regexec (preg, string, nmatch, pmatch, eflags)
-    const regex_t *preg;
-    const char *string;
-    size_t nmatch;
-    regmatch_t pmatch[];
-    int eflags;
+regexec (const regex_t *preg, const char *string, size_t nmatch,
+        regmatch_t *pmatch, int eflags)
{
  int ret;
  struct re_registers regs;
@@ -8282,11 +8178,7 @@
   from either regcomp or regexec.   We don't use PREG here.  */

size_t
-regerror (errcode, preg, errbuf, errbuf_size)
-    int errcode;
-    const regex_t *preg;
-    char *errbuf;
-    size_t errbuf_size;
+regerror (int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size)
{
  const char *msg;
  size_t msg_size;
@@ -8329,8 +8221,7 @@
/* Free dynamically allocated space used by PREG.  */

void
-regfree (preg)
-    regex_t *preg;
+regfree (regex_t *preg)
{
  if (preg->buffer != NULL)
    free (preg->buffer);
Index: rmdir.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/rmdir.c,v
retrieving revision 1.10
diff -u -r1.10 rmdir.c
--- rmdir.c     7 Aug 2000 15:48:18 -0000       1.10
+++ rmdir.c     23 Jul 2003 18:32:49 -0000
@@ -41,8 +41,7 @@
   Return 0 if successful, -1 if not.  */

int
-rmdir (dpath)
-     char *dpath;
+rmdir (char *dpath)
{
  pid_t cpid;
  int status;
Index: strchrnul.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/strchrnul.c,v
retrieving revision 1.1
diff -u -r1.1 strchrnul.c
--- strchrnul.c 10 Jun 2003 12:13:32 -0000      1.1
+++ strchrnul.c 23 Jul 2003 18:32:49 -0000
@@ -20,9 +20,7 @@

/* Find the first occurrence of C in S or the final NUL byte.  */
char *
-strchrnul (s, c_in)
-     const char *s;
-     int c_in;
+strchrnul (const char *s, int c_in)
{
  while (*s && (*s != c_in))
    s++;
Index: strerror.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/strerror.c,v
retrieving revision 1.1
diff -u -r1.1 strerror.c
--- strerror.c  3 Sep 2002 15:36:39 -0000       1.1
+++ strerror.c  23 Jul 2003 18:32:49 -0000
@@ -24,8 +24,7 @@
extern char *sys_errlist[];

char *
-strerror(n)
-int n;
+strerror(int n)
{
        static char mesg[30];

Index: xgethostname.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/xgethostname.c,v
retrieving revision 1.13
diff -u -r1.13 xgethostname.c
--- xgethostname.c      22 Jul 2003 22:56:34 -0000      1.13
+++ xgethostname.c      23 Jul 2003 18:32:49 -0000
@@ -46,7 +46,7 @@
#endif

char *
-xgethostname ()
+xgethostname (void)
{
  char *hostname;
  size_t size;
Index: xstrtod.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/xstrtod.c,v
retrieving revision 1.7
diff -u -r1.7 xstrtod.c
--- xstrtod.c   6 Jan 2000 21:01:06 -0000       1.7
+++ xstrtod.c   23 Jul 2003 18:32:49 -0000
@@ -43,10 +43,7 @@
   non-zero and don't modify *RESULT upon any failure.  */

int
-xstrtod (str, ptr, result)
-     const char *str;
-     const char **ptr;
-     double *result;
+xstrtod (const char *str, const char **ptr, double *result)
{
  double val;
  char *terminator;
Index: yesno.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/yesno.c,v
retrieving revision 1.8
diff -u -r1.8 yesno.c
--- yesno.c     17 Nov 2001 13:29:42 -0000      1.8
+++ yesno.c     23 Jul 2003 18:32:49 -0000
@@ -33,7 +33,7 @@
int rpmatch ();

int
-yesno ()
+yesno (void)
{
  /* We make some assumptions here:
     a) leading white space in the response are not vital



Derek

--
               *8^)

Email: address@hidden

Get CVS support at <http://ximbiot.com>!
--
I don't know what's right any longer!  You have to think for both of us - for 
all of us!

                - Ingrid Bergman as Elsa, _Casablanca_






reply via email to

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