Commit 7469ef5d authored by Paul Eggert's avatar Paul Eggert

* doprnt.c, indent.c, character.c: conform to C89 pointer rules

parent 0ca76b1e
......@@ -24,6 +24,11 @@
* process.c (read_process_output, send_process, Fprocess_send_region):
Likewise.
* callproc.c (Fcall_process): Likewise.
* doprnt.c (doprnt): Likewise.
* indent.c (compute_motion): Likewise.
* character.c (strwidth): Make its argument const char *, not const
unsigned char *, since more callers prefer it that way. All callers
changed.
2011-02-06 Paul Eggert <eggert@cs.ucla.edu>
......@@ -395,9 +395,9 @@ c_string_width (const unsigned char *str, EMACS_INT len, int precision,
occupies on the screen. */
EMACS_INT
strwidth (const unsigned char *str, EMACS_INT len)
strwidth (const char *str, EMACS_INT len)
{
return c_string_width (str, len, -1, NULL, NULL);
return c_string_width ((const unsigned char *) str, len, -1, NULL, NULL);
}
/* Return width of Lisp string STRING when displayed in the current
......
......@@ -612,7 +612,7 @@ extern EMACS_INT str_to_multibyte (unsigned char *, EMACS_INT, EMACS_INT);
extern EMACS_INT str_as_unibyte (unsigned char *, EMACS_INT);
extern EMACS_INT str_to_unibyte (const unsigned char *, unsigned char *,
EMACS_INT, int);
extern EMACS_INT strwidth (const unsigned char *, EMACS_INT);
extern EMACS_INT strwidth (const char *, EMACS_INT);
extern EMACS_INT c_string_width (const unsigned char *, EMACS_INT, int,
EMACS_INT *, EMACS_INT *);
extern EMACS_INT lisp_string_width (Lisp_Object, int,
......@@ -630,4 +630,3 @@ extern Lisp_Object string_escape_byte8 (Lisp_Object);
do { (sym) = intern_c_string ((name)); staticpro (&(sym)); } while (0)
#endif /* EMACS_CHARACTER_H */
......@@ -71,11 +71,11 @@ doprnt (char *buffer, register int bufsize, const char *format,
char *big_buffer = 0;
register int tem;
unsigned char *string;
char *string;
char fixed_buffer[20]; /* Default buffer for small formatting. */
char *fmtcpy;
int minlen;
unsigned char charbuf[MAX_MULTIBYTE_LENGTH + 1]; /* Used for %c. */
char charbuf[MAX_MULTIBYTE_LENGTH + 1]; /* Used for %c. */
if (format_end == 0)
format_end = format + strlen (format);
......@@ -97,7 +97,7 @@ doprnt (char *buffer, register int bufsize, const char *format,
fmt++;
/* Copy this one %-spec into fmtcpy. */
string = (unsigned char *) fmtcpy;
string = fmtcpy;
*string++ = '%';
while (1)
{
......@@ -166,7 +166,7 @@ doprnt (char *buffer, register int bufsize, const char *format,
abort ();
sprintf (sprintf_buffer, fmtcpy, va_arg(ap, char *));
/* Now copy into final output, truncating as nec. */
string = (unsigned char *) sprintf_buffer;
string = sprintf_buffer;
goto doit;
case 'f':
......@@ -176,7 +176,7 @@ doprnt (char *buffer, register int bufsize, const char *format,
double d = va_arg(ap, double);
sprintf (sprintf_buffer, fmtcpy, d);
/* Now copy into final output, truncating as nec. */
string = (unsigned char *) sprintf_buffer;
string = sprintf_buffer;
goto doit;
}
......@@ -185,7 +185,7 @@ doprnt (char *buffer, register int bufsize, const char *format,
case 's':
if (fmtcpy[1] != 's')
minlen = atoi (&fmtcpy[1]);
string = va_arg(ap, unsigned char *);
string = va_arg (ap, char *);
tem = strlen (string);
width = strwidth (string, tem);
goto doit1;
......@@ -242,7 +242,7 @@ doprnt (char *buffer, register int bufsize, const char *format,
both are passed the same way, otherwise we'll need
to rewrite callers. */
EMACS_INT chr = va_arg(ap, EMACS_INT);
tem = CHAR_STRING ((int) chr, charbuf);
tem = CHAR_STRING ((int) chr, (unsigned char *) charbuf);
string = charbuf;
string[tem] = 0;
width = strwidth (string, tem);
......@@ -277,4 +277,3 @@ doprnt (char *buffer, register int bufsize, const char *format,
*bufptr = 0; /* Make sure our string end with a '\0' */
return bufptr - buffer;
}
......@@ -1250,7 +1250,7 @@ compute_motion (EMACS_INT from, EMACS_INT fromvpos, EMACS_INT fromhpos, int did_
unsigned char *ovstr;
EMACS_INT ovlen = overlay_strings (pos, win, &ovstr);
hpos += ((multibyte && ovlen > 0)
? strwidth (ovstr, ovlen) : ovlen);
? strwidth ((char *) ovstr, ovlen) : ovlen);
}
did_motion = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment