diff src/search.c @ 21915:8f1159b417c2

(search_buffer): Fix casts when assigning raw_pattern. (compile_pattern_1): Declare raw_pattern as unsigned char *. Fix casts when assigning raw_pattern. Cast raw_pattern when calling re_compile_pattern.
author Richard M. Stallman <rms@gnu.org>
date Sun, 03 May 1998 02:32:58 +0000
parents 1c9f20274f76
children bda081af77e7
line wrap: on
line diff
--- a/src/search.c	Sun May 03 02:24:36 1998 +0000
+++ b/src/search.c	Sun May 03 02:32:58 1998 +0000
@@ -129,7 +129,7 @@
      int posix;
      int multibyte;
 {
-  char *raw_pattern;
+  unsigned char *raw_pattern;
   int raw_pattern_size;
   char *val;
   reg_syntax_t old;
@@ -140,14 +140,14 @@
 
   if (multibyte == STRING_MULTIBYTE (pattern))
     {
-      raw_pattern = (char *) XSTRING (pattern)->data;
+      raw_pattern = (unsigned char *) XSTRING (pattern)->data;
       raw_pattern_size = STRING_BYTES (XSTRING (pattern));
     }
   else if (multibyte)
     {
       raw_pattern_size = count_size_as_multibyte (XSTRING (pattern)->data,
 						  XSTRING (pattern)->size);
-      raw_pattern = (char *) alloca (raw_pattern_size + 1);
+      raw_pattern = (unsigned char *) alloca (raw_pattern_size + 1);
       copy_text (XSTRING (pattern)->data, raw_pattern,
 		 XSTRING (pattern)->size, 0, 1);
     }
@@ -160,7 +160,7 @@
 	 so that only the multibyte chars which really correspond to
 	 the chosen single-byte character set can possibly match.  */
       raw_pattern_size = XSTRING (pattern)->size;
-      raw_pattern = (char *) alloca (raw_pattern_size + 1);
+      raw_pattern = (unsigned char *) alloca (raw_pattern_size + 1);
       copy_text (XSTRING (pattern)->data, raw_pattern,
 		 STRING_BYTES (XSTRING (pattern)), 1, 0);
     }
@@ -172,7 +172,8 @@
   BLOCK_INPUT;
   old = re_set_syntax (RE_SYNTAX_EMACS
 		       | (posix ? 0 : RE_NO_POSIX_BACKTRACKING));
-  val = (char *) re_compile_pattern (raw_pattern, raw_pattern_size, &cp->buf);
+  val = (char *) re_compile_pattern ((char *)raw_pattern,
+				     raw_pattern_size, &cp->buf);
   re_set_syntax (old);
   UNBLOCK_INPUT;
   if (val)
@@ -1135,7 +1136,7 @@
 
       if (multibyte == STRING_MULTIBYTE (string))
 	{
-	  raw_pattern = (char *) XSTRING (string)->data;
+	  raw_pattern = (unsigned char *) XSTRING (string)->data;
 	  raw_pattern_size = XSTRING (string)->size;
 	  raw_pattern_size_byte = STRING_BYTES (XSTRING (string));
 	}
@@ -1145,7 +1146,7 @@
 	  raw_pattern_size_byte
 	    = count_size_as_multibyte (XSTRING (string)->data,
 				       raw_pattern_size);
-	  raw_pattern = (char *) alloca (raw_pattern_size_byte + 1);
+	  raw_pattern = (unsigned char *) alloca (raw_pattern_size_byte + 1);
 	  copy_text (XSTRING (string)->data, raw_pattern,
 		     XSTRING (string)->size, 0, 1);
 	}
@@ -1159,7 +1160,7 @@
 	     the chosen single-byte character set can possibly match.  */
 	  raw_pattern_size = XSTRING (string)->size;
 	  raw_pattern_size_byte = XSTRING (string)->size;
-	  raw_pattern = (char *) alloca (raw_pattern_size + 1);
+	  raw_pattern = (unsigned char *) alloca (raw_pattern_size + 1);
 	  copy_text (XSTRING (string)->data, raw_pattern,
 		     STRING_BYTES (XSTRING (string)), 1, 0);
 	}