bug-gnulib
[Top][All Lists]
Advanced

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

Re: regex cannot be compiled with g++


From: Sam Steingold
Subject: Re: regex cannot be compiled with g++
Date: Thu, 18 Oct 2007 17:38:47 -0400
User-agent: Thunderbird 2.0.0.0 (X11/20070326)

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

patches attached
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHF9JnPp1Qsf2qnMcRAsTDAKCq8T4zZjQa4GK1ryygPrq3BLm1QACcCh8q
3amH5P4qSQ9+fMW/aL4BsN8=
=JO3v
-----END PGP SIGNATURE-----
Index: regcomp.c
===================================================================
RCS file: /cvsroot/clisp/clisp/src/gllib/regcomp.c,v
retrieving revision 1.1
diff -u -w -r1.1 regcomp.c
--- regcomp.c   16 Oct 2007 20:58:32 -0000      1.1
+++ regcomp.c   18 Oct 2007 21:37:25 -0000
@@ -256,9 +256,7 @@
    The argument SYNTAX is a bit mask comprised of the various bits
    defined in regex.h.  We return the old syntax.  */
 
-reg_syntax_t
-re_set_syntax (syntax)
-    reg_syntax_t syntax;
+reg_syntax_t re_set_syntax (reg_syntax_t syntax)
 {
   reg_syntax_t ret = re_syntax_options;
 
@@ -269,9 +267,7 @@
 weak_alias (__re_set_syntax, re_set_syntax)
 #endif
 
-int
-re_compile_fastmap (bufp)
-    struct re_pattern_buffer *bufp;
+int re_compile_fastmap (struct re_pattern_buffer *bufp)
 {
   re_dfa_t *dfa = (re_dfa_t *) bufp->buffer;
   char *fastmap = bufp->fastmap;
@@ -450,10 +446,7 @@
    the return codes and their meanings.)  */
 
 int
-regcomp (preg, pattern, cflags)
-    regex_t *_Restrict_ preg;
-    const char *_Restrict_ pattern;
-    int cflags;
+regcomp (regex_t *_Restrict_ preg, const char *_Restrict_ pattern, int cflags)
 {
   reg_errcode_t ret;
   reg_syntax_t syntax = ((cflags & REG_EXTENDED) ? RE_SYNTAX_POSIX_EXTENDED
@@ -634,8 +627,7 @@
 /* Free dynamically allocated space used by PREG.  */
 
 void
-regfree (preg)
-    regex_t *preg;
+regfree (regex_t *preg)
 {
   re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
   if (BE (dfa != NULL, 1))
@@ -668,8 +660,7 @@
    regcomp/regexec above without link errors.  */
 weak_function
 # endif
-re_comp (s)
-     const char *s;
+re_comp (const char *s)
 {
   reg_errcode_t ret;
   char *fastmap;
@@ -861,7 +852,8 @@
     if (table_size > pat_len)
       break;
 
-  dfa->state_table = calloc (sizeof (struct re_state_table_entry), table_size);
+  dfa->state_table = (re_state_table_entry*)
+    calloc (sizeof (struct re_state_table_entry), table_size);
   dfa->state_hash_mask = table_size - 1;
 
   dfa->mb_cur_max = MB_CUR_MAX;
Index: regexec.c
===================================================================
RCS file: /cvsroot/clisp/clisp/src/gllib/regexec.c,v
retrieving revision 1.1
diff -u -w -r1.1 regexec.c
--- regexec.c   16 Oct 2007 20:58:32 -0000      1.1
+++ regexec.c   18 Oct 2007 21:37:09 -0000
@@ -220,13 +220,8 @@
 
    We return 0 if we find a match and REG_NOMATCH if not.  */
 
-int
-regexec (preg, string, nmatch, pmatch, eflags)
-    const regex_t *_Restrict_ preg;
-    const char *_Restrict_ string;
-    size_t nmatch;
-    regmatch_t pmatch[_Restrict_arr_];
-    int eflags;
+int regexec (const regex_t *_Restrict_ preg, const char *_Restrict_ string,
+             size_t nmatch, regmatch_t pmatch[_Restrict_arr_], int eflags)
 {
   reg_errcode_t err;
   Idx start, length;
@@ -308,12 +303,8 @@
    return the position of the start of the match.  Return value -1 means no
    match was found and -2 indicates an internal error.  */
 
-regoff_t
-re_match (bufp, string, length, start, regs)
-    struct re_pattern_buffer *bufp;
-    const char *string;
-    Idx length, start;
-    struct re_registers *regs;
+regoff_t re_match (struct re_pattern_buffer *bufp, const char *string,
+                   Idx length, Idx start, struct re_registers *regs)
 {
   return re_search_stub (bufp, string, length, start, 0, length, regs, true);
 }
@@ -321,13 +312,9 @@
 weak_alias (__re_match, re_match)
 #endif
 
-regoff_t
-re_search (bufp, string, length, start, range, regs)
-    struct re_pattern_buffer *bufp;
-    const char *string;
-    Idx length, start;
-    regoff_t range;
-    struct re_registers *regs;
+regoff_t re_search (struct re_pattern_buffer *bufp, const char *string,
+                    Idx length, Idx start, regoff_t range,
+                    struct re_registers *regs)
 {
   return re_search_stub (bufp, string, length, start, range, length, regs,
                         false);
@@ -336,12 +323,9 @@
 weak_alias (__re_search, re_search)
 #endif
 
-regoff_t
-re_match_2 (bufp, string1, length1, string2, length2, start, regs, stop)
-    struct re_pattern_buffer *bufp;
-    const char *string1, *string2;
-    Idx length1, length2, start, stop;
-    struct re_registers *regs;
+regoff_t re_match_2 (struct re_pattern_buffer *bufp, const char *string1,
+                     Idx length1, const char *string2, Idx length2,
+                     Idx start, struct re_registers *regs, Idx stop)
 {
   return re_search_2_stub (bufp, string1, length1, string2, length2,
                           start, 0, regs, stop, true);
@@ -350,13 +334,9 @@
 weak_alias (__re_match_2, re_match_2)
 #endif
 
-regoff_t
-re_search_2 (bufp, string1, length1, string2, length2, start, range, regs, 
stop)
-    struct re_pattern_buffer *bufp;
-    const char *string1, *string2;
-    Idx length1, length2, start, stop;
-    regoff_t range;
-    struct re_registers *regs;
+regoff_t re_search_2 (struct re_pattern_buffer *bufp, const char *string1,
+                      Idx length1, const char *string2, Idx length2, Idx start,
+                      regoff_t range, struct re_registers *regs, Idx stop)
 {
   return re_search_2_stub (bufp, string1, length1, string2, length2,
                           start, range, regs, stop, false);
@@ -585,12 +565,9 @@
    PATTERN_BUFFER will allocate its own register data, without
    freeing the old data.  */
 
-void
-re_set_registers (bufp, regs, num_regs, starts, ends)
-    struct re_pattern_buffer *bufp;
-    struct re_registers *regs;
-    __re_size_t num_regs;
-    regoff_t *starts, *ends;
+void re_set_registers (struct re_pattern_buffer *bufp,
+                       struct re_registers *regs, __re_size_t num_regs,
+                       regoff_t *starts, regoff_t *ends)
 {
   if (num_regs)
     {
@@ -1388,7 +1365,8 @@
   if (fs->num == fs->alloc)
     {
       struct re_fail_stack_ent_t *new_array;
-      new_array = realloc (fs->stack, (sizeof (struct re_fail_stack_ent_t)
+      new_array = (re_fail_stack_ent_t*)
+        realloc (fs->stack, (sizeof (struct re_fail_stack_ent_t)
                                       * fs->alloc * 2));
       if (new_array == NULL)
        return REG_ESPACE;
@@ -2825,8 +2803,8 @@
            continue; /* No.  */
          if (sub_top->path == NULL)
            {
-             sub_top->path = calloc (sizeof (state_array_t),
-                                     sl_str - sub_top->str_idx + 1);
+             sub_top->path = (state_array_t*)
+                calloc (sizeof (state_array_t), sl_str - sub_top->str_idx + 1);
              if (sub_top->path == NULL)
                return REG_ESPACE;
            }
@@ -4348,7 +4326,8 @@
       mctx->sub_tops = new_array;
       mctx->asub_tops = new_asub_tops;
     }
-  mctx->sub_tops[mctx->nsub_tops] = calloc (1, sizeof (re_sub_match_top_t));
+  mctx->sub_tops[mctx->nsub_tops] = (re_sub_match_top_t*)
+    calloc (1, sizeof (re_sub_match_top_t));
   if (BE (mctx->sub_tops[mctx->nsub_tops] == NULL, 0))
     return REG_ESPACE;
   mctx->sub_tops[mctx->nsub_tops]->node = node;
@@ -4375,7 +4354,7 @@
       subtop->lasts = new_array;
       subtop->alasts = new_alasts;
     }
-  new_entry = calloc (1, sizeof (re_sub_match_last_t));
+  new_entry = (re_sub_match_last_t*) calloc (1, sizeof (re_sub_match_last_t));
   if (BE (new_entry != NULL, 1))
     {
       subtop->lasts[subtop->nlasts] = new_entry;

reply via email to

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