From a7e979a44ee01dcca3e5081fe672427395494aa0 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 6 Feb 2011 17:31:29 -0800 Subject: [PATCH] * search.c: conform to C89 pointer rules --- src/ChangeLog | 1 + src/search.c | 15 ++++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index b8972ed72e3..d56402241f3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -6,6 +6,7 @@ Change types between char * and unsigned char *, to satisfy C89 rules about pointer type compatibility. * casefiddle.c (casify_object, casify_region): Likewise. + * search.c (Freplace_match, Fregexp_quote): Likewise. 2011-02-06 Paul Eggert diff --git a/src/search.c b/src/search.c index c0f8d8067e6..09dae0ed0f5 100644 --- a/src/search.c +++ b/src/search.c @@ -2705,7 +2705,7 @@ since only regular expressions have distinguished subexpressions. */) idx = c - '0'; } else if (c == '\\') - add_len = 1, add_stuff = "\\"; + add_len = 1, add_stuff = (unsigned char *) "\\"; else { xfree (substed); @@ -2755,10 +2755,11 @@ since only regular expressions have distinguished subexpressions. */) EMACS_INT nchars = multibyte_chars_in_text (substed, substed_len); - newtext = make_multibyte_string (substed, nchars, substed_len); + newtext = make_multibyte_string ((char *) substed, nchars, + substed_len); } else - newtext = make_unibyte_string (substed, substed_len); + newtext = make_unibyte_string ((char *) substed, substed_len); } xfree (substed); } @@ -3145,17 +3146,17 @@ DEFUN ("regexp-quote", Fregexp_quote, Sregexp_quote, 1, 1, 0, doc: /* Return a regexp string which matches exactly STRING and nothing else. */) (Lisp_Object string) { - register unsigned char *in, *out, *end; - register unsigned char *temp; + register char *in, *out, *end; + register char *temp; int backslashes_added = 0; CHECK_STRING (string); - temp = (unsigned char *) alloca (SBYTES (string) * 2); + temp = (char *) alloca (SBYTES (string) * 2); /* Now copy the data into the new string, inserting escapes. */ - in = SDATA (string); + in = SSDATA (string); end = in + SBYTES (string); out = temp; -- 2.39.5