diff options
| author | Paul Eggert | 2011-02-06 21:42:15 -0800 |
|---|---|---|
| committer | Paul Eggert | 2011-02-06 21:42:15 -0800 |
| commit | 7469ef5d1bf4a7d2297fce554dc0980d4787ffb4 (patch) | |
| tree | 179dafe5e7dda10542f948c83f55b578621232ca | |
| parent | 0ca76b1eacbc5df387325d8711d3add68486909a (diff) | |
| download | emacs-7469ef5d1bf4a7d2297fce554dc0980d4787ffb4.tar.gz emacs-7469ef5d1bf4a7d2297fce554dc0980d4787ffb4.zip | |
* doprnt.c, indent.c, character.c: conform to C89 pointer rules
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/character.c | 4 | ||||
| -rw-r--r-- | src/character.h | 3 | ||||
| -rw-r--r-- | src/doprnt.c | 15 | ||||
| -rw-r--r-- | src/indent.c | 2 |
5 files changed, 16 insertions, 13 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index eeaa5a24ae6..f646bd66981 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -24,6 +24,11 @@ | |||
| 24 | * process.c (read_process_output, send_process, Fprocess_send_region): | 24 | * process.c (read_process_output, send_process, Fprocess_send_region): |
| 25 | Likewise. | 25 | Likewise. |
| 26 | * callproc.c (Fcall_process): Likewise. | 26 | * callproc.c (Fcall_process): Likewise. |
| 27 | * doprnt.c (doprnt): Likewise. | ||
| 28 | * indent.c (compute_motion): Likewise. | ||
| 29 | * character.c (strwidth): Make its argument const char *, not const | ||
| 30 | unsigned char *, since more callers prefer it that way. All callers | ||
| 31 | changed. | ||
| 27 | 32 | ||
| 28 | 2011-02-06 Paul Eggert <eggert@cs.ucla.edu> | 33 | 2011-02-06 Paul Eggert <eggert@cs.ucla.edu> |
| 29 | 34 | ||
diff --git a/src/character.c b/src/character.c index 9936ac281cf..397481e5b39 100644 --- a/src/character.c +++ b/src/character.c | |||
| @@ -395,9 +395,9 @@ c_string_width (const unsigned char *str, EMACS_INT len, int precision, | |||
| 395 | occupies on the screen. */ | 395 | occupies on the screen. */ |
| 396 | 396 | ||
| 397 | EMACS_INT | 397 | EMACS_INT |
| 398 | strwidth (const unsigned char *str, EMACS_INT len) | 398 | strwidth (const char *str, EMACS_INT len) |
| 399 | { | 399 | { |
| 400 | return c_string_width (str, len, -1, NULL, NULL); | 400 | return c_string_width ((const unsigned char *) str, len, -1, NULL, NULL); |
| 401 | } | 401 | } |
| 402 | 402 | ||
| 403 | /* Return width of Lisp string STRING when displayed in the current | 403 | /* Return width of Lisp string STRING when displayed in the current |
diff --git a/src/character.h b/src/character.h index 259aebbb8a8..f2ccb28bb37 100644 --- a/src/character.h +++ b/src/character.h | |||
| @@ -612,7 +612,7 @@ extern EMACS_INT str_to_multibyte (unsigned char *, EMACS_INT, EMACS_INT); | |||
| 612 | extern EMACS_INT str_as_unibyte (unsigned char *, EMACS_INT); | 612 | extern EMACS_INT str_as_unibyte (unsigned char *, EMACS_INT); |
| 613 | extern EMACS_INT str_to_unibyte (const unsigned char *, unsigned char *, | 613 | extern EMACS_INT str_to_unibyte (const unsigned char *, unsigned char *, |
| 614 | EMACS_INT, int); | 614 | EMACS_INT, int); |
| 615 | extern EMACS_INT strwidth (const unsigned char *, EMACS_INT); | 615 | extern EMACS_INT strwidth (const char *, EMACS_INT); |
| 616 | extern EMACS_INT c_string_width (const unsigned char *, EMACS_INT, int, | 616 | extern EMACS_INT c_string_width (const unsigned char *, EMACS_INT, int, |
| 617 | EMACS_INT *, EMACS_INT *); | 617 | EMACS_INT *, EMACS_INT *); |
| 618 | extern EMACS_INT lisp_string_width (Lisp_Object, int, | 618 | extern EMACS_INT lisp_string_width (Lisp_Object, int, |
| @@ -630,4 +630,3 @@ extern Lisp_Object string_escape_byte8 (Lisp_Object); | |||
| 630 | do { (sym) = intern_c_string ((name)); staticpro (&(sym)); } while (0) | 630 | do { (sym) = intern_c_string ((name)); staticpro (&(sym)); } while (0) |
| 631 | 631 | ||
| 632 | #endif /* EMACS_CHARACTER_H */ | 632 | #endif /* EMACS_CHARACTER_H */ |
| 633 | |||
diff --git a/src/doprnt.c b/src/doprnt.c index 979cce3c402..36eb272caae 100644 --- a/src/doprnt.c +++ b/src/doprnt.c | |||
| @@ -71,11 +71,11 @@ doprnt (char *buffer, register int bufsize, const char *format, | |||
| 71 | char *big_buffer = 0; | 71 | char *big_buffer = 0; |
| 72 | 72 | ||
| 73 | register int tem; | 73 | register int tem; |
| 74 | unsigned char *string; | 74 | char *string; |
| 75 | char fixed_buffer[20]; /* Default buffer for small formatting. */ | 75 | char fixed_buffer[20]; /* Default buffer for small formatting. */ |
| 76 | char *fmtcpy; | 76 | char *fmtcpy; |
| 77 | int minlen; | 77 | int minlen; |
| 78 | unsigned char charbuf[MAX_MULTIBYTE_LENGTH + 1]; /* Used for %c. */ | 78 | char charbuf[MAX_MULTIBYTE_LENGTH + 1]; /* Used for %c. */ |
| 79 | 79 | ||
| 80 | if (format_end == 0) | 80 | if (format_end == 0) |
| 81 | format_end = format + strlen (format); | 81 | format_end = format + strlen (format); |
| @@ -97,7 +97,7 @@ doprnt (char *buffer, register int bufsize, const char *format, | |||
| 97 | 97 | ||
| 98 | fmt++; | 98 | fmt++; |
| 99 | /* Copy this one %-spec into fmtcpy. */ | 99 | /* Copy this one %-spec into fmtcpy. */ |
| 100 | string = (unsigned char *) fmtcpy; | 100 | string = fmtcpy; |
| 101 | *string++ = '%'; | 101 | *string++ = '%'; |
| 102 | while (1) | 102 | while (1) |
| 103 | { | 103 | { |
| @@ -166,7 +166,7 @@ doprnt (char *buffer, register int bufsize, const char *format, | |||
| 166 | abort (); | 166 | abort (); |
| 167 | sprintf (sprintf_buffer, fmtcpy, va_arg(ap, char *)); | 167 | sprintf (sprintf_buffer, fmtcpy, va_arg(ap, char *)); |
| 168 | /* Now copy into final output, truncating as nec. */ | 168 | /* Now copy into final output, truncating as nec. */ |
| 169 | string = (unsigned char *) sprintf_buffer; | 169 | string = sprintf_buffer; |
| 170 | goto doit; | 170 | goto doit; |
| 171 | 171 | ||
| 172 | case 'f': | 172 | case 'f': |
| @@ -176,7 +176,7 @@ doprnt (char *buffer, register int bufsize, const char *format, | |||
| 176 | double d = va_arg(ap, double); | 176 | double d = va_arg(ap, double); |
| 177 | sprintf (sprintf_buffer, fmtcpy, d); | 177 | sprintf (sprintf_buffer, fmtcpy, d); |
| 178 | /* Now copy into final output, truncating as nec. */ | 178 | /* Now copy into final output, truncating as nec. */ |
| 179 | string = (unsigned char *) sprintf_buffer; | 179 | string = sprintf_buffer; |
| 180 | goto doit; | 180 | goto doit; |
| 181 | } | 181 | } |
| 182 | 182 | ||
| @@ -185,7 +185,7 @@ doprnt (char *buffer, register int bufsize, const char *format, | |||
| 185 | case 's': | 185 | case 's': |
| 186 | if (fmtcpy[1] != 's') | 186 | if (fmtcpy[1] != 's') |
| 187 | minlen = atoi (&fmtcpy[1]); | 187 | minlen = atoi (&fmtcpy[1]); |
| 188 | string = va_arg(ap, unsigned char *); | 188 | string = va_arg (ap, char *); |
| 189 | tem = strlen (string); | 189 | tem = strlen (string); |
| 190 | width = strwidth (string, tem); | 190 | width = strwidth (string, tem); |
| 191 | goto doit1; | 191 | goto doit1; |
| @@ -242,7 +242,7 @@ doprnt (char *buffer, register int bufsize, const char *format, | |||
| 242 | both are passed the same way, otherwise we'll need | 242 | both are passed the same way, otherwise we'll need |
| 243 | to rewrite callers. */ | 243 | to rewrite callers. */ |
| 244 | EMACS_INT chr = va_arg(ap, EMACS_INT); | 244 | EMACS_INT chr = va_arg(ap, EMACS_INT); |
| 245 | tem = CHAR_STRING ((int) chr, charbuf); | 245 | tem = CHAR_STRING ((int) chr, (unsigned char *) charbuf); |
| 246 | string = charbuf; | 246 | string = charbuf; |
| 247 | string[tem] = 0; | 247 | string[tem] = 0; |
| 248 | width = strwidth (string, tem); | 248 | width = strwidth (string, tem); |
| @@ -277,4 +277,3 @@ doprnt (char *buffer, register int bufsize, const char *format, | |||
| 277 | *bufptr = 0; /* Make sure our string end with a '\0' */ | 277 | *bufptr = 0; /* Make sure our string end with a '\0' */ |
| 278 | return bufptr - buffer; | 278 | return bufptr - buffer; |
| 279 | } | 279 | } |
| 280 | |||
diff --git a/src/indent.c b/src/indent.c index b40cb9f50b6..84ce140c5ba 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -1250,7 +1250,7 @@ compute_motion (EMACS_INT from, EMACS_INT fromvpos, EMACS_INT fromhpos, int did_ | |||
| 1250 | unsigned char *ovstr; | 1250 | unsigned char *ovstr; |
| 1251 | EMACS_INT ovlen = overlay_strings (pos, win, &ovstr); | 1251 | EMACS_INT ovlen = overlay_strings (pos, win, &ovstr); |
| 1252 | hpos += ((multibyte && ovlen > 0) | 1252 | hpos += ((multibyte && ovlen > 0) |
| 1253 | ? strwidth (ovstr, ovlen) : ovlen); | 1253 | ? strwidth ((char *) ovstr, ovlen) : ovlen); |
| 1254 | } | 1254 | } |
| 1255 | did_motion = 0; | 1255 | did_motion = 0; |
| 1256 | 1256 | ||