Fix typos.
[bpt/emacs.git] / src / regex.c
index 862f848..b769937 100644 (file)
@@ -67,7 +67,7 @@
 # define regexec(pr, st, nm, pm, ef) __regexec (pr, st, nm, pm, ef)
 # define regcomp(preg, pattern, cflags) __regcomp (preg, pattern, cflags)
 # define regerror(err_code, preg, errbuf, errbuf_size) \
-       __regerror(err_code, preg, errbuf, errbuf_size)
+       __regerror (err_code, preg, errbuf, errbuf_size)
 # define re_set_registers(bu, re, nu, st, en) \
        __re_set_registers (bu, re, nu, st, en)
 # define re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop) \
@@ -376,12 +376,12 @@ enum syntaxcode { Swhitespace = 0, Sword = 1, Ssymbol = 2 };
 # define ISUPPER(c) isupper (c)
 # define ISXDIGIT(c) isxdigit (c)
 
-# define ISWORD(c) ISALPHA(c)
+# define ISWORD(c) ISALPHA (c)
 
 # ifdef _tolower
-#  define TOLOWER(c) _tolower(c)
+#  define TOLOWER(c) _tolower (c)
 # else
-#  define TOLOWER(c) tolower(c)
+#  define TOLOWER(c) tolower (c)
 # endif
 
 /* How many characters in the character set.  */
@@ -530,7 +530,11 @@ init_syntax_once (void)
 #define MIN(a, b) ((a) < (b) ? (a) : (b))
 
 /* Type of source-pattern and string chars.  */
+#ifdef _MSC_VER
+typedef unsigned char re_char;
+#else
 typedef const unsigned char re_char;
+#endif
 
 typedef char boolean;
 #define false 0
@@ -633,7 +637,7 @@ typedef enum
   on_failure_jump_nastyloop,
 
        /* A smart `on_failure_jump' used for greedy * and + operators.
-          It analyses the loop before which it is put and if the
+          It analyzes the loop before which it is put and if the
           loop does not require backtracking, it changes itself to
           `on_failure_keep_string_jump' and short-circuits the loop,
           else it just defaults to changing itself into `on_failure_jump'.
@@ -2106,13 +2110,13 @@ re_iswctype (int ch, re_wctype_t cc)
     case RECC_UPPER: return ISUPPER (ch) != 0;
     case RECC_XDIGIT: return ISXDIGIT (ch) != 0;
     case RECC_ASCII: return IS_REAL_ASCII (ch) != 0;
-    case RECC_NONASCII: return !IS_REAL_ASCII (ch) != 0;
+    case RECC_NONASCII: return !IS_REAL_ASCII (ch);
     case RECC_UNIBYTE: return ISUNIBYTE (ch) != 0;
-    case RECC_MULTIBYTE: return !ISUNIBYTE (ch) != 0;
+    case RECC_MULTIBYTE: return !ISUNIBYTE (ch);
     case RECC_WORD: return ISWORD (ch) != 0;
     case RECC_ERROR: return false;
     default:
-      abort();
+      abort ();
     }
 }
 
@@ -2133,7 +2137,7 @@ re_wctype_to_bit (re_wctype_t cc)
     case RECC_ASCII: case RECC_DIGIT: case RECC_XDIGIT: case RECC_CNTRL:
     case RECC_BLANK: case RECC_UNIBYTE: case RECC_ERROR: return 0;
     default:
-      abort();
+      abort ();
     }
 }
 #endif
@@ -4537,10 +4541,10 @@ WEAK_ALIAS (__re_search_2, re_search_2)
 \f
 /* Declarations and macros for re_match_2.  */
 
-static int bcmp_translate _RE_ARGS((re_char *s1, re_char *s2,
-                                   register ssize_t len,
-                                   RE_TRANSLATE_TYPE translate,
-                                   const int multibyte));
+static int bcmp_translate _RE_ARGS ((re_char *s1, re_char *s2,
+                                     register ssize_t len,
+                                     RE_TRANSLATE_TYPE translate,
+                                     const int multibyte));
 
 /* This converts PTR, a pointer into one of the search strings `string1'
    and `string2' into an offset from the beginning of that string.  */
@@ -6276,7 +6280,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const re_char *string1,
              goto fail;
 
            default:
-             abort();
+             abort ();
            }
 
          assert (p >= bufp->buffer && p <= pend);
@@ -6381,8 +6385,7 @@ char *
    regcomp/regexec below without link errors.  */
 weak_function
 # endif
-re_comp (s)
-    const char *s;
+re_comp (const char *s)
 {
   reg_errcode_t ret;
 
@@ -6421,7 +6424,7 @@ re_comp (s)
 }
 
 
-regoff_t
+int
 # ifdef _LIBC
 weak_function
 # endif
@@ -6558,7 +6561,7 @@ reg_errcode_t
 regexec (const regex_t *__restrict preg, const char *__restrict string,
         size_t nmatch, regmatch_t pmatch[__restrict_arr], int eflags)
 {
-  reg_errcode_t ret;
+  regoff_t ret;
   struct re_registers regs;
   regex_t private_preg;
   size_t len = strlen (string);