diff options
| author | Stefan Monnier | 2010-12-19 00:43:42 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2010-12-19 00:43:42 -0500 |
| commit | ef1b0ba7e5a82308514b8427cd84994805e61a4f (patch) | |
| tree | b859dcfe452c6b493b20c58a2c6af1d8032c296f /src/coding.c | |
| parent | 45720dc368101aa88ba2ec88f6259ae4aaf3d847 (diff) | |
| download | emacs-ef1b0ba7e5a82308514b8427cd84994805e61a4f.tar.gz emacs-ef1b0ba7e5a82308514b8427cd84994805e61a4f.zip | |
Minor clean up to silence some gcc warnings.
* src/window.c (Fset_window_buffer):
* src/xterm.c (x_set_frame_alpha): Restructure code to silence
compiler warning.
(handle_one_xevent): Remove unused var `p'.
(do_ewmh_fullscreen): Remove unused var `lval'.
(xembed_set_info): Remove unused var `atom'.
* src/textprop.c (Fremove_list_of_text_properties): Add braces to silence
compiler warning.
* src/fontset.c (fontset_id_valid_p, dump_fontset):
* src/ftfont.c (ftfont_drive_otf): Modernize k&r declaration.
* src/eval.c (Feval, Ffuncall): Avoid unneeded gotos.
* src/dispnew.c (update_frame, update_frame_1): Compile the `do_pause'
label only when it's used.
* src/image.c (x_create_bitmap_from_xpm_data):
* src/dispextern.h (x_create_bitmap_from_xpm_data): Use const char** like
its callers.
* src/coding.c (detect_coding_utf_16): Remove unused vars `src_base' and
`consumed_chars'.
(DECODE_EMACS_MULE_21_COMPOSITION): Remove unused var `charbuf_base'.
(decode_coding_emacs_mule): Remove unused label `retry'.
(detect_eol): Add parens to silence compiler warning.
* src/alloc.c (bytes_used_when_reconsidered): Move to the #ifdef where
it's used to silence the compiler.
(make_number): Modernize k&r declaration.
(mark_char_table): Add parens to silence compiler warning.
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 76 |
1 files changed, 36 insertions, 40 deletions
diff --git a/src/coding.c b/src/coding.c index a7b7c7d6b23..e409ffdadf1 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -1607,10 +1607,9 @@ static int | |||
| 1607 | detect_coding_utf_16 (struct coding_system *coding, | 1607 | detect_coding_utf_16 (struct coding_system *coding, |
| 1608 | struct coding_detection_info *detect_info) | 1608 | struct coding_detection_info *detect_info) |
| 1609 | { | 1609 | { |
| 1610 | const unsigned char *src = coding->source, *src_base = src; | 1610 | const unsigned char *src = coding->source; |
| 1611 | const unsigned char *src_end = coding->source + coding->src_bytes; | 1611 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| 1612 | int multibytep = coding->src_multibyte; | 1612 | int multibytep = coding->src_multibyte; |
| 1613 | int consumed_chars = 0; | ||
| 1614 | int c1, c2; | 1613 | int c1, c2; |
| 1615 | 1614 | ||
| 1616 | detect_info->checked |= CATEGORY_MASK_UTF_16; | 1615 | detect_info->checked |= CATEGORY_MASK_UTF_16; |
| @@ -2277,7 +2276,6 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src, | |||
| 2277 | #define DECODE_EMACS_MULE_21_COMPOSITION() \ | 2276 | #define DECODE_EMACS_MULE_21_COMPOSITION() \ |
| 2278 | do { \ | 2277 | do { \ |
| 2279 | enum composition_method method = c - 0xF2; \ | 2278 | enum composition_method method = c - 0xF2; \ |
| 2280 | int *charbuf_base = charbuf; \ | ||
| 2281 | int nbytes, nchars; \ | 2279 | int nbytes, nchars; \ |
| 2282 | \ | 2280 | \ |
| 2283 | ONE_MORE_BYTE (c); \ | 2281 | ONE_MORE_BYTE (c); \ |
| @@ -2633,7 +2631,6 @@ decode_coding_emacs_mule (struct coding_system *coding) | |||
| 2633 | } | 2631 | } |
| 2634 | continue; | 2632 | continue; |
| 2635 | 2633 | ||
| 2636 | retry: | ||
| 2637 | src = src_base; | 2634 | src = src_base; |
| 2638 | consumed_chars = consumed_chars_base; | 2635 | consumed_chars = consumed_chars_base; |
| 2639 | continue; | 2636 | continue; |
| @@ -6260,8 +6257,9 @@ detect_eol (const unsigned char *source, EMACS_INT src_bytes, | |||
| 6260 | { | 6257 | { |
| 6261 | /* The found type is different from what found before. | 6258 | /* The found type is different from what found before. |
| 6262 | Allow for stray ^M characters in DOS EOL files. */ | 6259 | Allow for stray ^M characters in DOS EOL files. */ |
| 6263 | if (eol_seen == EOL_SEEN_CR && this_eol == EOL_SEEN_CRLF | 6260 | if ((eol_seen == EOL_SEEN_CR && this_eol == EOL_SEEN_CRLF) |
| 6264 | || eol_seen == EOL_SEEN_CRLF && this_eol == EOL_SEEN_CR) | 6261 | || (eol_seen == EOL_SEEN_CRLF |
| 6262 | && this_eol == EOL_SEEN_CR)) | ||
| 6265 | eol_seen = EOL_SEEN_CRLF; | 6263 | eol_seen = EOL_SEEN_CRLF; |
| 6266 | else | 6264 | else |
| 6267 | { | 6265 | { |
| @@ -6276,42 +6274,40 @@ detect_eol (const unsigned char *source, EMACS_INT src_bytes, | |||
| 6276 | } | 6274 | } |
| 6277 | } | 6275 | } |
| 6278 | else | 6276 | else |
| 6279 | { | 6277 | while (src < src_end) |
| 6280 | while (src < src_end) | 6278 | { |
| 6281 | { | 6279 | c = *src++; |
| 6282 | c = *src++; | 6280 | if (c == '\n' || c == '\r') |
| 6283 | if (c == '\n' || c == '\r') | 6281 | { |
| 6284 | { | 6282 | int this_eol; |
| 6285 | int this_eol; | ||
| 6286 | 6283 | ||
| 6287 | if (c == '\n') | 6284 | if (c == '\n') |
| 6288 | this_eol = EOL_SEEN_LF; | 6285 | this_eol = EOL_SEEN_LF; |
| 6289 | else if (src >= src_end || *src != '\n') | 6286 | else if (src >= src_end || *src != '\n') |
| 6290 | this_eol = EOL_SEEN_CR; | 6287 | this_eol = EOL_SEEN_CR; |
| 6291 | else | 6288 | else |
| 6292 | this_eol = EOL_SEEN_CRLF, src++; | 6289 | this_eol = EOL_SEEN_CRLF, src++; |
| 6293 | 6290 | ||
| 6294 | if (eol_seen == EOL_SEEN_NONE) | 6291 | if (eol_seen == EOL_SEEN_NONE) |
| 6295 | /* This is the first end-of-line. */ | 6292 | /* This is the first end-of-line. */ |
| 6296 | eol_seen = this_eol; | 6293 | eol_seen = this_eol; |
| 6297 | else if (eol_seen != this_eol) | 6294 | else if (eol_seen != this_eol) |
| 6298 | { | 6295 | { |
| 6299 | /* The found type is different from what found before. | 6296 | /* The found type is different from what found before. |
| 6300 | Allow for stray ^M characters in DOS EOL files. */ | 6297 | Allow for stray ^M characters in DOS EOL files. */ |
| 6301 | if (eol_seen == EOL_SEEN_CR && this_eol == EOL_SEEN_CRLF | 6298 | if ((eol_seen == EOL_SEEN_CR && this_eol == EOL_SEEN_CRLF) |
| 6302 | || eol_seen == EOL_SEEN_CRLF && this_eol == EOL_SEEN_CR) | 6299 | || (eol_seen == EOL_SEEN_CRLF && this_eol == EOL_SEEN_CR)) |
| 6303 | eol_seen = EOL_SEEN_CRLF; | 6300 | eol_seen = EOL_SEEN_CRLF; |
| 6304 | else | 6301 | else |
| 6305 | { | 6302 | { |
| 6306 | eol_seen = EOL_SEEN_LF; | 6303 | eol_seen = EOL_SEEN_LF; |
| 6307 | break; | 6304 | break; |
| 6308 | } | 6305 | } |
| 6309 | } | 6306 | } |
| 6310 | if (++total == MAX_EOL_CHECK_COUNT) | 6307 | if (++total == MAX_EOL_CHECK_COUNT) |
| 6311 | break; | 6308 | break; |
| 6312 | } | 6309 | } |
| 6313 | } | 6310 | } |
| 6314 | } | ||
| 6315 | return eol_seen; | 6311 | return eol_seen; |
| 6316 | } | 6312 | } |
| 6317 | 6313 | ||