diff options
| author | Paul Eggert | 2011-04-18 17:34:42 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-04-18 17:34:42 -0700 |
| commit | c2982e87d382f0b5c00a65e63716c2b43d342881 (patch) | |
| tree | b8f155c52150e3cc85a26299812d139efd86231e /src/coding.c | |
| parent | 5e073ec7384c432e42a8affeeb6d6906588f2af9 (diff) | |
| download | emacs-c2982e87d382f0b5c00a65e63716c2b43d342881.tar.gz emacs-c2982e87d382f0b5c00a65e63716c2b43d342881.zip | |
Replace pEd with more-general pI, and fix some printf arg casts.
* lisp.h (pI): New macro, generalizing old pEd macro to other
conversion specifiers. For example, use "...%"pI"d..." rather
than "...%"pEd"...".
(pEd): Remove. All uses replaced with similar uses of pI.
* src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h: Likewise.
* alloc.c (check_pure_size): Don't overflow by converting size to int.
* bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
* data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
* dbusbind.c (xd_append_arg): Use pI to avoid cast.
(Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
* font.c (font_unparse_xlfd): Avoid potential buffer overrun on
64-bit hosts.
(font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
* keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
* print.c (safe_debug_print, print_object): Likewise.
(print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
to int.
Use pI instead of if-then-else-abort. Use %p to avoid casts.
* process.c (Fmake_network_process): Use pI to avoid cast.
* region-cache.c (pp_cache): Likewise.
* xdisp.c (decode_mode_spec): Likewise.
* xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
behavior on 64-bit hosts with printf arg.
* xselect.c (x_queue_event): Use %p to avoid casts.
(x_stop_queuing_selection_requests): Likewise.
(x_get_window_property): Don't truncate byte count to an 'int'
when tracing.
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/coding.c b/src/coding.c index b49070e5e16..38e41e7a99e 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -9037,14 +9037,14 @@ Return the corresponding character. */) | |||
| 9037 | 9037 | ||
| 9038 | if (c1 < 0x81 || (c1 > 0x9F && c1 < 0xE0) || c1 > 0xEF | 9038 | if (c1 < 0x81 || (c1 > 0x9F && c1 < 0xE0) || c1 > 0xEF |
| 9039 | || c2 < 0x40 || c2 == 0x7F || c2 > 0xFC) | 9039 | || c2 < 0x40 || c2 == 0x7F || c2 > 0xFC) |
| 9040 | error ("Invalid code: %"pEd, ch); | 9040 | error ("Invalid code: %"pI"d", ch); |
| 9041 | c = ch; | 9041 | c = ch; |
| 9042 | SJIS_TO_JIS (c); | 9042 | SJIS_TO_JIS (c); |
| 9043 | charset = charset_kanji; | 9043 | charset = charset_kanji; |
| 9044 | } | 9044 | } |
| 9045 | c = DECODE_CHAR (charset, c); | 9045 | c = DECODE_CHAR (charset, c); |
| 9046 | if (c < 0) | 9046 | if (c < 0) |
| 9047 | error ("Invalid code: %"pEd, ch); | 9047 | error ("Invalid code: %"pI"d", ch); |
| 9048 | return make_number (c); | 9048 | return make_number (c); |
| 9049 | } | 9049 | } |
| 9050 | 9050 | ||
| @@ -9111,13 +9111,13 @@ Return the corresponding character. */) | |||
| 9111 | int b2 = ch & 0x7F; | 9111 | int b2 = ch & 0x7F; |
| 9112 | if (b1 < 0xA1 || b1 > 0xFE | 9112 | if (b1 < 0xA1 || b1 > 0xFE |
| 9113 | || b2 < 0x40 || (b2 > 0x7E && b2 < 0xA1) || b2 > 0xFE) | 9113 | || b2 < 0x40 || (b2 > 0x7E && b2 < 0xA1) || b2 > 0xFE) |
| 9114 | error ("Invalid code: %"pEd, ch); | 9114 | error ("Invalid code: %"pI"d", ch); |
| 9115 | c = ch; | 9115 | c = ch; |
| 9116 | charset = charset_big5; | 9116 | charset = charset_big5; |
| 9117 | } | 9117 | } |
| 9118 | c = DECODE_CHAR (charset, c); | 9118 | c = DECODE_CHAR (charset, c); |
| 9119 | if (c < 0) | 9119 | if (c < 0) |
| 9120 | error ("Invalid code: %"pEd, ch); | 9120 | error ("Invalid code: %"pI"d", ch); |
| 9121 | return make_number (c); | 9121 | return make_number (c); |
| 9122 | } | 9122 | } |
| 9123 | 9123 | ||
| @@ -9289,7 +9289,7 @@ usage: (find-operation-coding-system OPERATION ARGUMENTS...) */) | |||
| 9289 | || (EQ (operation, Qinsert_file_contents) && CONSP (target) | 9289 | || (EQ (operation, Qinsert_file_contents) && CONSP (target) |
| 9290 | && STRINGP (XCAR (target)) && BUFFERP (XCDR (target))) | 9290 | && STRINGP (XCAR (target)) && BUFFERP (XCDR (target))) |
| 9291 | || (EQ (operation, Qopen_network_stream) && INTEGERP (target)))) | 9291 | || (EQ (operation, Qopen_network_stream) && INTEGERP (target)))) |
| 9292 | error ("Invalid %"pEd"th argument", XFASTINT (target_idx) + 1); | 9292 | error ("Invalid %"pI"dth argument", XFASTINT (target_idx) + 1); |
| 9293 | if (CONSP (target)) | 9293 | if (CONSP (target)) |
| 9294 | target = XCAR (target); | 9294 | target = XCAR (target); |
| 9295 | 9295 | ||
| @@ -9765,7 +9765,7 @@ usage: (define-coding-system-internal ...) */) | |||
| 9765 | CHECK_CHARSET_GET_ID (tmp1, id); | 9765 | CHECK_CHARSET_GET_ID (tmp1, id); |
| 9766 | CHECK_NATNUM_CDR (val); | 9766 | CHECK_NATNUM_CDR (val); |
| 9767 | if (XINT (XCDR (val)) >= 4) | 9767 | if (XINT (XCDR (val)) >= 4) |
| 9768 | error ("Invalid graphic register number: %"pEd, XINT (XCDR (val))); | 9768 | error ("Invalid graphic register number: %"pI"d", XINT (XCDR (val))); |
| 9769 | XSETCAR (val, make_number (id)); | 9769 | XSETCAR (val, make_number (id)); |
| 9770 | } | 9770 | } |
| 9771 | 9771 | ||