From ef1b0ba7e5a82308514b8427cd84994805e61a4f Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 19 Dec 2010 00:43:42 -0500 Subject: [PATCH] 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. --- src/ChangeLog | 115 +++++++++++++-------- src/alloc.c | 9 +- src/coding.c | 76 +++++++------- src/dispextern.h | 2 +- src/dispnew.c | 4 + src/eval.c | 262 +++++++++++++++++++++++------------------------ src/fontset.c | 6 +- src/ftfont.c | 14 +-- src/image.c | 2 +- src/lread.c | 10 +- src/textprop.c | 50 ++++----- src/window.c | 11 +- src/xterm.c | 17 ++- 13 files changed, 302 insertions(+), 276 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index f9287ea9c8..4313c68f59 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,32 @@ +2010-12-19 Stefan Monnier + + Minor clean up to silence some gcc warnings. + * window.c (Fset_window_buffer): + * 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'. + * textprop.c (Fremove_list_of_text_properties): Add braces to silence + compiler warning. + * fontset.c (fontset_id_valid_p, dump_fontset): + * ftfont.c (ftfont_drive_otf): Modernize k&r declaration. + * eval.c (Feval, Ffuncall): Avoid unneeded gotos. + * dispnew.c (update_frame, update_frame_1): Compile the `do_pause' + label only when it's used. + * image.c (x_create_bitmap_from_xpm_data): + * dispextern.h (x_create_bitmap_from_xpm_data): Use const char** like + its callers. + * 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. + * 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. + 2010-12-17 Chong Yidong * keyboard.c (parse_tool_bar_item): Allow menu separators in @@ -12,8 +41,8 @@ (xg_update_menu_item, xg_tool_bar_menu_proxy) (xg_show_toolbar_item, update_frame_tool_bar): Use it. (separator_names, xg_separator_p): Move to keyboard.c. - (create_menus, xg_update_submenu, update_frame_tool_bar): Use - menu_separator_name_p. + (create_menus, xg_update_submenu, update_frame_tool_bar): + Use menu_separator_name_p. * nsmenu.m (name_is_separator): Function deleted. (addItemWithWidgetValue): Use menu_separator_name_p. @@ -947,8 +976,8 @@ strings and R2L glyph rows. Fix comments. (note_mouse_highlight): When bidi reordering is turned on in a buffer, call next-single-property-change and - previous-single-property-change with last argument nil. Clear - mouse highlight when mouse pointer is in a R2L row on the stretch + previous-single-property-change with last argument nil. + Clear mouse highlight when mouse pointer is in a R2L row on the stretch glyph that stands for no text beyond the line end. (row_containing_pos): Don't return too early when CHARPOS is in a bidi-reordered continued line. Return immediately when the first @@ -1391,8 +1420,8 @@ 2010-09-30 Lars Magne Ingebrigtsen - * eval.c (Fbacktrace): Don't overwrite print-level on exit. Also - only override Vprint_level if it isn't already bound, and increase + * eval.c (Fbacktrace): Don't overwrite print-level on exit. + Also only override Vprint_level if it isn't already bound, and increase the level to 8 to produce more useful backtraces for bug reports. 2010-09-30 Dan Nicolaescu @@ -1531,7 +1560,7 @@ 2010-09-27 Lars Magne Ingebrigtsen - * gnutls.c (gnutls_log_function): Added more debugging. + * gnutls.c (gnutls_log_function): Add more debugging. (emacs_gnutls_read): Don't infloop while reading. 2010-09-27 Kenichi Handa @@ -1573,7 +1602,7 @@ * process.c (gpm_wait_mask, max_gpm_desc): Remove. (write_mask): New variable. - (max_input_desc): Renamed from max_keyboard_desc. + (max_input_desc): Rename from max_keyboard_desc. (fd_callback_info): New variable. (add_read_fd, delete_read_fd, add_write_fd, delete_write_fd): New functions. @@ -2192,7 +2221,7 @@ 2010-09-14 Lars Magne Ingebrigtsen - * xml.c (parse_buffer): Renamed to parse_string(), since that's + * xml.c (parse_buffer): Rename to parse_string(), since that's what it does. (parse_string): Return nil when the document can't be parsed. @@ -3350,7 +3379,7 @@ (xg_height_or_width_changed): Use FRAME_TOTAL_PIXEL_WIDTH. (xg_create_frame_widgets): Create a hobox for placing widgets vertically. Use gtk_box_pack_start. - (xg_height_or_width_changed): Renamed from xg_height_changed. + (xg_height_or_width_changed): Rename from xg_height_changed. (x_wm_set_size_hint): Add FRAME_TOOLBAR_WIDTH to base_width. (xg_update_frame_menubar, free_frame_menubar): Change to xg_height_or_width_changed. @@ -3990,7 +4019,7 @@ (Ffont_get): If KEY is :otf and the font-object doesn't have the property, get the property value dynamically. (Ffont_put): Accept font-entity and font-object too. - (Ffont_get_glyhphs): Renamed from Fget_font_glyphs. Arguments and + (Ffont_get_glyhphs): Rename from Fget_font_glyphs. Arguments and return value changed. (syms_of_font): Adjust for the above change. @@ -4063,7 +4092,7 @@ * doprnt.c (doprnt): Take a va_list argument instead of count and pointer. * eval.c (error): Change to a standard-C variadic function. - * xdisp.c (vmessage): Renamed from message, made static, and + * xdisp.c (vmessage): Rename from message, made static, and changed to take a va_list argument. (message): New variadic wrapper. (message_nolog): Now a variadic function, calling vmessage. @@ -5076,8 +5105,8 @@ * xdisp.c (try_scrolling): Compute the limit for searching point in forward scroll from scroll_max, instead of an arbitrary limit - of 10 screen lines. See - http://lists.gnu.org/archive/html/emacs-devel/2010-06/msg00766.html + of 10 screen lines. + See http://lists.gnu.org/archive/html/emacs-devel/2010-06/msg00766.html and http://lists.gnu.org/archive/html/emacs-devel/2010-06/msg00773.html for details. @@ -5325,8 +5354,8 @@ Fix cursor motion in bidi-reordered continued lines. * xdisp.c (try_cursor_movement): Backup to non-continuation line only after finding point's row. Fix the logic. Rewrite the loop - over continuation lines in bidi-reordered buffers. Return - CURSOR_MOVEMENT_MUST_SCROLL upon failure to find a suitable row, + over continuation lines in bidi-reordered buffers. + Return CURSOR_MOVEMENT_MUST_SCROLL upon failure to find a suitable row, rather than CURSOR_MOVEMENT_CANNOT_BE_USED. 2010-05-28 Michael Albinus @@ -6445,13 +6474,13 @@ store_config_changed_event. (parse_settings): Rename from parse_xft_settings. Read non-xft xsettings outside #ifdef HAVE_XFT. - (read_settings): Renamed from read_xft_settings. + (read_settings): Rename from read_xft_settings. (apply_xft_settings): Take current settings as parameter. Do not call read_(xft)_settings. (read_and_apply_settings): New function. (xft_settings_event): Do non-xft stuff out of HAVE_XFT. Call read_and_apply_settings if there are settings to be read. - (init_xsettings): Renamed from init_xfd_settings. + (init_xsettings): Rename from init_xfd_settings. Call read_and_apply_settings unconditionally. (xsettings_initialize): Call init_xsettings. (Ftool_bar_get_system_style): New function. @@ -9607,7 +9636,7 @@ * makefile.w32-in ($(BLD)/doc.$(O)): Depend on buildobj.h, not on $(SRC)/buildobj.h. - (buildobj.h): Renamed from $(SRC)/buildobj.h. + (buildobj.h): Rename from $(SRC)/buildobj.h. (make-buildobj-CMD, make-buildobj-SH): Create buildobj.h, not $(SRC)/buildobj.h. (clean): Add buildobj.h. @@ -12651,12 +12680,12 @@ 2008-12-13 Kenichi Handa - * font.c (font_rescale_ratio): Moved from xfaces.c. + * font.c (font_rescale_ratio): Move from xfaces.c. Argument type changed. Handle a font-spec too. (font_score): Check Vface_font_rescale_alist. (font_open_entity): Likewise. (Bug#1547) - * xfaces.c (font_rescale_ratio): Moved to font.c. + * xfaces.c (font_rescale_ratio): Move to font.c. 2008-12-13 Chong Yidong @@ -12674,7 +12703,7 @@ 2008-12-11 Chong Yidong - * term.c (tty_free_frame_resources): Renamed from delete_tty_output; + * term.c (tty_free_frame_resources): Rename from delete_tty_output; all callers changed. Call free_frame_faces to free the face cache. 2008-12-11 Jason Rumney @@ -18004,7 +18033,7 @@ (FONT_WEIGHT_NAME_NUMERIC, FONT_SLANT_NAME_NUMERIC) (FONT_WIDTH_NAME_NUMERIC, FONT_SET_STYLE): New macros. (struct font_spec, struct font_entity): New structs. - (FONT_ENCODING_NOT_DECIDED): Moved from fontset.h. + (FONT_ENCODING_NOT_DECIDED): Move from fontset.h. (struct font): Many members from old "struct font_info" moved to here. Members font and entity deleted. (FONT_SPEC_P, FONT_ENTITY_P, FONT_OBJECT_P, FONTP): Modified for @@ -18012,7 +18041,7 @@ (CHECK_FONT_SPEC, CHECK_FONT_ENTITY, CHECK_FONT_OBJECT) (CHECK_FONT_GET_OBJECT): Likewise. (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT, XSETFONT): New macros. - (PT_PER_INCH, POINT_TO_PIXEL, PIXEL_TO_POINT): Moved from font.h. + (PT_PER_INCH, POINT_TO_PIXEL, PIXEL_TO_POINT): Move from font.h. (struct font_driver): New members case_sensitive anc check. Type of the member list and open changed. (enable_font_backend, font_symbolic_weight, font_symbolic_slant) @@ -18024,7 +18053,7 @@ (enable_font_backend): Delete it. (Qfont_spec, Qfont_entity, Qfont_object): New variables. (CHECK_VALIDATE_FONT_SPEC): Delete it. - (PT_PER_INCH, POINT_TO_PIXEL, PIXEL_TO_POINT): Moved to font.h. + (PT_PER_INCH, POINT_TO_PIXEL, PIXEL_TO_POINT): Move to font.h. (null_string): Delete it. (null_vector): Make it static. (font_family_alist): Delete it. @@ -18032,7 +18061,7 @@ (QCextra, QClanguage): Delete it. (QClang, QCavgwidth, QCfont_entity, QCfc_unknown_spec): New variables. (font_make_spec, font_make_entity, font_make_object) - (font_intern_prop): Renamed from intern_downcase. Don't downcase + (font_intern_prop): Rename from intern_downcase. Don't downcase the string. Callers changed. (font_pixel_size): Adjust for the format change of font-related objects. @@ -18052,7 +18081,7 @@ (font_expand_wildcards, font_parse_xlfd, font_unparse_xlfd) (font_parse_fcname, font_unparse_fcname) (font_prepare_composition): Likewise. - (font_parse_family_registry): Renamed from font_merge_old_spec. + (font_parse_family_registry): Rename from font_merge_old_spec. (otf_open): Delete the 1st arg entity. (font_otf_capability): Adjust for the above change. (font_score): New arg alternate_families. Adjusted for the change @@ -18080,7 +18109,7 @@ (Ffontp, Ffont_spec, Ffont_get, Ffont_put, Flist_fonts) (Ffont_xlfd_name): Adjust for the change of font-related objects. (Fcopy_font_spec, Fmerge_font_spec): New function. - (Ffont_family_list): Renamed from list-families. + (Ffont_family_list): Rename from list-families. (Finternal_set_font_style_table): Arguments changed. (Ffont_fill_gstring, Ffont_shape_text, Fopen_font) (Ffont_drive_otf, Fquery_font, Ffont_match_p): Adjust for the @@ -18089,7 +18118,7 @@ * fontset.h (struct font_info): Delete it. Most members go to struct font. - (FONT_ENCODING_NOT_DECIDED): Moved to font.h. + (FONT_ENCODING_NOT_DECIDED): Move to font.h. (enum FONT_SPEC_INDEX): Delete it. (font_info, list_fonts_func, load_font_func, query_font_func) (set_frame_fontset_func, find_ccl_program_func) @@ -18131,7 +18160,7 @@ (Fnew_fontset): Use font_unparse_xlfd to generate FONTSET_ASCII (fontset). (new_fontset_from_font_name): Deleted. - (fontset_from_font): Renamed from new_fontset_from_font. Check if + (fontset_from_font): Rename from new_fontset_from_font. Check if a fontset is already created for the font. FIx updating of Vfontset_alias_alist. (fontset_ascii_font): Deleted. @@ -18240,7 +18269,7 @@ by FONTP. (lface_fully_specified_p): Don't check LFACE_AVGWIDTH. (set_lface_from_font_name): Delete it. - (set_lface_from_font): Renamed from + (set_lface_from_font): Rename from set_lface_from_font_and_fontset. Caller changed. Don't set LFACE_AVGWIDTH. Use FONT_XXX_FOR_FACE to get a symbol suitable for face. @@ -18281,12 +18310,12 @@ * xfont.c: Include and "ccl.h". (struct xfont_info): New structure. (xfont_query_font): Deleted. - (xfont_find_ccl_program): Renamed from x_find_ccl_program and + (xfont_find_ccl_program): Rename from x_find_ccl_program and moved from xterm.c. (xfont_driver): Adjust for the change of struct font_driver. (compare_font_names): New function. - (xfont_list_pattern): Sort font names case insensitively. Make - font_entity by calling font_make_entity. Avoid auto-scaled fonts. + (xfont_list_pattern): Sort font names case insensitively. + Make font_entity by calling font_make_entity. Avoid auto-scaled fonts. (xfont_list): Return a list, not vector. (xfont_match): If the font doesn't have QCname property, generate a name from the other font properties. @@ -18334,12 +18363,12 @@ (x_draw_composite_glyph_string_foreground): Likewise. (x_draw_glyph_string): Likewise. Use font->underline_position and font->underline_thickness. - (x_new_font): Renamed from x_new_fontset2. + (x_new_font): Rename from x_new_fontset2. (x_new_fontset, x_get_font_info, x_list_fonts): Deleted. (x_check_font): Call `check' method of a font driver. (x_font_min_bounds, x_compute_min_glyph_bounds, x_load_font) (x_query_font, x_get_font_repertory): Deleted. - (x_find_ccl_program): Renamed and moved to xfont.c. + (x_find_ccl_program): Rename and moved to xfont.c. (x_redisplay_interface): Adjust for the change of `struct redisplay_interface'. @@ -18364,7 +18393,7 @@ (w32font_close): Don't free struct font. Adjusted for the change of struct w32font_info. (w32font_encode_char, w32font_text_extents, w32font_draw): - Adjusted for the change of struct w32font_info. + Adjust for the change of struct w32font_info. (w32font_draw): Likewise. (w32font_list_internal): Return a list, not vector. (w32font_open_internal): Change the 4th arg to font-object. @@ -19766,11 +19795,11 @@ * xterm.c (handle_one_xevent): For Gtk+ and ConfigureNotify, call xg_frame_resized when the event is for the edit widget. - * gtkutil.h (xg_frame_resized): Renamed from xg_resize_widgets. + * gtkutil.h (xg_frame_resized): Rename from xg_resize_widgets. * gtkutil.c (xg_resize_outer_widget): Only do one of set_geometry or set_char_size. - (xg_frame_resized): Renamed from xg_resize_widgets. Remove all + (xg_frame_resized): Rename from xg_resize_widgets. Remove all operations on widgets here. Just set frame size if needed. (flush_and_sync, x_wm_size_hint_off, xg_pack_tool_bar): New functions. (xg_frame_set_char_size): Call x_wm_size_hint_off before resizing. @@ -22166,7 +22195,7 @@ * font.c (enum xlfd_field_index): Rename XLFD_XXX_SIZE_INDEX to XLFD_XXX_INDEX. (enum xlfd_field_mask): New enum. - (intern_font_field): Changed argument. Change caller. If digits + (intern_font_field): Change argument. Change caller. If digits are followed by non-digits, return a symbol. (font_expand_wildcards): New function. (font_parse_xlfd): Fix wildcard handling. @@ -24906,8 +24935,8 @@ (DECODE_EMACS_MULE_COMPOSITION_RULE_20): Rename from DECODE_EMACS_MULE_COMPOSITION_RULE. Change caller. (DECODE_EMACS_MULE_COMPOSITION_RULE_21): New macro. - (DECODE_EMACS_MULE_21_COMPOSITION): Call - DECODE_EMACS_MULE_COMPOSITION_RULE_21. Produce correct annotation + (DECODE_EMACS_MULE_21_COMPOSITION): + Call DECODE_EMACS_MULE_COMPOSITION_RULE_21. Produce correct annotation sequence. (decode_coding_emacs_mule): Handle composition correctly. Rewind `src' and `consumed_chars' correctly before calling emacs_mule_char. @@ -25328,7 +25357,7 @@ (SUB_CHAR_TABLE_P): Check PVEC_CHAR_TABLE. (GC_SUB_CHAR_TABLE_P): New macro. (Fencode_coding_string, Fdecode_coding_string): Update EXFUN. - (code_convert_string_norecord): Deleted extern. + (code_convert_string_norecord): Delete extern. (init_character_once, syms_of_character, init_charset) (syms_of_composite, Qeq, Fmakehash, insert_from_gap): Extern them. diff --git a/src/alloc.c b/src/alloc.c index a1c78a408d..e754e2f6aa 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -143,8 +143,6 @@ static pthread_mutex_t alloc_mutex; static __malloc_size_t bytes_used_when_full; -static __malloc_size_t bytes_used_when_reconsidered; - /* Mark, unmark, query mark bit of a Lisp string. S must be a pointer to a struct Lisp_String. */ @@ -1140,6 +1138,8 @@ static void * (*old_malloc_hook) (size_t, const void *); static void * (*old_realloc_hook) (void *, size_t, const void*); static void (*old_free_hook) (void*, const void*); +static __malloc_size_t bytes_used_when_reconsidered; + /* This function is used as the hook for free to call. */ static void @@ -1491,8 +1491,7 @@ mark_interval_tree (register INTERVAL tree) can't create number objects in macros. */ #ifndef make_number Lisp_Object -make_number (n) - EMACS_INT n; +make_number (EMACS_INT n) { Lisp_Object obj; obj.s.val = n; @@ -5270,7 +5269,7 @@ mark_char_table (struct Lisp_Vector *ptr) { Lisp_Object val = ptr->contents[i]; - if (INTEGERP (val) || SYMBOLP (val) && XSYMBOL (val)->gcmarkbit) + if (INTEGERP (val) || (SYMBOLP (val) && XSYMBOL (val)->gcmarkbit)) continue; if (SUB_CHAR_TABLE_P (val)) { diff --git a/src/coding.c b/src/coding.c index a7b7c7d6b2..e409ffdadf 100644 --- a/src/coding.c +++ b/src/coding.c @@ -1607,10 +1607,9 @@ static int detect_coding_utf_16 (struct coding_system *coding, struct coding_detection_info *detect_info) { - const unsigned char *src = coding->source, *src_base = src; + const unsigned char *src = coding->source; const unsigned char *src_end = coding->source + coding->src_bytes; int multibytep = coding->src_multibyte; - int consumed_chars = 0; int c1, c2; detect_info->checked |= CATEGORY_MASK_UTF_16; @@ -2277,7 +2276,6 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src, #define DECODE_EMACS_MULE_21_COMPOSITION() \ do { \ enum composition_method method = c - 0xF2; \ - int *charbuf_base = charbuf; \ int nbytes, nchars; \ \ ONE_MORE_BYTE (c); \ @@ -2633,7 +2631,6 @@ decode_coding_emacs_mule (struct coding_system *coding) } continue; - retry: src = src_base; consumed_chars = consumed_chars_base; continue; @@ -6260,8 +6257,9 @@ detect_eol (const unsigned char *source, EMACS_INT src_bytes, { /* The found type is different from what found before. Allow for stray ^M characters in DOS EOL files. */ - if (eol_seen == EOL_SEEN_CR && this_eol == EOL_SEEN_CRLF - || eol_seen == EOL_SEEN_CRLF && this_eol == EOL_SEEN_CR) + if ((eol_seen == EOL_SEEN_CR && this_eol == EOL_SEEN_CRLF) + || (eol_seen == EOL_SEEN_CRLF + && this_eol == EOL_SEEN_CR)) eol_seen = EOL_SEEN_CRLF; else { @@ -6276,42 +6274,40 @@ detect_eol (const unsigned char *source, EMACS_INT src_bytes, } } else - { - while (src < src_end) - { - c = *src++; - if (c == '\n' || c == '\r') - { - int this_eol; + while (src < src_end) + { + c = *src++; + if (c == '\n' || c == '\r') + { + int this_eol; - if (c == '\n') - this_eol = EOL_SEEN_LF; - else if (src >= src_end || *src != '\n') - this_eol = EOL_SEEN_CR; - else - this_eol = EOL_SEEN_CRLF, src++; + if (c == '\n') + this_eol = EOL_SEEN_LF; + else if (src >= src_end || *src != '\n') + this_eol = EOL_SEEN_CR; + else + this_eol = EOL_SEEN_CRLF, src++; - if (eol_seen == EOL_SEEN_NONE) - /* This is the first end-of-line. */ - eol_seen = this_eol; - else if (eol_seen != this_eol) - { - /* The found type is different from what found before. - Allow for stray ^M characters in DOS EOL files. */ - if (eol_seen == EOL_SEEN_CR && this_eol == EOL_SEEN_CRLF - || eol_seen == EOL_SEEN_CRLF && this_eol == EOL_SEEN_CR) - eol_seen = EOL_SEEN_CRLF; - else - { - eol_seen = EOL_SEEN_LF; - break; - } - } - if (++total == MAX_EOL_CHECK_COUNT) - break; - } - } - } + if (eol_seen == EOL_SEEN_NONE) + /* This is the first end-of-line. */ + eol_seen = this_eol; + else if (eol_seen != this_eol) + { + /* The found type is different from what found before. + Allow for stray ^M characters in DOS EOL files. */ + if ((eol_seen == EOL_SEEN_CR && this_eol == EOL_SEEN_CRLF) + || (eol_seen == EOL_SEEN_CRLF && this_eol == EOL_SEEN_CR)) + eol_seen = EOL_SEEN_CRLF; + else + { + eol_seen = EOL_SEEN_LF; + break; + } + } + if (++total == MAX_EOL_CHECK_COUNT) + break; + } + } return eol_seen; } diff --git a/src/dispextern.h b/src/dispextern.h index 175dbe1975..2839ee7881 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -3131,7 +3131,7 @@ extern int x_create_bitmap_from_data (struct frame *, char *, unsigned int, unsigned int); extern int x_create_bitmap_from_file (struct frame *, Lisp_Object); #if defined (HAVE_XPM) && defined (HAVE_X_WINDOWS) -extern int x_create_bitmap_from_xpm_data (struct frame *f, char **bits); +extern int x_create_bitmap_from_xpm_data (struct frame *f, const char **bits); #endif #ifndef x_destroy_bitmap extern void x_destroy_bitmap (struct frame *, int); diff --git a/src/dispnew.c b/src/dispnew.c index 5d4ce01253..fa13024cf2 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -3447,7 +3447,9 @@ update_frame (struct frame *f, int force_p, int inhibit_hairy_id_p) #endif } +#if PERIODIC_PREEMPTION_CHECKING do_pause: +#endif /* Reset flags indicating that a window should be updated. */ set_window_update_flags (root_window, 0); @@ -4908,7 +4910,9 @@ update_frame_1 (struct frame *f, int force_p, int inhibit_id_p) } } +#if !PERIODIC_PREEMPTION_CHECKING do_pause: +#endif clear_desired_matrices (f); return pause; diff --git a/src/eval.c b/src/eval.c index 8580ceb8c3..f8874ddd55 100644 --- a/src/eval.c +++ b/src/eval.c @@ -2291,14 +2291,12 @@ DEFUN ("eval", Feval, Seval, 1, 1, 0, (XSUBR (fun)->max_args >= 0 && XSUBR (fun)->max_args < XINT (numargs))) xsignal2 (Qwrong_number_of_arguments, original_fun, numargs); - if (XSUBR (fun)->max_args == UNEVALLED) + else if (XSUBR (fun)->max_args == UNEVALLED) { backtrace.evalargs = 0; val = (XSUBR (fun)->function.aUNEVALLED) (args_left); - goto done; } - - if (XSUBR (fun)->max_args == MANY) + else if (XSUBR (fun)->max_args == MANY) { /* Pass a vector of evaluated arguments */ Lisp_Object *vals; @@ -2324,73 +2322,76 @@ DEFUN ("eval", Feval, Seval, 1, 1, 0, val = (XSUBR (fun)->function.aMANY) (XINT (numargs), vals); UNGCPRO; SAFE_FREE (); - goto done; } - - GCPRO3 (args_left, fun, fun); - gcpro3.var = argvals; - gcpro3.nvars = 0; - - maxargs = XSUBR (fun)->max_args; - for (i = 0; i < maxargs; args_left = Fcdr (args_left)) + else { - argvals[i] = Feval (Fcar (args_left)); - gcpro3.nvars = ++i; - } + GCPRO3 (args_left, fun, fun); + gcpro3.var = argvals; + gcpro3.nvars = 0; - UNGCPRO; + maxargs = XSUBR (fun)->max_args; + for (i = 0; i < maxargs; args_left = Fcdr (args_left)) + { + argvals[i] = Feval (Fcar (args_left)); + gcpro3.nvars = ++i; + } - backtrace.args = argvals; - backtrace.nargs = XINT (numargs); + UNGCPRO; - switch (i) - { - case 0: - val = (XSUBR (fun)->function.a0) (); - goto done; - case 1: - val = (XSUBR (fun)->function.a1) (argvals[0]); - goto done; - case 2: - val = (XSUBR (fun)->function.a2) (argvals[0], argvals[1]); - goto done; - case 3: - val = (XSUBR (fun)->function.a3) (argvals[0], argvals[1], - argvals[2]); - goto done; - case 4: - val = (XSUBR (fun)->function.a4) (argvals[0], argvals[1], - argvals[2], argvals[3]); - goto done; - case 5: - val = (XSUBR (fun)->function.a5) (argvals[0], argvals[1], argvals[2], - argvals[3], argvals[4]); - goto done; - case 6: - val = (XSUBR (fun)->function.a6) (argvals[0], argvals[1], argvals[2], - argvals[3], argvals[4], argvals[5]); - goto done; - case 7: - val = (XSUBR (fun)->function.a7) (argvals[0], argvals[1], argvals[2], - argvals[3], argvals[4], argvals[5], - argvals[6]); - goto done; - - case 8: - val = (XSUBR (fun)->function.a8) (argvals[0], argvals[1], argvals[2], - argvals[3], argvals[4], argvals[5], - argvals[6], argvals[7]); - goto done; - - default: - /* Someone has created a subr that takes more arguments than - is supported by this code. We need to either rewrite the - subr to use a different argument protocol, or add more - cases to this switch. */ - abort (); + backtrace.args = argvals; + backtrace.nargs = XINT (numargs); + + switch (i) + { + case 0: + val = (XSUBR (fun)->function.a0 ()); + break; + case 1: + val = (XSUBR (fun)->function.a1 (argvals[0])); + break; + case 2: + val = (XSUBR (fun)->function.a2 (argvals[0], argvals[1])); + break; + case 3: + val = (XSUBR (fun)->function.a3 + (argvals[0], argvals[1], argvals[2])); + break; + case 4: + val = (XSUBR (fun)->function.a4 + (argvals[0], argvals[1], argvals[2], argvals[3])); + break; + case 5: + val = (XSUBR (fun)->function.a5 + (argvals[0], argvals[1], argvals[2], argvals[3], + argvals[4])); + break; + case 6: + val = (XSUBR (fun)->function.a6 + (argvals[0], argvals[1], argvals[2], argvals[3], + argvals[4], argvals[5])); + break; + case 7: + val = (XSUBR (fun)->function.a7 + (argvals[0], argvals[1], argvals[2], argvals[3], + argvals[4], argvals[5], argvals[6])); + break; + + case 8: + val = (XSUBR (fun)->function.a8 + (argvals[0], argvals[1], argvals[2], argvals[3], + argvals[4], argvals[5], argvals[6], argvals[7])); + break; + + default: + /* Someone has created a subr that takes more arguments than + is supported by this code. We need to either rewrite the + subr to use a different argument protocol, or add more + cases to this switch. */ + abort (); + } } } - if (COMPILEDP (fun)) + else if (COMPILEDP (fun)) val = apply_lambda (fun, original_args, 1); else { @@ -2413,7 +2414,6 @@ DEFUN ("eval", Feval, Seval, 1, 1, 0, else xsignal1 (Qinvalid_function, original_fun); } - done: CHECK_CONS_LIST (); lisp_eval_depth--; @@ -2956,83 +2956,84 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */) if (SUBRP (fun)) { - if (numargs < XSUBR (fun)->min_args + if (numargs < XSUBR (fun)->min_args || (XSUBR (fun)->max_args >= 0 && XSUBR (fun)->max_args < numargs)) { XSETFASTINT (lisp_numargs, numargs); xsignal2 (Qwrong_number_of_arguments, original_fun, lisp_numargs); } - if (XSUBR (fun)->max_args == UNEVALLED) + else if (XSUBR (fun)->max_args == UNEVALLED) xsignal1 (Qinvalid_function, original_fun); - if (XSUBR (fun)->max_args == MANY) - { - val = (XSUBR (fun)->function.aMANY) (numargs, args + 1); - goto done; - } - - if (XSUBR (fun)->max_args > numargs) - { - internal_args = (Lisp_Object *) alloca (XSUBR (fun)->max_args * sizeof (Lisp_Object)); - memcpy (internal_args, args + 1, numargs * sizeof (Lisp_Object)); - for (i = numargs; i < XSUBR (fun)->max_args; i++) - internal_args[i] = Qnil; - } + else if (XSUBR (fun)->max_args == MANY) + val = (XSUBR (fun)->function.aMANY) (numargs, args + 1); else - internal_args = args + 1; - switch (XSUBR (fun)->max_args) { - case 0: - val = (XSUBR (fun)->function.a0) (); - goto done; - case 1: - val = (XSUBR (fun)->function.a1) (internal_args[0]); - goto done; - case 2: - val = (XSUBR (fun)->function.a2) (internal_args[0], internal_args[1]); - goto done; - case 3: - val = (XSUBR (fun)->function.a3) (internal_args[0], internal_args[1], - internal_args[2]); - goto done; - case 4: - val = (XSUBR (fun)->function.a4) (internal_args[0], internal_args[1], - internal_args[2], internal_args[3]); - goto done; - case 5: - val = (XSUBR (fun)->function.a5) (internal_args[0], internal_args[1], - internal_args[2], internal_args[3], - internal_args[4]); - goto done; - case 6: - val = (XSUBR (fun)->function.a6) (internal_args[0], internal_args[1], - internal_args[2], internal_args[3], - internal_args[4], internal_args[5]); - goto done; - case 7: - val = (XSUBR (fun)->function.a7) (internal_args[0], internal_args[1], - internal_args[2], internal_args[3], - internal_args[4], internal_args[5], - internal_args[6]); - goto done; - - case 8: - val = (XSUBR (fun)->function.a8) (internal_args[0], internal_args[1], - internal_args[2], internal_args[3], - internal_args[4], internal_args[5], - internal_args[6], internal_args[7]); - goto done; - - default: - - /* If a subr takes more than 8 arguments without using MANY - or UNEVALLED, we need to extend this function to support it. - Until this is done, there is no way to call the function. */ - abort (); + if (XSUBR (fun)->max_args > numargs) + { + internal_args = (Lisp_Object *) alloca (XSUBR (fun)->max_args * sizeof (Lisp_Object)); + memcpy (internal_args, args + 1, numargs * sizeof (Lisp_Object)); + for (i = numargs; i < XSUBR (fun)->max_args; i++) + internal_args[i] = Qnil; + } + else + internal_args = args + 1; + switch (XSUBR (fun)->max_args) + { + case 0: + val = (XSUBR (fun)->function.a0 ()); + break; + case 1: + val = (XSUBR (fun)->function.a1 (internal_args[0])); + break; + case 2: + val = (XSUBR (fun)->function.a2 + (internal_args[0], internal_args[1])); + break; + case 3: + val = (XSUBR (fun)->function.a3 + (internal_args[0], internal_args[1], internal_args[2])); + break; + case 4: + val = (XSUBR (fun)->function.a4 + (internal_args[0], internal_args[1], internal_args[2], + internal_args[3])); + break; + case 5: + val = (XSUBR (fun)->function.a5 + (internal_args[0], internal_args[1], internal_args[2], + internal_args[3], internal_args[4])); + break; + case 6: + val = (XSUBR (fun)->function.a6 + (internal_args[0], internal_args[1], internal_args[2], + internal_args[3], internal_args[4], internal_args[5])); + break; + case 7: + val = (XSUBR (fun)->function.a7 + (internal_args[0], internal_args[1], internal_args[2], + internal_args[3], internal_args[4], internal_args[5], + internal_args[6])); + break; + + case 8: + val = (XSUBR (fun)->function.a8 + (internal_args[0], internal_args[1], internal_args[2], + internal_args[3], internal_args[4], internal_args[5], + internal_args[6], internal_args[7])); + break; + + default: + + /* If a subr takes more than 8 arguments without using MANY + or UNEVALLED, we need to extend this function to support it. + Until this is done, there is no way to call the function. */ + abort (); + } } } - if (COMPILEDP (fun)) + else if (COMPILEDP (fun)) val = funcall_lambda (fun, numargs, args + 1); else { @@ -3054,7 +3055,6 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */) else xsignal1 (Qinvalid_function, original_fun); } - done: CHECK_CONS_LIST (); lisp_eval_depth--; if (backtrace.debug_on_exit) diff --git a/src/fontset.c b/src/fontset.c index 86b9ceb45d..9b140be8d7 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -225,8 +225,7 @@ static void set_fontset_font (Lisp_Object, Lisp_Object); /* Return 1 if ID is a valid fontset id, else return 0. */ static int -fontset_id_valid_p (id) - int id; +fontset_id_valid_p (int id) { return (id >= 0 && id < ASIZE (Vfontset_table) - 1); } @@ -2128,8 +2127,7 @@ DEFUN ("fontset-list", Ffontset_list, Sfontset_list, 0, 0, 0, #ifdef FONTSET_DEBUG Lisp_Object -dump_fontset (fontset) - Lisp_Object fontset; +dump_fontset (Lisp_Object fontset) { Lisp_Object vec; diff --git a/src/ftfont.c b/src/ftfont.c index d9ae9be090..66edbe16fe 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -1767,13 +1767,13 @@ setup_otf_gstring (int size) position adjustment information in ADJUSTMENT. */ static int -ftfont_drive_otf (font, spec, in, from, to, out, adjustment) - MFLTFont *font; - MFLTOtfSpec *spec; - MFLTGlyphString *in; - int from, to; - MFLTGlyphString *out; - MFLTGlyphAdjustment *adjustment; +ftfont_drive_otf (MFLTFont *font, + MFLTOtfSpec *spec, + MFLTGlyphString *in, + int from, + int to, + MFLTGlyphString *out, + MFLTGlyphAdjustment *adjustment) { struct MFLTFontFT *flt_font_ft = (struct MFLTFontFT *) font; FT_Face ft_face = flt_font_ft->ft_face; diff --git a/src/image.c b/src/image.c index 828c2d319b..07f573ca89 100644 --- a/src/image.c +++ b/src/image.c @@ -3332,7 +3332,7 @@ xpm_image_p (Lisp_Object object) #if defined (HAVE_XPM) && defined (HAVE_X_WINDOWS) int -x_create_bitmap_from_xpm_data (struct frame *f, char **bits) +x_create_bitmap_from_xpm_data (struct frame *f, const char **bits) { Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); int id, rc; diff --git a/src/lread.c b/src/lread.c index c7b8e70963..811e83fe2a 100644 --- a/src/lread.c +++ b/src/lread.c @@ -2888,10 +2888,7 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list) { char *end = read_buffer + read_buffer_size; - while (c > 040 - && c != 0x8a0 /* NBSP */ - && (c >= 0200 - || !(strchr ("\"';()[]#`,", c)))) + do { if (end - p < MAX_MULTIBYTE_LENGTH) { @@ -2915,7 +2912,10 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list) else *p++ = c; c = READCHAR; - } + } while (c > 040 + && c != 0x8a0 /* NBSP */ + && (c >= 0200 + || !(strchr ("\"';()[]#`,", c)))); if (p == end) { diff --git a/src/textprop.c b/src/textprop.c index 88e869b13e..9016705d76 100644 --- a/src/textprop.c +++ b/src/textprop.c @@ -1604,17 +1604,19 @@ Return t if any property was actually removed, nil otherwise. */) if (LENGTH (i) >= len) { if (! interval_has_some_properties_list (properties, i)) - if (modified) - { - if (BUFFERP (object)) - signal_after_change (XINT (start), XINT (end) - XINT (start), - XINT (end) - XINT (start)); - return Qt; - } - else - return Qnil; - - if (LENGTH (i) == len) + { + if (modified) + { + if (BUFFERP (object)) + signal_after_change (XINT (start), + XINT (end) - XINT (start), + XINT (end) - XINT (start)); + return Qt; + } + else + return Qnil; + } + else if (LENGTH (i) == len) { if (!modified && BUFFERP (object)) modify_region (XBUFFER (object), XINT (start), XINT (end), 1); @@ -1624,20 +1626,20 @@ Return t if any property was actually removed, nil otherwise. */) XINT (end) - XINT (start)); return Qt; } - - /* i has the properties, and goes past the change limit */ - unchanged = i; - i = split_interval_left (i, len); - copy_properties (unchanged, i); - if (!modified && BUFFERP (object)) - modify_region (XBUFFER (object), XINT (start), XINT (end), 1); - remove_properties (Qnil, properties, i, object); - if (BUFFERP (object)) - signal_after_change (XINT (start), XINT (end) - XINT (start), - XINT (end) - XINT (start)); - return Qt; + else + { /* i has the properties, and goes past the change limit. */ + unchanged = i; + i = split_interval_left (i, len); + copy_properties (unchanged, i); + if (!modified && BUFFERP (object)) + modify_region (XBUFFER (object), XINT (start), XINT (end), 1); + remove_properties (Qnil, properties, i, object); + if (BUFFERP (object)) + signal_after_change (XINT (start), XINT (end) - XINT (start), + XINT (end) - XINT (start)); + return Qt; + } } - if (interval_has_some_properties_list (properties, i)) { if (!modified && BUFFERP (object)) diff --git a/src/window.c b/src/window.c index a2a0c79311..e66fde9ec0 100644 --- a/src/window.c +++ b/src/window.c @@ -3522,11 +3522,12 @@ This function runs `window-scroll-functions' before running else if (!EQ (tem, Qt)) /* w->buffer is t when the window is first being set up. */ { - if (!EQ (tem, buffer)) - if (EQ (w->dedicated, Qt)) - error ("Window is dedicated to `%s'", SDATA (XBUFFER (tem)->name)); - else - w->dedicated = Qnil; + if (EQ (tem, buffer)) + return Qnil; + else if (EQ (w->dedicated, Qt)) + error ("Window is dedicated to `%s'", SDATA (XBUFFER (tem)->name)); + else + w->dedicated = Qnil; unshow_buffer (w); } diff --git a/src/xterm.c b/src/xterm.c index a571d02557..7b5b85b365 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -489,14 +489,14 @@ x_set_frame_alpha (struct frame *f) &data); if (rc == Success && actual != None) - if (*(unsigned long *)data == opac) - { - XFree ((void *) data); - x_uncatch_errors (); - return; - } - else + { XFree ((void *) data); + if (*(unsigned long *)data == opac) + { + x_uncatch_errors (); + return; + } + } x_uncatch_errors (); } @@ -6498,7 +6498,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventp, int *finish, { /* Decode the input data. */ int require; - unsigned char *p; /* The input should be decoded with `coding_system' which depends on which X*LookupString function @@ -8469,7 +8468,6 @@ do_ewmh_fullscreen (struct frame *f) { struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); int have_net_atom = wm_supports (f, dpyinfo->Xatom_net_wm_state); - Lisp_Object lval = get_frame_param (f, Qfullscreen); int cur, dummy; get_current_wm_state (f, FRAME_OUTER_WINDOW (f), &cur, &dummy); @@ -8992,7 +8990,6 @@ XTframe_raise_lower (FRAME_PTR f, int raise_flag) void xembed_set_info (struct frame *f, enum xembed_info flags) { - Atom atom; unsigned long data[2]; struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); -- 2.20.1