diff options
| author | Paul Eggert | 2013-08-10 18:30:20 -0700 |
|---|---|---|
| committer | Paul Eggert | 2013-08-10 18:30:20 -0700 |
| commit | 7d652d97681c4f1b67018f44f64c619ef5edd990 (patch) | |
| tree | a9d8ac72718b53f60ddd3e7cbca7180b5796b79e /src | |
| parent | 9a4ebc748797acc8af74f561367aa1b34ca02d2e (diff) | |
| download | emacs-7d652d97681c4f1b67018f44f64c619ef5edd990.tar.gz emacs-7d652d97681c4f1b67018f44f64c619ef5edd990.zip | |
Omit some unnecessary casts.
Many of these go back to the old pre-C89 days, when they may have
been needed, but we've been assuming C89 or later for a while now.
* alloc.c (live_string_p, live_cons_p, live_symbol_p)
(live_float_p, live_misc_p, live_vector_p):
* buffer.c (compare_overlays, cmp_for_strings, mmap_find)
(mmap_alloc, alloc_buffer_text, enlarge_buffer_text)
(defvar_per_buffer):
* callint.c (Fcall_interactively):
* doc.c (Fsubstitute_command_keys):
* filelock.c (get_boot_time):
* frame.c (xrdb_get_resource):
* gtkutil.c (hierarchy_ch_cb, qttip_cb, style_changed_cb)
(delete_cb, xg_dialog_response_cb, xg_maybe_add_timer)
(xg_get_file_name_from_selector, menuitem_destroy_callback)
(menuitem_highlight_callback, menu_destroy_callback)
(xg_update_menu_item, xg_modify_menubar_widgets, menubar_map_cb)
(xg_tool_bar_callback, xg_get_tool_bar_widgets)
(xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
(xg_tool_bar_help_callback, tb_size_cb):
* image.c (xpm_alloc_color, png_read_from_memory)
(png_read_from_file, png_load_body, our_memory_skip_input_data)
(jpeg_memory_src, jpeg_file_src, imagemagick_load_image)
(syms_of_image):
* keymap.c (describe_map):
* nsfns.m (Fns_display_monitor_attributes_list):
* nsmenu.m (process_dialog:):
* nsterm.m (hold_event):
* process.c (wait_reading_process_output):
* regex.c (REGEX_REALLOCATE, re_set_registers, re_exec, regexec):
* scroll.c (do_direct_scrolling, scrolling_1):
* termcap.c (tgetent):
* window.c (check_window_containing, add_window_to_list)
(freeze_window_starts):
* xdisp.c (compare_overlay_entries, vmessage):
* xfns.c (x_window, x_get_monitor_attributes_xinerama)
(x_get_monitor_attributes_xrandr)
(Fx_display_monitor_attributes_list, x_display_info_for_name)
(Fx_open_connection, file_dialog_cb, file_dialog_unmap_cb):
* xfont.c (xfont_match, xfont_open):
* xmenu.c (x_menu_wait_for_event, menu_highlight_callback)
(menubar_selection_callback, menu_position_func)
(popup_selection_callback, create_and_show_popup_menu)
(dialog_selection_callback, create_and_show_dialog):
* xrdb.c (x_get_string_resource):
(main) [TESTRM]:
* xsmfns.c (x_session_check_input):
* xterm.c (x_draw_glyphless_glyph_string_foreground)
(xm_scroll_callback, xg_scroll_callback, xg_end_scroll_callback)
(xaw_jump_callback, xaw_scroll_callback):
Omit unnecessary casts.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 54 | ||||
| -rw-r--r-- | src/alloc.c | 12 | ||||
| -rw-r--r-- | src/buffer.c | 22 | ||||
| -rw-r--r-- | src/callint.c | 2 | ||||
| -rw-r--r-- | src/doc.c | 2 | ||||
| -rw-r--r-- | src/filelock.c | 2 | ||||
| -rw-r--r-- | src/frame.c | 2 | ||||
| -rw-r--r-- | src/gtkutil.c | 45 | ||||
| -rw-r--r-- | src/image.c | 50 | ||||
| -rw-r--r-- | src/keymap.c | 3 | ||||
| -rw-r--r-- | src/nsfns.m | 2 | ||||
| -rw-r--r-- | src/nsmenu.m | 2 | ||||
| -rw-r--r-- | src/nsterm.m | 4 | ||||
| -rw-r--r-- | src/process.c | 2 | ||||
| -rw-r--r-- | src/regex.c | 9 | ||||
| -rw-r--r-- | src/scroll.c | 8 | ||||
| -rw-r--r-- | src/termcap.c | 4 | ||||
| -rw-r--r-- | src/window.c | 6 | ||||
| -rw-r--r-- | src/xdisp.c | 6 | ||||
| -rw-r--r-- | src/xfns.c | 31 | ||||
| -rw-r--r-- | src/xfont.c | 6 | ||||
| -rw-r--r-- | src/xmenu.c | 34 | ||||
| -rw-r--r-- | src/xrdb.c | 7 | ||||
| -rw-r--r-- | src/xsmfns.c | 3 | ||||
| -rw-r--r-- | src/xterm.c | 22 |
25 files changed, 177 insertions, 163 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 976d068dadc..e114db5c8d4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,57 @@ | |||
| 1 | 2013-08-11 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Omit some unnecessary casts. | ||
| 4 | Many of these go back to the old pre-C89 days, when they may have | ||
| 5 | been needed, but we've been assuming C89 or later for a while now. | ||
| 6 | * alloc.c (live_string_p, live_cons_p, live_symbol_p) | ||
| 7 | (live_float_p, live_misc_p, live_vector_p): | ||
| 8 | * buffer.c (compare_overlays, cmp_for_strings, mmap_find) | ||
| 9 | (mmap_alloc, alloc_buffer_text, enlarge_buffer_text) | ||
| 10 | (defvar_per_buffer): | ||
| 11 | * callint.c (Fcall_interactively): | ||
| 12 | * doc.c (Fsubstitute_command_keys): | ||
| 13 | * filelock.c (get_boot_time): | ||
| 14 | * frame.c (xrdb_get_resource): | ||
| 15 | * gtkutil.c (hierarchy_ch_cb, qttip_cb, style_changed_cb) | ||
| 16 | (delete_cb, xg_dialog_response_cb, xg_maybe_add_timer) | ||
| 17 | (xg_get_file_name_from_selector, menuitem_destroy_callback) | ||
| 18 | (menuitem_highlight_callback, menu_destroy_callback) | ||
| 19 | (xg_update_menu_item, xg_modify_menubar_widgets, menubar_map_cb) | ||
| 20 | (xg_tool_bar_callback, xg_get_tool_bar_widgets) | ||
| 21 | (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback) | ||
| 22 | (xg_tool_bar_help_callback, tb_size_cb): | ||
| 23 | * image.c (xpm_alloc_color, png_read_from_memory) | ||
| 24 | (png_read_from_file, png_load_body, our_memory_skip_input_data) | ||
| 25 | (jpeg_memory_src, jpeg_file_src, imagemagick_load_image) | ||
| 26 | (syms_of_image): | ||
| 27 | * keymap.c (describe_map): | ||
| 28 | * nsfns.m (Fns_display_monitor_attributes_list): | ||
| 29 | * nsmenu.m (process_dialog:): | ||
| 30 | * nsterm.m (hold_event): | ||
| 31 | * process.c (wait_reading_process_output): | ||
| 32 | * regex.c (REGEX_REALLOCATE, re_set_registers, re_exec, regexec): | ||
| 33 | * scroll.c (do_direct_scrolling, scrolling_1): | ||
| 34 | * termcap.c (tgetent): | ||
| 35 | * window.c (check_window_containing, add_window_to_list) | ||
| 36 | (freeze_window_starts): | ||
| 37 | * xdisp.c (compare_overlay_entries, vmessage): | ||
| 38 | * xfns.c (x_window, x_get_monitor_attributes_xinerama) | ||
| 39 | (x_get_monitor_attributes_xrandr) | ||
| 40 | (Fx_display_monitor_attributes_list, x_display_info_for_name) | ||
| 41 | (Fx_open_connection, file_dialog_cb, file_dialog_unmap_cb): | ||
| 42 | * xfont.c (xfont_match, xfont_open): | ||
| 43 | * xmenu.c (x_menu_wait_for_event, menu_highlight_callback) | ||
| 44 | (menubar_selection_callback, menu_position_func) | ||
| 45 | (popup_selection_callback, create_and_show_popup_menu) | ||
| 46 | (dialog_selection_callback, create_and_show_dialog): | ||
| 47 | * xrdb.c (x_get_string_resource): | ||
| 48 | (main) [TESTRM]: | ||
| 49 | * xsmfns.c (x_session_check_input): | ||
| 50 | * xterm.c (x_draw_glyphless_glyph_string_foreground) | ||
| 51 | (xm_scroll_callback, xg_scroll_callback, xg_end_scroll_callback) | ||
| 52 | (xaw_jump_callback, xaw_scroll_callback): | ||
| 53 | Omit unnecessary casts. | ||
| 54 | |||
| 1 | 2013-08-10 Paul Eggert <eggert@cs.ucla.edu> | 55 | 2013-08-10 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 56 | ||
| 3 | Minor string-length refactoring. | 57 | Minor string-length refactoring. |
diff --git a/src/alloc.c b/src/alloc.c index f9bcaed0117..2c2232601cb 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -4058,7 +4058,7 @@ live_string_p (struct mem_node *m, void *p) | |||
| 4058 | { | 4058 | { |
| 4059 | if (m->type == MEM_TYPE_STRING) | 4059 | if (m->type == MEM_TYPE_STRING) |
| 4060 | { | 4060 | { |
| 4061 | struct string_block *b = (struct string_block *) m->start; | 4061 | struct string_block *b = m->start; |
| 4062 | ptrdiff_t offset = (char *) p - (char *) &b->strings[0]; | 4062 | ptrdiff_t offset = (char *) p - (char *) &b->strings[0]; |
| 4063 | 4063 | ||
| 4064 | /* P must point to the start of a Lisp_String structure, and it | 4064 | /* P must point to the start of a Lisp_String structure, and it |
| @@ -4081,7 +4081,7 @@ live_cons_p (struct mem_node *m, void *p) | |||
| 4081 | { | 4081 | { |
| 4082 | if (m->type == MEM_TYPE_CONS) | 4082 | if (m->type == MEM_TYPE_CONS) |
| 4083 | { | 4083 | { |
| 4084 | struct cons_block *b = (struct cons_block *) m->start; | 4084 | struct cons_block *b = m->start; |
| 4085 | ptrdiff_t offset = (char *) p - (char *) &b->conses[0]; | 4085 | ptrdiff_t offset = (char *) p - (char *) &b->conses[0]; |
| 4086 | 4086 | ||
| 4087 | /* P must point to the start of a Lisp_Cons, not be | 4087 | /* P must point to the start of a Lisp_Cons, not be |
| @@ -4107,7 +4107,7 @@ live_symbol_p (struct mem_node *m, void *p) | |||
| 4107 | { | 4107 | { |
| 4108 | if (m->type == MEM_TYPE_SYMBOL) | 4108 | if (m->type == MEM_TYPE_SYMBOL) |
| 4109 | { | 4109 | { |
| 4110 | struct symbol_block *b = (struct symbol_block *) m->start; | 4110 | struct symbol_block *b = m->start; |
| 4111 | ptrdiff_t offset = (char *) p - (char *) &b->symbols[0]; | 4111 | ptrdiff_t offset = (char *) p - (char *) &b->symbols[0]; |
| 4112 | 4112 | ||
| 4113 | /* P must point to the start of a Lisp_Symbol, not be | 4113 | /* P must point to the start of a Lisp_Symbol, not be |
| @@ -4133,7 +4133,7 @@ live_float_p (struct mem_node *m, void *p) | |||
| 4133 | { | 4133 | { |
| 4134 | if (m->type == MEM_TYPE_FLOAT) | 4134 | if (m->type == MEM_TYPE_FLOAT) |
| 4135 | { | 4135 | { |
| 4136 | struct float_block *b = (struct float_block *) m->start; | 4136 | struct float_block *b = m->start; |
| 4137 | ptrdiff_t offset = (char *) p - (char *) &b->floats[0]; | 4137 | ptrdiff_t offset = (char *) p - (char *) &b->floats[0]; |
| 4138 | 4138 | ||
| 4139 | /* P must point to the start of a Lisp_Float and not be | 4139 | /* P must point to the start of a Lisp_Float and not be |
| @@ -4157,7 +4157,7 @@ live_misc_p (struct mem_node *m, void *p) | |||
| 4157 | { | 4157 | { |
| 4158 | if (m->type == MEM_TYPE_MISC) | 4158 | if (m->type == MEM_TYPE_MISC) |
| 4159 | { | 4159 | { |
| 4160 | struct marker_block *b = (struct marker_block *) m->start; | 4160 | struct marker_block *b = m->start; |
| 4161 | ptrdiff_t offset = (char *) p - (char *) &b->markers[0]; | 4161 | ptrdiff_t offset = (char *) p - (char *) &b->markers[0]; |
| 4162 | 4162 | ||
| 4163 | /* P must point to the start of a Lisp_Misc, not be | 4163 | /* P must point to the start of a Lisp_Misc, not be |
| @@ -4184,7 +4184,7 @@ live_vector_p (struct mem_node *m, void *p) | |||
| 4184 | if (m->type == MEM_TYPE_VECTOR_BLOCK) | 4184 | if (m->type == MEM_TYPE_VECTOR_BLOCK) |
| 4185 | { | 4185 | { |
| 4186 | /* This memory node corresponds to a vector block. */ | 4186 | /* This memory node corresponds to a vector block. */ |
| 4187 | struct vector_block *block = (struct vector_block *) m->start; | 4187 | struct vector_block *block = m->start; |
| 4188 | struct Lisp_Vector *vector = (struct Lisp_Vector *) block->data; | 4188 | struct Lisp_Vector *vector = (struct Lisp_Vector *) block->data; |
| 4189 | 4189 | ||
| 4190 | /* P is in the block's allocation range. Scan the block | 4190 | /* P is in the block's allocation range. Scan the block |
diff --git a/src/buffer.c b/src/buffer.c index ce4b44c87c3..5244b7043dc 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -3146,8 +3146,8 @@ struct sortvec | |||
| 3146 | static int | 3146 | static int |
| 3147 | compare_overlays (const void *v1, const void *v2) | 3147 | compare_overlays (const void *v1, const void *v2) |
| 3148 | { | 3148 | { |
| 3149 | const struct sortvec *s1 = (const struct sortvec *) v1; | 3149 | const struct sortvec *s1 = v1; |
| 3150 | const struct sortvec *s2 = (const struct sortvec *) v2; | 3150 | const struct sortvec *s2 = v2; |
| 3151 | if (s1->priority != s2->priority) | 3151 | if (s1->priority != s2->priority) |
| 3152 | return s1->priority < s2->priority ? -1 : 1; | 3152 | return s1->priority < s2->priority ? -1 : 1; |
| 3153 | if (s1->beg != s2->beg) | 3153 | if (s1->beg != s2->beg) |
| @@ -3253,8 +3253,8 @@ static ptrdiff_t overlay_str_len; | |||
| 3253 | static int | 3253 | static int |
| 3254 | cmp_for_strings (const void *as1, const void *as2) | 3254 | cmp_for_strings (const void *as1, const void *as2) |
| 3255 | { | 3255 | { |
| 3256 | struct sortstr *s1 = (struct sortstr *)as1; | 3256 | struct sortstr const *s1 = as1; |
| 3257 | struct sortstr *s2 = (struct sortstr *)as2; | 3257 | struct sortstr const *s2 = as2; |
| 3258 | if (s1->size != s2->size) | 3258 | if (s1->size != s2->size) |
| 3259 | return s2->size < s1->size ? -1 : 1; | 3259 | return s2->size < s1->size ? -1 : 1; |
| 3260 | if (s1->priority != s2->priority) | 3260 | if (s1->priority != s2->priority) |
| @@ -4752,7 +4752,7 @@ static struct mmap_region * | |||
| 4752 | mmap_find (void *start, void *end) | 4752 | mmap_find (void *start, void *end) |
| 4753 | { | 4753 | { |
| 4754 | struct mmap_region *r; | 4754 | struct mmap_region *r; |
| 4755 | char *s = (char *) start, *e = (char *) end; | 4755 | char *s = start, *e = end; |
| 4756 | 4756 | ||
| 4757 | for (r = mmap_regions; r; r = r->next) | 4757 | for (r = mmap_regions; r; r = r->next) |
| 4758 | { | 4758 | { |
| @@ -4911,7 +4911,7 @@ mmap_alloc (void **var, size_t nbytes) | |||
| 4911 | } | 4911 | } |
| 4912 | else | 4912 | else |
| 4913 | { | 4913 | { |
| 4914 | struct mmap_region *r = (struct mmap_region *) p; | 4914 | struct mmap_region *r = p; |
| 4915 | 4915 | ||
| 4916 | r->nbytes_specified = nbytes; | 4916 | r->nbytes_specified = nbytes; |
| 4917 | r->nbytes_mapped = map; | 4917 | r->nbytes_mapped = map; |
| @@ -5051,7 +5051,7 @@ alloc_buffer_text (struct buffer *b, ptrdiff_t nbytes) | |||
| 5051 | memory_full (nbytes); | 5051 | memory_full (nbytes); |
| 5052 | } | 5052 | } |
| 5053 | 5053 | ||
| 5054 | b->text->beg = (unsigned char *) p; | 5054 | b->text->beg = p; |
| 5055 | unblock_input (); | 5055 | unblock_input (); |
| 5056 | } | 5056 | } |
| 5057 | 5057 | ||
| @@ -5079,7 +5079,7 @@ enlarge_buffer_text (struct buffer *b, ptrdiff_t delta) | |||
| 5079 | memory_full (nbytes); | 5079 | memory_full (nbytes); |
| 5080 | } | 5080 | } |
| 5081 | 5081 | ||
| 5082 | BUF_BEG_ADDR (b) = (unsigned char *) p; | 5082 | BUF_BEG_ADDR (b) = p; |
| 5083 | unblock_input (); | 5083 | unblock_input (); |
| 5084 | } | 5084 | } |
| 5085 | 5085 | ||
| @@ -5397,11 +5397,7 @@ defvar_per_buffer (struct Lisp_Buffer_Objfwd *bo_fwd, const char *namestring, | |||
| 5397 | bo_fwd->predicate = predicate; | 5397 | bo_fwd->predicate = predicate; |
| 5398 | sym->declared_special = 1; | 5398 | sym->declared_special = 1; |
| 5399 | sym->redirect = SYMBOL_FORWARDED; | 5399 | sym->redirect = SYMBOL_FORWARDED; |
| 5400 | { | 5400 | SET_SYMBOL_FWD (sym, (union Lisp_Fwd *) bo_fwd); |
| 5401 | /* I tried to do the job without a cast, but it seems impossible. | ||
| 5402 | union Lisp_Fwd *fwd; &(fwd->u_buffer_objfwd) = bo_fwd; */ | ||
| 5403 | SET_SYMBOL_FWD (sym, (union Lisp_Fwd *)bo_fwd); | ||
| 5404 | } | ||
| 5405 | XSETSYMBOL (PER_BUFFER_SYMBOL (offset), sym); | 5401 | XSETSYMBOL (PER_BUFFER_SYMBOL (offset), sym); |
| 5406 | 5402 | ||
| 5407 | if (PER_BUFFER_IDX (offset) == 0) | 5403 | if (PER_BUFFER_IDX (offset) == 0) |
diff --git a/src/callint.c b/src/callint.c index 38431226508..f43a5a990db 100644 --- a/src/callint.c +++ b/src/callint.c | |||
| @@ -529,7 +529,7 @@ invoke it. If KEYS is omitted or nil, the return value of | |||
| 529 | make_number (SCHARS (callint_message)), | 529 | make_number (SCHARS (callint_message)), |
| 530 | Qface, Qminibuffer_prompt, callint_message); | 530 | Qface, Qminibuffer_prompt, callint_message); |
| 531 | args[i] = Fread_char (callint_message, Qnil, Qnil); | 531 | args[i] = Fread_char (callint_message, Qnil, Qnil); |
| 532 | message1_nolog ((char *) 0); | 532 | message1_nolog (0); |
| 533 | /* Passing args[i] directly stimulates compiler bug. */ | 533 | /* Passing args[i] directly stimulates compiler bug. */ |
| 534 | teml = args[i]; | 534 | teml = args[i]; |
| 535 | /* See bug#8479. */ | 535 | /* See bug#8479. */ |
| @@ -905,7 +905,7 @@ Otherwise, return a new string, without any text properties. */) | |||
| 905 | If this one's not active, get nil. */ | 905 | If this one's not active, get nil. */ |
| 906 | earlier_maps = Fcdr (Fmemq (tem, Freverse (active_maps))); | 906 | earlier_maps = Fcdr (Fmemq (tem, Freverse (active_maps))); |
| 907 | describe_map_tree (tem, 1, Fnreverse (earlier_maps), | 907 | describe_map_tree (tem, 1, Fnreverse (earlier_maps), |
| 908 | Qnil, (char *)0, 1, 0, 0, 1); | 908 | Qnil, 0, 1, 0, 0, 1); |
| 909 | } | 909 | } |
| 910 | tem = Fbuffer_string (); | 910 | tem = Fbuffer_string (); |
| 911 | Ferase_buffer (); | 911 | Ferase_buffer (); |
diff --git a/src/filelock.c b/src/filelock.c index cb0bd5c7b96..df72eff5950 100644 --- a/src/filelock.c +++ b/src/filelock.c | |||
| @@ -181,7 +181,7 @@ get_boot_time (void) | |||
| 181 | since utmp is typically much smaller than wtmp. | 181 | since utmp is typically much smaller than wtmp. |
| 182 | Passing a null pointer causes get_boot_time_1 | 182 | Passing a null pointer causes get_boot_time_1 |
| 183 | to inspect the default file, namely utmp. */ | 183 | to inspect the default file, namely utmp. */ |
| 184 | get_boot_time_1 ((char *) 0, 0); | 184 | get_boot_time_1 (0, 0); |
| 185 | if (boot_time) | 185 | if (boot_time) |
| 186 | return boot_time; | 186 | return boot_time; |
| 187 | 187 | ||
diff --git a/src/frame.c b/src/frame.c index 9989ef7af13..a1f151a221e 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -3544,7 +3544,7 @@ xrdb_get_resource (XrmDatabase rdb, Lisp_Object attribute, Lisp_Object class, Li | |||
| 3544 | 3544 | ||
| 3545 | value = x_get_string_resource (rdb, name_key, class_key); | 3545 | value = x_get_string_resource (rdb, name_key, class_key); |
| 3546 | 3546 | ||
| 3547 | if (value != (char *) 0 && *value) | 3547 | if (value && *value) |
| 3548 | return build_string (value); | 3548 | return build_string (value); |
| 3549 | else | 3549 | else |
| 3550 | return Qnil; | 3550 | return Qnil; |
diff --git a/src/gtkutil.c b/src/gtkutil.c index 237d031295c..7e304d417d8 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -641,7 +641,7 @@ hierarchy_ch_cb (GtkWidget *widget, | |||
| 641 | GtkWidget *previous_toplevel, | 641 | GtkWidget *previous_toplevel, |
| 642 | gpointer user_data) | 642 | gpointer user_data) |
| 643 | { | 643 | { |
| 644 | struct frame *f = (struct frame *) user_data; | 644 | struct frame *f = user_data; |
| 645 | struct x_output *x = f->output_data.x; | 645 | struct x_output *x = f->output_data.x; |
| 646 | GtkWidget *top = gtk_widget_get_toplevel (x->ttip_lbl); | 646 | GtkWidget *top = gtk_widget_get_toplevel (x->ttip_lbl); |
| 647 | 647 | ||
| @@ -663,7 +663,7 @@ qttip_cb (GtkWidget *widget, | |||
| 663 | GtkTooltip *tooltip, | 663 | GtkTooltip *tooltip, |
| 664 | gpointer user_data) | 664 | gpointer user_data) |
| 665 | { | 665 | { |
| 666 | struct frame *f = (struct frame *) user_data; | 666 | struct frame *f = user_data; |
| 667 | struct x_output *x = f->output_data.x; | 667 | struct x_output *x = f->output_data.x; |
| 668 | if (x->ttip_widget == NULL) | 668 | if (x->ttip_widget == NULL) |
| 669 | { | 669 | { |
| @@ -1073,7 +1073,7 @@ style_changed_cb (GObject *go, | |||
| 1073 | gpointer user_data) | 1073 | gpointer user_data) |
| 1074 | { | 1074 | { |
| 1075 | struct input_event event; | 1075 | struct input_event event; |
| 1076 | GdkDisplay *gdpy = (GdkDisplay *) user_data; | 1076 | GdkDisplay *gdpy = user_data; |
| 1077 | const char *display_name = gdk_display_get_name (gdpy); | 1077 | const char *display_name = gdk_display_get_name (gdpy); |
| 1078 | Display *dpy = GDK_DISPLAY_XDISPLAY (gdpy); | 1078 | Display *dpy = GDK_DISPLAY_XDISPLAY (gdpy); |
| 1079 | 1079 | ||
| @@ -1115,7 +1115,7 @@ delete_cb (GtkWidget *widget, | |||
| 1115 | #ifdef HAVE_GTK3 | 1115 | #ifdef HAVE_GTK3 |
| 1116 | /* The event doesn't arrive in the normal event loop. Send event | 1116 | /* The event doesn't arrive in the normal event loop. Send event |
| 1117 | here. */ | 1117 | here. */ |
| 1118 | struct frame *f = (struct frame *) user_data; | 1118 | struct frame *f = user_data; |
| 1119 | struct input_event ie; | 1119 | struct input_event ie; |
| 1120 | 1120 | ||
| 1121 | EVENT_INIT (ie); | 1121 | EVENT_INIT (ie); |
| @@ -1642,7 +1642,7 @@ xg_dialog_response_cb (GtkDialog *w, | |||
| 1642 | gint response, | 1642 | gint response, |
| 1643 | gpointer user_data) | 1643 | gpointer user_data) |
| 1644 | { | 1644 | { |
| 1645 | struct xg_dialog_data *dd = (struct xg_dialog_data *)user_data; | 1645 | struct xg_dialog_data *dd = user_data; |
| 1646 | dd->response = response; | 1646 | dd->response = response; |
| 1647 | g_main_loop_quit (dd->loop); | 1647 | g_main_loop_quit (dd->loop); |
| 1648 | } | 1648 | } |
| @@ -1671,7 +1671,7 @@ pop_down_dialog (void *arg) | |||
| 1671 | static gboolean | 1671 | static gboolean |
| 1672 | xg_maybe_add_timer (gpointer data) | 1672 | xg_maybe_add_timer (gpointer data) |
| 1673 | { | 1673 | { |
| 1674 | struct xg_dialog_data *dd = (struct xg_dialog_data *) data; | 1674 | struct xg_dialog_data *dd = data; |
| 1675 | EMACS_TIME next_time = timer_check (); | 1675 | EMACS_TIME next_time = timer_check (); |
| 1676 | 1676 | ||
| 1677 | dd->timerid = 0; | 1677 | dd->timerid = 0; |
| @@ -1921,7 +1921,7 @@ static char * | |||
| 1921 | xg_get_file_name_from_selector (GtkWidget *w) | 1921 | xg_get_file_name_from_selector (GtkWidget *w) |
| 1922 | { | 1922 | { |
| 1923 | GtkFileSelection *filesel = GTK_FILE_SELECTION (w); | 1923 | GtkFileSelection *filesel = GTK_FILE_SELECTION (w); |
| 1924 | return xstrdup ((char*) gtk_file_selection_get_filename (filesel)); | 1924 | return xstrdup (gtk_file_selection_get_filename (filesel)); |
| 1925 | } | 1925 | } |
| 1926 | 1926 | ||
| 1927 | /* Create a file selection dialog. | 1927 | /* Create a file selection dialog. |
| @@ -2277,7 +2277,7 @@ menuitem_destroy_callback (GtkWidget *w, gpointer client_data) | |||
| 2277 | { | 2277 | { |
| 2278 | if (client_data) | 2278 | if (client_data) |
| 2279 | { | 2279 | { |
| 2280 | xg_menu_item_cb_data *data = (xg_menu_item_cb_data*) client_data; | 2280 | xg_menu_item_cb_data *data = client_data; |
| 2281 | xg_list_remove (&xg_menu_item_cb_list, &data->ptrs); | 2281 | xg_list_remove (&xg_menu_item_cb_list, &data->ptrs); |
| 2282 | xfree (data); | 2282 | xfree (data); |
| 2283 | } | 2283 | } |
| @@ -2301,8 +2301,7 @@ menuitem_highlight_callback (GtkWidget *w, | |||
| 2301 | 2301 | ||
| 2302 | ev.crossing = *event; | 2302 | ev.crossing = *event; |
| 2303 | subwidget = gtk_get_event_widget (&ev); | 2303 | subwidget = gtk_get_event_widget (&ev); |
| 2304 | data = (xg_menu_item_cb_data *) g_object_get_data (G_OBJECT (subwidget), | 2304 | data = g_object_get_data (G_OBJECT (subwidget), XG_ITEM_DATA); |
| 2305 | XG_ITEM_DATA); | ||
| 2306 | if (data) | 2305 | if (data) |
| 2307 | { | 2306 | { |
| 2308 | if (! NILP (data->help) && data->cl_data->highlight_cb) | 2307 | if (! NILP (data->help) && data->cl_data->highlight_cb) |
| @@ -2323,7 +2322,7 @@ menuitem_highlight_callback (GtkWidget *w, | |||
| 2323 | static void | 2322 | static void |
| 2324 | menu_destroy_callback (GtkWidget *w, gpointer client_data) | 2323 | menu_destroy_callback (GtkWidget *w, gpointer client_data) |
| 2325 | { | 2324 | { |
| 2326 | unref_cl_data ((xg_menu_cb_data*) client_data); | 2325 | unref_cl_data (client_data); |
| 2327 | } | 2326 | } |
| 2328 | 2327 | ||
| 2329 | /* Make a GTK widget that contains both UTF8_LABEL and UTF8_KEY (both | 2328 | /* Make a GTK widget that contains both UTF8_LABEL and UTF8_KEY (both |
| @@ -3064,8 +3063,7 @@ xg_update_menu_item (widget_value *val, | |||
| 3064 | else if (val->enabled && ! gtk_widget_get_sensitive (w)) | 3063 | else if (val->enabled && ! gtk_widget_get_sensitive (w)) |
| 3065 | gtk_widget_set_sensitive (w, TRUE); | 3064 | gtk_widget_set_sensitive (w, TRUE); |
| 3066 | 3065 | ||
| 3067 | cb_data = (xg_menu_item_cb_data*) g_object_get_data (G_OBJECT (w), | 3066 | cb_data = g_object_get_data (G_OBJECT (w), XG_ITEM_DATA); |
| 3068 | XG_ITEM_DATA); | ||
| 3069 | if (cb_data) | 3067 | if (cb_data) |
| 3070 | { | 3068 | { |
| 3071 | cb_data->call_data = val->call_data; | 3069 | cb_data->call_data = val->call_data; |
| @@ -3271,8 +3269,7 @@ xg_modify_menubar_widgets (GtkWidget *menubar, struct frame *f, | |||
| 3271 | 3269 | ||
| 3272 | if (! list) return; | 3270 | if (! list) return; |
| 3273 | 3271 | ||
| 3274 | cl_data = (xg_menu_cb_data*) g_object_get_data (G_OBJECT (menubar), | 3272 | cl_data = g_object_get_data (G_OBJECT (menubar), XG_FRAME_DATA); |
| 3275 | XG_FRAME_DATA); | ||
| 3276 | 3273 | ||
| 3277 | xg_update_menubar (menubar, f, &list, list, 0, val->contents, | 3274 | xg_update_menubar (menubar, f, &list, list, 0, val->contents, |
| 3278 | select_cb, deactivate_cb, highlight_cb, cl_data); | 3275 | select_cb, deactivate_cb, highlight_cb, cl_data); |
| @@ -3336,7 +3333,7 @@ static void | |||
| 3336 | menubar_map_cb (GtkWidget *w, gpointer user_data) | 3333 | menubar_map_cb (GtkWidget *w, gpointer user_data) |
| 3337 | { | 3334 | { |
| 3338 | GtkRequisition req; | 3335 | GtkRequisition req; |
| 3339 | struct frame *f = (struct frame *) user_data; | 3336 | struct frame *f = user_data; |
| 3340 | gtk_widget_get_preferred_size (w, NULL, &req); | 3337 | gtk_widget_get_preferred_size (w, NULL, &req); |
| 3341 | if (FRAME_MENUBAR_HEIGHT (f) != req.height) | 3338 | if (FRAME_MENUBAR_HEIGHT (f) != req.height) |
| 3342 | { | 3339 | { |
| @@ -3946,8 +3943,7 @@ xg_tool_bar_callback (GtkWidget *w, gpointer client_data) | |||
| 3946 | gpointer gmod = g_object_get_data (G_OBJECT (w), XG_TOOL_BAR_LAST_MODIFIER); | 3943 | gpointer gmod = g_object_get_data (G_OBJECT (w), XG_TOOL_BAR_LAST_MODIFIER); |
| 3947 | intptr_t mod = (intptr_t) gmod; | 3944 | intptr_t mod = (intptr_t) gmod; |
| 3948 | 3945 | ||
| 3949 | struct frame *f = (struct frame *) g_object_get_data (G_OBJECT (w), | 3946 | struct frame *f = g_object_get_data (G_OBJECT (w), XG_FRAME_DATA); |
| 3950 | XG_FRAME_DATA); | ||
| 3951 | Lisp_Object key, frame; | 3947 | Lisp_Object key, frame; |
| 3952 | struct input_event event; | 3948 | struct input_event event; |
| 3953 | EVENT_INIT (event); | 3949 | EVENT_INIT (event); |
| @@ -4020,8 +4016,8 @@ static GtkWidget * | |||
| 4020 | xg_get_tool_bar_widgets (GtkWidget *vb, GtkWidget **wimage) | 4016 | xg_get_tool_bar_widgets (GtkWidget *vb, GtkWidget **wimage) |
| 4021 | { | 4017 | { |
| 4022 | GList *clist = gtk_container_get_children (GTK_CONTAINER (vb)); | 4018 | GList *clist = gtk_container_get_children (GTK_CONTAINER (vb)); |
| 4023 | GtkWidget *c1 = (GtkWidget *) clist->data; | 4019 | GtkWidget *c1 = clist->data; |
| 4024 | GtkWidget *c2 = clist->next ? (GtkWidget *) clist->next->data : NULL; | 4020 | GtkWidget *c2 = clist->next ? clist->next->data : NULL; |
| 4025 | 4021 | ||
| 4026 | *wimage = GTK_IS_IMAGE (c1) ? c1 : c2; | 4022 | *wimage = GTK_IS_IMAGE (c1) ? c1 : c2; |
| 4027 | g_list_free (clist); | 4023 | g_list_free (clist); |
| @@ -4150,7 +4146,7 @@ xg_tool_bar_detach_callback (GtkHandleBox *wbox, | |||
| 4150 | GtkWidget *w, | 4146 | GtkWidget *w, |
| 4151 | gpointer client_data) | 4147 | gpointer client_data) |
| 4152 | { | 4148 | { |
| 4153 | struct frame *f = (struct frame *) client_data; | 4149 | struct frame *f = client_data; |
| 4154 | 4150 | ||
| 4155 | g_object_set (G_OBJECT (w), "show-arrow", !x_gtk_whole_detached_tool_bar, | 4151 | g_object_set (G_OBJECT (w), "show-arrow", !x_gtk_whole_detached_tool_bar, |
| 4156 | NULL); | 4152 | NULL); |
| @@ -4187,7 +4183,7 @@ xg_tool_bar_attach_callback (GtkHandleBox *wbox, | |||
| 4187 | GtkWidget *w, | 4183 | GtkWidget *w, |
| 4188 | gpointer client_data) | 4184 | gpointer client_data) |
| 4189 | { | 4185 | { |
| 4190 | struct frame *f = (struct frame *) client_data; | 4186 | struct frame *f = client_data; |
| 4191 | g_object_set (G_OBJECT (w), "show-arrow", TRUE, NULL); | 4187 | g_object_set (G_OBJECT (w), "show-arrow", TRUE, NULL); |
| 4192 | 4188 | ||
| 4193 | if (f) | 4189 | if (f) |
| @@ -4225,8 +4221,7 @@ xg_tool_bar_help_callback (GtkWidget *w, | |||
| 4225 | gpointer client_data) | 4221 | gpointer client_data) |
| 4226 | { | 4222 | { |
| 4227 | intptr_t idx = (intptr_t) client_data; | 4223 | intptr_t idx = (intptr_t) client_data; |
| 4228 | struct frame *f = (struct frame *) g_object_get_data (G_OBJECT (w), | 4224 | struct frame *f = g_object_get_data (G_OBJECT (w), XG_FRAME_DATA); |
| 4229 | XG_FRAME_DATA); | ||
| 4230 | Lisp_Object help, frame; | 4225 | Lisp_Object help, frame; |
| 4231 | 4226 | ||
| 4232 | if (! f || ! f->n_tool_bar_items || NILP (f->tool_bar_items)) | 4227 | if (! f || ! f->n_tool_bar_items || NILP (f->tool_bar_items)) |
| @@ -4366,7 +4361,7 @@ tb_size_cb (GtkWidget *widget, | |||
| 4366 | /* When tool bar is created it has one preferred size. But when size is | 4361 | /* When tool bar is created it has one preferred size. But when size is |
| 4367 | allocated between widgets, it may get another. So we must update | 4362 | allocated between widgets, it may get another. So we must update |
| 4368 | size hints if tool bar size changes. Seen on Fedora 18 at least. */ | 4363 | size hints if tool bar size changes. Seen on Fedora 18 at least. */ |
| 4369 | struct frame *f = (struct frame *) user_data; | 4364 | struct frame *f = user_data; |
| 4370 | if (xg_update_tool_bar_sizes (f)) | 4365 | if (xg_update_tool_bar_sizes (f)) |
| 4371 | x_wm_set_size_hint (f, 0, 0); | 4366 | x_wm_set_size_hint (f, 0, 0); |
| 4372 | } | 4367 | } |
diff --git a/src/image.c b/src/image.c index 911ca8e6681..ae38b4f7648 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -3332,7 +3332,7 @@ static int | |||
| 3332 | xpm_alloc_color (Display *dpy, Colormap cmap, char *color_name, XColor *color, | 3332 | xpm_alloc_color (Display *dpy, Colormap cmap, char *color_name, XColor *color, |
| 3333 | void *closure) | 3333 | void *closure) |
| 3334 | { | 3334 | { |
| 3335 | return xpm_lookup_color ((struct frame *) closure, color_name, color); | 3335 | return xpm_lookup_color (closure, color_name, color); |
| 3336 | } | 3336 | } |
| 3337 | 3337 | ||
| 3338 | 3338 | ||
| @@ -5652,8 +5652,7 @@ struct png_memory_storage | |||
| 5652 | static void | 5652 | static void |
| 5653 | png_read_from_memory (png_structp png_ptr, png_bytep data, png_size_t length) | 5653 | png_read_from_memory (png_structp png_ptr, png_bytep data, png_size_t length) |
| 5654 | { | 5654 | { |
| 5655 | struct png_memory_storage *tbr | 5655 | struct png_memory_storage *tbr = fn_png_get_io_ptr (png_ptr); |
| 5656 | = (struct png_memory_storage *) fn_png_get_io_ptr (png_ptr); | ||
| 5657 | 5656 | ||
| 5658 | if (length > tbr->len - tbr->index) | 5657 | if (length > tbr->len - tbr->index) |
| 5659 | fn_png_error (png_ptr, "Read error"); | 5658 | fn_png_error (png_ptr, "Read error"); |
| @@ -5670,7 +5669,7 @@ png_read_from_memory (png_structp png_ptr, png_bytep data, png_size_t length) | |||
| 5670 | static void | 5669 | static void |
| 5671 | png_read_from_file (png_structp png_ptr, png_bytep data, png_size_t length) | 5670 | png_read_from_file (png_structp png_ptr, png_bytep data, png_size_t length) |
| 5672 | { | 5671 | { |
| 5673 | FILE *fp = (FILE *) fn_png_get_io_ptr (png_ptr); | 5672 | FILE *fp = fn_png_get_io_ptr (png_ptr); |
| 5674 | 5673 | ||
| 5675 | if (fread (data, 1, length, fp) < length) | 5674 | if (fread (data, 1, length, fp) < length) |
| 5676 | fn_png_error (png_ptr, "Read error"); | 5675 | fn_png_error (png_ptr, "Read error"); |
| @@ -5814,9 +5813,9 @@ png_load_body (struct frame *f, struct image *img, struct png_load_context *c) | |||
| 5814 | 5813 | ||
| 5815 | /* Read image info. */ | 5814 | /* Read image info. */ |
| 5816 | if (!NILP (specified_data)) | 5815 | if (!NILP (specified_data)) |
| 5817 | fn_png_set_read_fn (png_ptr, (void *) &tbr, png_read_from_memory); | 5816 | fn_png_set_read_fn (png_ptr, &tbr, png_read_from_memory); |
| 5818 | else | 5817 | else |
| 5819 | fn_png_set_read_fn (png_ptr, (void *) fp, png_read_from_file); | 5818 | fn_png_set_read_fn (png_ptr, fp, png_read_from_file); |
| 5820 | 5819 | ||
| 5821 | fn_png_set_sig_bytes (png_ptr, sizeof sig); | 5820 | fn_png_set_sig_bytes (png_ptr, sizeof sig); |
| 5822 | fn_png_read_info (png_ptr, info_ptr); | 5821 | fn_png_read_info (png_ptr, info_ptr); |
| @@ -6306,7 +6305,7 @@ our_memory_fill_input_buffer (j_decompress_ptr cinfo) | |||
| 6306 | static void | 6305 | static void |
| 6307 | our_memory_skip_input_data (j_decompress_ptr cinfo, long int num_bytes) | 6306 | our_memory_skip_input_data (j_decompress_ptr cinfo, long int num_bytes) |
| 6308 | { | 6307 | { |
| 6309 | struct jpeg_source_mgr *src = (struct jpeg_source_mgr *) cinfo->src; | 6308 | struct jpeg_source_mgr *src = cinfo->src; |
| 6310 | 6309 | ||
| 6311 | if (src) | 6310 | if (src) |
| 6312 | { | 6311 | { |
| @@ -6326,19 +6325,17 @@ our_memory_skip_input_data (j_decompress_ptr cinfo, long int num_bytes) | |||
| 6326 | static void | 6325 | static void |
| 6327 | jpeg_memory_src (j_decompress_ptr cinfo, JOCTET *data, ptrdiff_t len) | 6326 | jpeg_memory_src (j_decompress_ptr cinfo, JOCTET *data, ptrdiff_t len) |
| 6328 | { | 6327 | { |
| 6329 | struct jpeg_source_mgr *src; | 6328 | struct jpeg_source_mgr *src = cinfo->src; |
| 6330 | 6329 | ||
| 6331 | if (cinfo->src == NULL) | 6330 | if (! src) |
| 6332 | { | 6331 | { |
| 6333 | /* First time for this JPEG object? */ | 6332 | /* First time for this JPEG object? */ |
| 6334 | cinfo->src = (struct jpeg_source_mgr *) | 6333 | src = cinfo->mem->alloc_small ((j_common_ptr) cinfo, |
| 6335 | (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, | 6334 | JPOOL_PERMANENT, sizeof *src); |
| 6336 | sizeof (struct jpeg_source_mgr)); | 6335 | cinfo->src = src; |
| 6337 | src = (struct jpeg_source_mgr *) cinfo->src; | ||
| 6338 | src->next_input_byte = data; | 6336 | src->next_input_byte = data; |
| 6339 | } | 6337 | } |
| 6340 | 6338 | ||
| 6341 | src = (struct jpeg_source_mgr *) cinfo->src; | ||
| 6342 | src->init_source = our_common_init_source; | 6339 | src->init_source = our_common_init_source; |
| 6343 | src->fill_input_buffer = our_memory_fill_input_buffer; | 6340 | src->fill_input_buffer = our_memory_fill_input_buffer; |
| 6344 | src->skip_input_data = our_memory_skip_input_data; | 6341 | src->skip_input_data = our_memory_skip_input_data; |
| @@ -6430,20 +6427,17 @@ our_stdio_skip_input_data (j_decompress_ptr cinfo, long int num_bytes) | |||
| 6430 | static void | 6427 | static void |
| 6431 | jpeg_file_src (j_decompress_ptr cinfo, FILE *fp) | 6428 | jpeg_file_src (j_decompress_ptr cinfo, FILE *fp) |
| 6432 | { | 6429 | { |
| 6433 | struct jpeg_stdio_mgr *src; | 6430 | struct jpeg_stdio_mgr *src = (struct jpeg_stdio_mgr *) cinfo->src; |
| 6434 | 6431 | ||
| 6435 | if (cinfo->src != NULL) | 6432 | if (! src) |
| 6436 | src = (struct jpeg_stdio_mgr *) cinfo->src; | ||
| 6437 | else | ||
| 6438 | { | 6433 | { |
| 6439 | /* First time for this JPEG object? */ | 6434 | /* First time for this JPEG object? */ |
| 6440 | cinfo->src = (struct jpeg_source_mgr *) | 6435 | src = cinfo->mem->alloc_small ((j_common_ptr) cinfo, |
| 6441 | (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, | 6436 | JPOOL_PERMANENT, sizeof *src); |
| 6442 | sizeof (struct jpeg_stdio_mgr)); | 6437 | cinfo->src = (struct jpeg_source_mgr *) src; |
| 6443 | src = (struct jpeg_stdio_mgr *) cinfo->src; | 6438 | src->buffer = cinfo->mem->alloc_small ((j_common_ptr) cinfo, |
| 6444 | src->buffer = (JOCTET *) | 6439 | JPOOL_PERMANENT, |
| 6445 | (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, | 6440 | JPEG_STDIO_BUFFER_SIZE); |
| 6446 | JPEG_STDIO_BUFFER_SIZE); | ||
| 6447 | } | 6441 | } |
| 6448 | 6442 | ||
| 6449 | src->file = fp; | 6443 | src->file = fp; |
| @@ -8120,7 +8114,7 @@ imagemagick_load_image (struct frame *f, struct image *img, | |||
| 8120 | 8114 | ||
| 8121 | /* Copy pixels from the imagemagick image structure to the x image map. */ | 8115 | /* Copy pixels from the imagemagick image structure to the x image map. */ |
| 8122 | iterator = NewPixelIterator (image_wand); | 8116 | iterator = NewPixelIterator (image_wand); |
| 8123 | if (iterator == (PixelIterator *) NULL) | 8117 | if (! iterator) |
| 8124 | { | 8118 | { |
| 8125 | #ifdef COLOR_TABLE_SUPPORT | 8119 | #ifdef COLOR_TABLE_SUPPORT |
| 8126 | free_color_table (); | 8120 | free_color_table (); |
| @@ -8135,7 +8129,7 @@ imagemagick_load_image (struct frame *f, struct image *img, | |||
| 8135 | for (y = 0; y < image_height; y++) | 8129 | for (y = 0; y < image_height; y++) |
| 8136 | { | 8130 | { |
| 8137 | pixels = PixelGetNextIteratorRow (iterator, &width); | 8131 | pixels = PixelGetNextIteratorRow (iterator, &width); |
| 8138 | if (pixels == (PixelWand **) NULL) | 8132 | if (! pixels) |
| 8139 | break; | 8133 | break; |
| 8140 | for (x = 0; x < (long) width; x++) | 8134 | for (x = 0; x < (long) width; x++) |
| 8141 | { | 8135 | { |
| @@ -9200,7 +9194,7 @@ A cross is always drawn on black & white displays. */); | |||
| 9200 | 9194 | ||
| 9201 | DEFVAR_LISP ("x-bitmap-file-path", Vx_bitmap_file_path, | 9195 | DEFVAR_LISP ("x-bitmap-file-path", Vx_bitmap_file_path, |
| 9202 | doc: /* List of directories to search for window system bitmap files. */); | 9196 | doc: /* List of directories to search for window system bitmap files. */); |
| 9203 | Vx_bitmap_file_path = decode_env_path ((char *) 0, PATH_BITMAPS); | 9197 | Vx_bitmap_file_path = decode_env_path (0, PATH_BITMAPS); |
| 9204 | 9198 | ||
| 9205 | DEFVAR_LISP ("image-cache-eviction-delay", Vimage_cache_eviction_delay, | 9199 | DEFVAR_LISP ("image-cache-eviction-delay", Vimage_cache_eviction_delay, |
| 9206 | doc: /* Maximum time after which images are removed from the cache. | 9200 | doc: /* Maximum time after which images are removed from the cache. |
diff --git a/src/keymap.c b/src/keymap.c index d13a6274347..7a18cd5d983 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -3249,8 +3249,7 @@ describe_map (Lisp_Object map, Lisp_Object prefix, | |||
| 3249 | for (tail = map; CONSP (tail); tail = XCDR (tail)) | 3249 | for (tail = map; CONSP (tail); tail = XCDR (tail)) |
| 3250 | length_needed++; | 3250 | length_needed++; |
| 3251 | 3251 | ||
| 3252 | vect = ((struct describe_map_elt *) | 3252 | vect = alloca (length_needed * sizeof *vect); |
| 3253 | alloca (sizeof (struct describe_map_elt) * length_needed)); | ||
| 3254 | 3253 | ||
| 3255 | for (tail = map; CONSP (tail); tail = XCDR (tail)) | 3254 | for (tail = map; CONSP (tail); tail = XCDR (tail)) |
| 3256 | { | 3255 | { |
diff --git a/src/nsfns.m b/src/nsfns.m index 3f43afde787..64db1b7fd0a 100644 --- a/src/nsfns.m +++ b/src/nsfns.m | |||
| @@ -2447,7 +2447,7 @@ Internal use only, use `display-monitor-attributes-list' instead. */) | |||
| 2447 | if (n_monitors == 0) | 2447 | if (n_monitors == 0) |
| 2448 | return Qnil; | 2448 | return Qnil; |
| 2449 | 2449 | ||
| 2450 | monitors = (struct MonitorInfo *) xzalloc (n_monitors * sizeof (*monitors)); | 2450 | monitors = xzalloc (n_monitors * sizeof *monitors); |
| 2451 | 2451 | ||
| 2452 | for (i = 0; i < [screens count]; ++i) | 2452 | for (i = 0; i < [screens count]; ++i) |
| 2453 | { | 2453 | { |
diff --git a/src/nsmenu.m b/src/nsmenu.m index 464be89c524..5b3c21424e9 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m | |||
| @@ -1665,7 +1665,7 @@ ns_popup_dialog (Lisp_Object position, Lisp_Object contents, Lisp_Object header) | |||
| 1665 | } | 1665 | } |
| 1666 | 1666 | ||
| 1667 | if (buttons > 0) | 1667 | if (buttons > 0) |
| 1668 | button_values = (Lisp_Object *) xmalloc (buttons * sizeof (*button_values)); | 1668 | button_values = xmalloc (buttons * sizeof *button_values); |
| 1669 | 1669 | ||
| 1670 | for (; XTYPE (list) == Lisp_Cons; list = XCDR (list)) | 1670 | for (; XTYPE (list) == Lisp_Cons; list = XCDR (list)) |
| 1671 | { | 1671 | { |
diff --git a/src/nsterm.m b/src/nsterm.m index 4a1c04ffb8f..d391d39fdaa 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -344,8 +344,8 @@ hold_event (struct input_event *event) | |||
| 344 | { | 344 | { |
| 345 | if (hold_event_q.cap == 0) hold_event_q.cap = 10; | 345 | if (hold_event_q.cap == 0) hold_event_q.cap = 10; |
| 346 | else hold_event_q.cap *= 2; | 346 | else hold_event_q.cap *= 2; |
| 347 | hold_event_q.q = (struct input_event *) | 347 | hold_event_q.q = |
| 348 | xrealloc (hold_event_q.q, hold_event_q.cap * sizeof (*hold_event_q.q)); | 348 | xrealloc (hold_event_q.q, hold_event_q.cap * sizeof *hold_event_q.q); |
| 349 | } | 349 | } |
| 350 | 350 | ||
| 351 | hold_event_q.q[hold_event_q.nr++] = *event; | 351 | hold_event_q.q[hold_event_q.nr++] = *event; |
diff --git a/src/process.c b/src/process.c index 85d07028c59..99c707ff97b 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -4526,7 +4526,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 4526 | #endif | 4526 | #endif |
| 4527 | (max (max_process_desc, max_input_desc) + 1, | 4527 | (max (max_process_desc, max_input_desc) + 1, |
| 4528 | &Available, | 4528 | &Available, |
| 4529 | (check_write ? &Writeok : (SELECT_TYPE *)0), | 4529 | (check_write ? &Writeok : 0), |
| 4530 | NULL, &timeout, NULL); | 4530 | NULL, &timeout, NULL); |
| 4531 | 4531 | ||
| 4532 | #ifdef HAVE_GNUTLS | 4532 | #ifdef HAVE_GNUTLS |
diff --git a/src/regex.c b/src/regex.c index 39adb080efd..06a9db2c55c 100644 --- a/src/regex.c +++ b/src/regex.c | |||
| @@ -468,7 +468,7 @@ init_syntax_once (void) | |||
| 468 | 468 | ||
| 469 | /* Assumes a `char *destination' variable. */ | 469 | /* Assumes a `char *destination' variable. */ |
| 470 | # define REGEX_REALLOCATE(source, osize, nsize) \ | 470 | # define REGEX_REALLOCATE(source, osize, nsize) \ |
| 471 | (destination = (char *) alloca (nsize), \ | 471 | (destination = alloca (nsize), \ |
| 472 | memcpy (destination, source, osize)) | 472 | memcpy (destination, source, osize)) |
| 473 | 473 | ||
| 474 | /* No need to do anything to free, after alloca. */ | 474 | /* No need to do anything to free, after alloca. */ |
| @@ -4208,7 +4208,7 @@ re_set_registers (struct re_pattern_buffer *bufp, struct re_registers *regs, uns | |||
| 4208 | { | 4208 | { |
| 4209 | bufp->regs_allocated = REGS_UNALLOCATED; | 4209 | bufp->regs_allocated = REGS_UNALLOCATED; |
| 4210 | regs->num_regs = 0; | 4210 | regs->num_regs = 0; |
| 4211 | regs->start = regs->end = (regoff_t *) 0; | 4211 | regs->start = regs->end = 0; |
| 4212 | } | 4212 | } |
| 4213 | } | 4213 | } |
| 4214 | WEAK_ALIAS (__re_set_registers, re_set_registers) | 4214 | WEAK_ALIAS (__re_set_registers, re_set_registers) |
| @@ -6395,8 +6395,7 @@ weak_function | |||
| 6395 | re_exec (const char *s) | 6395 | re_exec (const char *s) |
| 6396 | { | 6396 | { |
| 6397 | const size_t len = strlen (s); | 6397 | const size_t len = strlen (s); |
| 6398 | return (re_search (&re_comp_buf, s, len, 0, len, (struct re_registers *) 0) | 6398 | return re_search (&re_comp_buf, s, len, 0, len, 0) >= 0; |
| 6399 | >= 0); | ||
| 6400 | } | 6399 | } |
| 6401 | #endif /* _REGEX_RE_COMP */ | 6400 | #endif /* _REGEX_RE_COMP */ |
| 6402 | 6401 | ||
| @@ -6560,7 +6559,7 @@ regexec (const regex_t *_Restrict_ preg, const char *_Restrict_ string, | |||
| 6560 | /* Perform the searching operation. */ | 6559 | /* Perform the searching operation. */ |
| 6561 | ret = re_search (&private_preg, string, len, | 6560 | ret = re_search (&private_preg, string, len, |
| 6562 | /* start: */ 0, /* range: */ len, | 6561 | /* start: */ 0, /* range: */ len, |
| 6563 | want_reg_info ? ®s : (struct re_registers *) 0); | 6562 | want_reg_info ? ®s : 0); |
| 6564 | 6563 | ||
| 6565 | /* Copy the register information to the POSIX structure. */ | 6564 | /* Copy the register information to the POSIX structure. */ |
| 6566 | if (want_reg_info) | 6565 | if (want_reg_info) |
diff --git a/src/scroll.c b/src/scroll.c index 3e296068e8f..b9ed8c04ba8 100644 --- a/src/scroll.c +++ b/src/scroll.c | |||
| @@ -652,8 +652,7 @@ do_direct_scrolling (struct frame *frame, struct glyph_matrix *current_matrix, | |||
| 652 | 652 | ||
| 653 | /* A queue of deletions and insertions to be performed. */ | 653 | /* A queue of deletions and insertions to be performed. */ |
| 654 | struct alt_queue { int count, pos, window; }; | 654 | struct alt_queue { int count, pos, window; }; |
| 655 | struct alt_queue *queue_start = (struct alt_queue *) | 655 | struct alt_queue *queue_start = alloca (window_size * sizeof *queue_start); |
| 656 | alloca (window_size * sizeof *queue_start); | ||
| 657 | struct alt_queue *queue = queue_start; | 656 | struct alt_queue *queue = queue_start; |
| 658 | 657 | ||
| 659 | /* True if a terminal window has been set with set_terminal_window. */ | 658 | /* True if a terminal window has been set with set_terminal_window. */ |
| @@ -797,9 +796,8 @@ scrolling_1 (struct frame *frame, int window_size, int unchanged_at_top, | |||
| 797 | int unchanged_at_bottom, int *draw_cost, int *old_draw_cost, | 796 | int unchanged_at_bottom, int *draw_cost, int *old_draw_cost, |
| 798 | int *old_hash, int *new_hash, int free_at_end) | 797 | int *old_hash, int *new_hash, int free_at_end) |
| 799 | { | 798 | { |
| 800 | struct matrix_elt *matrix; | 799 | struct matrix_elt *matrix |
| 801 | matrix = ((struct matrix_elt *) | 800 | = alloca ((window_size + 1) * (window_size + 1) * sizeof *matrix); |
| 802 | alloca ((window_size + 1) * (window_size + 1) * sizeof *matrix)); | ||
| 803 | 801 | ||
| 804 | if (FRAME_SCROLL_REGION_OK (frame)) | 802 | if (FRAME_SCROLL_REGION_OK (frame)) |
| 805 | { | 803 | { |
diff --git a/src/termcap.c b/src/termcap.c index be05828eea6..aa225d9b3b1 100644 --- a/src/termcap.c +++ b/src/termcap.c | |||
| @@ -406,7 +406,7 @@ tgetent (char *bp, const char *name) | |||
| 406 | 406 | ||
| 407 | if (termcap_name && !filep && !strcmp (name, getenv ("TERM"))) | 407 | if (termcap_name && !filep && !strcmp (name, getenv ("TERM"))) |
| 408 | { | 408 | { |
| 409 | indirect = tgetst1 (find_capability (termcap_name, "tc"), (char **) 0); | 409 | indirect = tgetst1 (find_capability (termcap_name, "tc"), 0); |
| 410 | if (!indirect) | 410 | if (!indirect) |
| 411 | { | 411 | { |
| 412 | if (!bp) | 412 | if (!bp) |
| @@ -490,7 +490,7 @@ tgetent (char *bp, const char *name) | |||
| 490 | /* Does this entry refer to another terminal type's entry? | 490 | /* Does this entry refer to another terminal type's entry? |
| 491 | If something is found, copy it into heap and null-terminate it. */ | 491 | If something is found, copy it into heap and null-terminate it. */ |
| 492 | tc_search_point = find_capability (tc_search_point, "tc"); | 492 | tc_search_point = find_capability (tc_search_point, "tc"); |
| 493 | term = tgetst1 (tc_search_point, (char **) 0); | 493 | term = tgetst1 (tc_search_point, 0); |
| 494 | } | 494 | } |
| 495 | 495 | ||
| 496 | emacs_close (fd); | 496 | emacs_close (fd); |
diff --git a/src/window.c b/src/window.c index 8a514d64954..31b5b2717a4 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -1364,7 +1364,7 @@ struct check_window_data | |||
| 1364 | static int | 1364 | static int |
| 1365 | check_window_containing (struct window *w, void *user_data) | 1365 | check_window_containing (struct window *w, void *user_data) |
| 1366 | { | 1366 | { |
| 1367 | struct check_window_data *cw = (struct check_window_data *) user_data; | 1367 | struct check_window_data *cw = user_data; |
| 1368 | enum window_part found; | 1368 | enum window_part found; |
| 1369 | int continue_p = 1; | 1369 | int continue_p = 1; |
| 1370 | 1370 | ||
| @@ -2164,7 +2164,7 @@ delete_deletable_window (Lisp_Object window) | |||
| 2164 | static int | 2164 | static int |
| 2165 | add_window_to_list (struct window *w, void *user_data) | 2165 | add_window_to_list (struct window *w, void *user_data) |
| 2166 | { | 2166 | { |
| 2167 | Lisp_Object *list = (Lisp_Object *) user_data; | 2167 | Lisp_Object *list = user_data; |
| 2168 | Lisp_Object window; | 2168 | Lisp_Object window; |
| 2169 | XSETWINDOW (window, w); | 2169 | XSETWINDOW (window, w); |
| 2170 | *list = Fcons (window, *list); | 2170 | *list = Fcons (window, *list); |
| @@ -6481,7 +6481,7 @@ freeze_window_start (struct window *w, void *freeze_p) | |||
| 6481 | void | 6481 | void |
| 6482 | freeze_window_starts (struct frame *f, bool freeze_p) | 6482 | freeze_window_starts (struct frame *f, bool freeze_p) |
| 6483 | { | 6483 | { |
| 6484 | foreach_window (f, freeze_window_start, (void *) (freeze_p ? f : 0)); | 6484 | foreach_window (f, freeze_window_start, freeze_p ? f : 0); |
| 6485 | } | 6485 | } |
| 6486 | 6486 | ||
| 6487 | 6487 | ||
diff --git a/src/xdisp.c b/src/xdisp.c index 35abf71e5bf..67f4720e170 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -5508,8 +5508,8 @@ next_overlay_string (struct it *it) | |||
| 5508 | static int | 5508 | static int |
| 5509 | compare_overlay_entries (const void *e1, const void *e2) | 5509 | compare_overlay_entries (const void *e1, const void *e2) |
| 5510 | { | 5510 | { |
| 5511 | struct overlay_entry *entry1 = (struct overlay_entry *) e1; | 5511 | struct overlay_entry const *entry1 = e1; |
| 5512 | struct overlay_entry *entry2 = (struct overlay_entry *) e2; | 5512 | struct overlay_entry const *entry2 = e2; |
| 5513 | int result; | 5513 | int result; |
| 5514 | 5514 | ||
| 5515 | if (entry1->after_string_p != entry2->after_string_p) | 5515 | if (entry1->after_string_p != entry2->after_string_p) |
| @@ -9908,7 +9908,7 @@ vmessage (const char *m, va_list ap) | |||
| 9908 | ptrdiff_t maxsize = FRAME_MESSAGE_BUF_SIZE (f); | 9908 | ptrdiff_t maxsize = FRAME_MESSAGE_BUF_SIZE (f); |
| 9909 | char *message_buf = alloca (maxsize + 1); | 9909 | char *message_buf = alloca (maxsize + 1); |
| 9910 | 9910 | ||
| 9911 | len = doprnt (message_buf, maxsize, m, (char *)0, ap); | 9911 | len = doprnt (message_buf, maxsize, m, 0, ap); |
| 9912 | 9912 | ||
| 9913 | message3 (make_string (message_buf, len)); | 9913 | message3 (make_string (message_buf, len)); |
| 9914 | } | 9914 | } |
diff --git a/src/xfns.c b/src/xfns.c index 92a7964eb75..4f728ad59b0 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -2331,12 +2331,8 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only) | |||
| 2331 | /* maybe_set_screen_title_format (shell_widget); */ | 2331 | /* maybe_set_screen_title_format (shell_widget); */ |
| 2332 | 2332 | ||
| 2333 | pane_widget = lw_create_widget ("main", "pane", widget_id_tick++, | 2333 | pane_widget = lw_create_widget ("main", "pane", widget_id_tick++, |
| 2334 | (widget_value *) NULL, | 2334 | NULL, shell_widget, False, |
| 2335 | shell_widget, False, | 2335 | NULL, NULL, NULL, NULL); |
| 2336 | (lw_callback) NULL, | ||
| 2337 | (lw_callback) NULL, | ||
| 2338 | (lw_callback) NULL, | ||
| 2339 | (lw_callback) NULL); | ||
| 2340 | 2336 | ||
| 2341 | ac = 0; | 2337 | ac = 0; |
| 2342 | XtSetArg (al[ac], XtNvisual, FRAME_X_VISUAL (f)); ac++; | 2338 | XtSetArg (al[ac], XtNvisual, FRAME_X_VISUAL (f)); ac++; |
| @@ -2483,8 +2479,7 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only) | |||
| 2483 | */ | 2479 | */ |
| 2484 | XChangeProperty (XtDisplay (frame_widget), XtWindow (frame_widget), | 2480 | XChangeProperty (XtDisplay (frame_widget), XtWindow (frame_widget), |
| 2485 | FRAME_X_DISPLAY_INFO (f)->Xatom_wm_protocols, | 2481 | FRAME_X_DISPLAY_INFO (f)->Xatom_wm_protocols, |
| 2486 | XA_ATOM, 32, PropModeAppend, | 2482 | XA_ATOM, 32, PropModeAppend, NULL, 0); |
| 2487 | (unsigned char*) NULL, 0); | ||
| 2488 | 2483 | ||
| 2489 | /* Make all the standard events reach the Emacs frame. */ | 2484 | /* Make all the standard events reach the Emacs frame. */ |
| 2490 | attributes.event_mask = STANDARD_EVENT_SET; | 2485 | attributes.event_mask = STANDARD_EVENT_SET; |
| @@ -4009,7 +4004,7 @@ x_get_monitor_attributes_xinerama (struct x_display_info *dpyinfo) | |||
| 4009 | / x_display_pixel_width (dpyinfo)); | 4004 | / x_display_pixel_width (dpyinfo)); |
| 4010 | mm_height_per_pixel = ((double) HeightMMOfScreen (dpyinfo->screen) | 4005 | mm_height_per_pixel = ((double) HeightMMOfScreen (dpyinfo->screen) |
| 4011 | / x_display_pixel_height (dpyinfo)); | 4006 | / x_display_pixel_height (dpyinfo)); |
| 4012 | monitors = (struct MonitorInfo *) xzalloc (n_monitors * sizeof (*monitors)); | 4007 | monitors = xzalloc (n_monitors * sizeof *monitors); |
| 4013 | for (i = 0; i < n_monitors; ++i) | 4008 | for (i = 0; i < n_monitors; ++i) |
| 4014 | { | 4009 | { |
| 4015 | struct MonitorInfo *mi = &monitors[i]; | 4010 | struct MonitorInfo *mi = &monitors[i]; |
| @@ -4069,7 +4064,7 @@ x_get_monitor_attributes_xrandr (struct x_display_info *dpyinfo) | |||
| 4069 | return Qnil; | 4064 | return Qnil; |
| 4070 | } | 4065 | } |
| 4071 | n_monitors = resources->noutput; | 4066 | n_monitors = resources->noutput; |
| 4072 | monitors = (struct MonitorInfo *) xzalloc (n_monitors * sizeof (*monitors)); | 4067 | monitors = xzalloc (n_monitors * sizeof *monitors); |
| 4073 | 4068 | ||
| 4074 | #ifdef HAVE_XRRGETOUTPUTPRIMARY | 4069 | #ifdef HAVE_XRRGETOUTPUTPRIMARY |
| 4075 | pxid = XRRGetOutputPrimary (dpy, dpyinfo->root_window); | 4070 | pxid = XRRGetOutputPrimary (dpy, dpyinfo->root_window); |
| @@ -4225,7 +4220,7 @@ Internal use only, use `display-monitor-attributes-list' instead. */) | |||
| 4225 | #endif | 4220 | #endif |
| 4226 | n_monitors = gdk_screen_get_n_monitors (gscreen); | 4221 | n_monitors = gdk_screen_get_n_monitors (gscreen); |
| 4227 | monitor_frames = Fmake_vector (make_number (n_monitors), Qnil); | 4222 | monitor_frames = Fmake_vector (make_number (n_monitors), Qnil); |
| 4228 | monitors = (struct MonitorInfo *) xzalloc (n_monitors * sizeof (*monitors)); | 4223 | monitors = xzalloc (n_monitors * sizeof *monitors); |
| 4229 | 4224 | ||
| 4230 | FOR_EACH_FRAME (rest, frame) | 4225 | FOR_EACH_FRAME (rest, frame) |
| 4231 | { | 4226 | { |
| @@ -4463,8 +4458,7 @@ x_display_info_for_name (Lisp_Object name) | |||
| 4463 | 4458 | ||
| 4464 | validate_x_resource_name (); | 4459 | validate_x_resource_name (); |
| 4465 | 4460 | ||
| 4466 | dpyinfo = x_term_init (name, (char *)0, | 4461 | dpyinfo = x_term_init (name, 0, SSDATA (Vx_resource_name)); |
| 4467 | SSDATA (Vx_resource_name)); | ||
| 4468 | 4462 | ||
| 4469 | if (dpyinfo == 0) | 4463 | if (dpyinfo == 0) |
| 4470 | error ("Cannot connect to X server %s", SDATA (name)); | 4464 | error ("Cannot connect to X server %s", SDATA (name)); |
| @@ -4497,10 +4491,7 @@ terminate Emacs if we can't open the connection. | |||
| 4497 | error ("Not using X Windows"); /* That doesn't stop us anymore. */ | 4491 | error ("Not using X Windows"); /* That doesn't stop us anymore. */ |
| 4498 | #endif | 4492 | #endif |
| 4499 | 4493 | ||
| 4500 | if (! NILP (xrm_string)) | 4494 | xrm_option = NILP (xrm_string) ? 0 : SSDATA (xrm_string); |
| 4501 | xrm_option = SSDATA (xrm_string); | ||
| 4502 | else | ||
| 4503 | xrm_option = (char *) 0; | ||
| 4504 | 4495 | ||
| 4505 | validate_x_resource_name (); | 4496 | validate_x_resource_name (); |
| 4506 | 4497 | ||
| @@ -5724,8 +5715,8 @@ DEFUN ("x-uses-old-gtk-dialog", Fx_uses_old_gtk_dialog, | |||
| 5724 | static void | 5715 | static void |
| 5725 | file_dialog_cb (Widget widget, XtPointer client_data, XtPointer call_data) | 5716 | file_dialog_cb (Widget widget, XtPointer client_data, XtPointer call_data) |
| 5726 | { | 5717 | { |
| 5727 | int *result = (int *) client_data; | 5718 | int *result = client_data; |
| 5728 | XmAnyCallbackStruct *cb = (XmAnyCallbackStruct *) call_data; | 5719 | XmAnyCallbackStruct *cb = call_data; |
| 5729 | *result = cb->reason; | 5720 | *result = cb->reason; |
| 5730 | } | 5721 | } |
| 5731 | 5722 | ||
| @@ -5738,7 +5729,7 @@ file_dialog_cb (Widget widget, XtPointer client_data, XtPointer call_data) | |||
| 5738 | static void | 5729 | static void |
| 5739 | file_dialog_unmap_cb (Widget widget, XtPointer client_data, XtPointer call_data) | 5730 | file_dialog_unmap_cb (Widget widget, XtPointer client_data, XtPointer call_data) |
| 5740 | { | 5731 | { |
| 5741 | int *result = (int *) client_data; | 5732 | int *result = client_data; |
| 5742 | *result = XmCR_CANCEL; | 5733 | *result = XmCR_CANCEL; |
| 5743 | } | 5734 | } |
| 5744 | 5735 | ||
diff --git a/src/xfont.c b/src/xfont.c index f673adbbd5e..1aface6f972 100644 --- a/src/xfont.c +++ b/src/xfont.c | |||
| @@ -593,9 +593,7 @@ xfont_match (struct frame *f, Lisp_Object spec) | |||
| 593 | { | 593 | { |
| 594 | if (XGetFontProperty (xfont, XA_FONT, &value)) | 594 | if (XGetFontProperty (xfont, XA_FONT, &value)) |
| 595 | { | 595 | { |
| 596 | char *s; | 596 | char *s = XGetAtomName (display, (Atom) value); |
| 597 | |||
| 598 | s = (char *) XGetAtomName (display, (Atom) value); | ||
| 599 | 597 | ||
| 600 | /* If DXPC (a Differential X Protocol Compressor) | 598 | /* If DXPC (a Differential X Protocol Compressor) |
| 601 | Ver.3.7 is running, XGetAtomName will return null | 599 | Ver.3.7 is running, XGetAtomName will return null |
| @@ -760,7 +758,7 @@ xfont_open (struct frame *f, Lisp_Object entity, int pixel_size) | |||
| 760 | char *p0, *p; | 758 | char *p0, *p; |
| 761 | int dashes = 0; | 759 | int dashes = 0; |
| 762 | 760 | ||
| 763 | p0 = p = (char *) XGetAtomName (FRAME_X_DISPLAY (f), (Atom) value); | 761 | p0 = p = XGetAtomName (FRAME_X_DISPLAY (f), (Atom) value); |
| 764 | /* Count the number of dashes in the "full name". | 762 | /* Count the number of dashes in the "full name". |
| 765 | If it is too few, this isn't really the font's full name, | 763 | If it is too few, this isn't really the font's full name, |
| 766 | so don't use it. | 764 | so don't use it. |
diff --git a/src/xmenu.c b/src/xmenu.c index cad892444ff..95ae5393553 100644 --- a/src/xmenu.c +++ b/src/xmenu.c | |||
| @@ -373,7 +373,7 @@ x_menu_wait_for_event (void *data) | |||
| 373 | #elif defined USE_GTK | 373 | #elif defined USE_GTK |
| 374 | ! gtk_events_pending () | 374 | ! gtk_events_pending () |
| 375 | #else | 375 | #else |
| 376 | ! XPending ((Display*) data) | 376 | ! XPending (data) |
| 377 | #endif | 377 | #endif |
| 378 | ) | 378 | ) |
| 379 | { | 379 | { |
| @@ -722,8 +722,7 @@ menu_highlight_callback (GtkWidget *widget, gpointer call_data) | |||
| 722 | xg_menu_item_cb_data *cb_data; | 722 | xg_menu_item_cb_data *cb_data; |
| 723 | Lisp_Object help; | 723 | Lisp_Object help; |
| 724 | 724 | ||
| 725 | cb_data = (xg_menu_item_cb_data*) g_object_get_data (G_OBJECT (widget), | 725 | cb_data = g_object_get_data (G_OBJECT (widget), XG_ITEM_DATA); |
| 726 | XG_ITEM_DATA); | ||
| 727 | if (! cb_data) return; | 726 | if (! cb_data) return; |
| 728 | 727 | ||
| 729 | help = call_data ? cb_data->help : Qnil; | 728 | help = call_data ? cb_data->help : Qnil; |
| @@ -741,15 +740,11 @@ menu_highlight_callback (GtkWidget *widget, gpointer call_data) | |||
| 741 | static void | 740 | static void |
| 742 | menu_highlight_callback (Widget widget, LWLIB_ID id, void *call_data) | 741 | menu_highlight_callback (Widget widget, LWLIB_ID id, void *call_data) |
| 743 | { | 742 | { |
| 744 | struct frame *f; | 743 | widget_value *wv = call_data; |
| 745 | Lisp_Object help; | 744 | Lisp_Object help = wv ? wv->help : Qnil; |
| 746 | |||
| 747 | widget_value *wv = (widget_value *) call_data; | ||
| 748 | |||
| 749 | help = wv ? wv->help : Qnil; | ||
| 750 | 745 | ||
| 751 | /* Determine the frame for the help event. */ | 746 | /* Determine the frame for the help event. */ |
| 752 | f = menubar_id_to_frame (id); | 747 | struct frame *f = menubar_id_to_frame (id); |
| 753 | 748 | ||
| 754 | show_help_event (f, widget, help); | 749 | show_help_event (f, widget, help); |
| 755 | } | 750 | } |
| @@ -769,7 +764,7 @@ static int xg_crazy_callback_abort; | |||
| 769 | static void | 764 | static void |
| 770 | menubar_selection_callback (GtkWidget *widget, gpointer client_data) | 765 | menubar_selection_callback (GtkWidget *widget, gpointer client_data) |
| 771 | { | 766 | { |
| 772 | xg_menu_item_cb_data *cb_data = (xg_menu_item_cb_data*) client_data; | 767 | xg_menu_item_cb_data *cb_data = client_data; |
| 773 | 768 | ||
| 774 | if (xg_crazy_callback_abort) | 769 | if (xg_crazy_callback_abort) |
| 775 | return; | 770 | return; |
| @@ -1370,7 +1365,7 @@ struct next_popup_x_y | |||
| 1370 | static void | 1365 | static void |
| 1371 | menu_position_func (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer user_data) | 1366 | menu_position_func (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer user_data) |
| 1372 | { | 1367 | { |
| 1373 | struct next_popup_x_y* data = (struct next_popup_x_y*)user_data; | 1368 | struct next_popup_x_y *data = user_data; |
| 1374 | GtkRequisition req; | 1369 | GtkRequisition req; |
| 1375 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (data->f); | 1370 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (data->f); |
| 1376 | int disp_width = x_display_pixel_width (dpyinfo); | 1371 | int disp_width = x_display_pixel_width (dpyinfo); |
| @@ -1391,10 +1386,10 @@ menu_position_func (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer | |||
| 1391 | static void | 1386 | static void |
| 1392 | popup_selection_callback (GtkWidget *widget, gpointer client_data) | 1387 | popup_selection_callback (GtkWidget *widget, gpointer client_data) |
| 1393 | { | 1388 | { |
| 1394 | xg_menu_item_cb_data *cb_data = (xg_menu_item_cb_data*) client_data; | 1389 | xg_menu_item_cb_data *cb_data = client_data; |
| 1395 | 1390 | ||
| 1396 | if (xg_crazy_callback_abort) return; | 1391 | if (xg_crazy_callback_abort) return; |
| 1397 | if (cb_data) menu_item_selection = (Lisp_Object *) cb_data->call_data; | 1392 | if (cb_data) menu_item_selection = cb_data->call_data; |
| 1398 | } | 1393 | } |
| 1399 | 1394 | ||
| 1400 | static void | 1395 | static void |
| @@ -1497,7 +1492,7 @@ LWLIB_ID widget_id_tick; | |||
| 1497 | static void | 1492 | static void |
| 1498 | popup_selection_callback (Widget widget, LWLIB_ID id, XtPointer client_data) | 1493 | popup_selection_callback (Widget widget, LWLIB_ID id, XtPointer client_data) |
| 1499 | { | 1494 | { |
| 1500 | menu_item_selection = (Lisp_Object *) client_data; | 1495 | menu_item_selection = client_data; |
| 1501 | } | 1496 | } |
| 1502 | 1497 | ||
| 1503 | /* ARG is the LWLIB ID of the dialog box, represented | 1498 | /* ARG is the LWLIB ID of the dialog box, represented |
| @@ -1583,7 +1578,7 @@ create_and_show_popup_menu (struct frame *f, widget_value *first_wv, | |||
| 1583 | make_number (menu_id & ~(-1 << (fact))))); | 1578 | make_number (menu_id & ~(-1 << (fact))))); |
| 1584 | 1579 | ||
| 1585 | /* Process events that apply to the menu. */ | 1580 | /* Process events that apply to the menu. */ |
| 1586 | popup_get_selection ((XEvent *) 0, FRAME_X_DISPLAY_INFO (f), menu_id, 1); | 1581 | popup_get_selection (0, FRAME_X_DISPLAY_INFO (f), menu_id, 1); |
| 1587 | 1582 | ||
| 1588 | unbind_to (specpdl_count, Qnil); | 1583 | unbind_to (specpdl_count, Qnil); |
| 1589 | } | 1584 | } |
| @@ -1882,7 +1877,7 @@ dialog_selection_callback (GtkWidget *widget, gpointer client_data) | |||
| 1882 | /* Treat the pointer as an integer. There's no problem | 1877 | /* Treat the pointer as an integer. There's no problem |
| 1883 | as long as pointers have enough bits to hold small integers. */ | 1878 | as long as pointers have enough bits to hold small integers. */ |
| 1884 | if ((intptr_t) client_data != -1) | 1879 | if ((intptr_t) client_data != -1) |
| 1885 | menu_item_selection = (Lisp_Object *) client_data; | 1880 | menu_item_selection = client_data; |
| 1886 | 1881 | ||
| 1887 | popup_activated_flag = 0; | 1882 | popup_activated_flag = 0; |
| 1888 | } | 1883 | } |
| @@ -1924,7 +1919,7 @@ dialog_selection_callback (Widget widget, LWLIB_ID id, XtPointer client_data) | |||
| 1924 | /* Treat the pointer as an integer. There's no problem | 1919 | /* Treat the pointer as an integer. There's no problem |
| 1925 | as long as pointers have enough bits to hold small integers. */ | 1920 | as long as pointers have enough bits to hold small integers. */ |
| 1926 | if ((intptr_t) client_data != -1) | 1921 | if ((intptr_t) client_data != -1) |
| 1927 | menu_item_selection = (Lisp_Object *) client_data; | 1922 | menu_item_selection = client_data; |
| 1928 | 1923 | ||
| 1929 | block_input (); | 1924 | block_input (); |
| 1930 | lw_destroy_all_widgets (id); | 1925 | lw_destroy_all_widgets (id); |
| @@ -1967,8 +1962,7 @@ create_and_show_dialog (struct frame *f, widget_value *first_wv) | |||
| 1967 | Fcons (make_number (dialog_id >> (fact)), | 1962 | Fcons (make_number (dialog_id >> (fact)), |
| 1968 | make_number (dialog_id & ~(-1 << (fact))))); | 1963 | make_number (dialog_id & ~(-1 << (fact))))); |
| 1969 | 1964 | ||
| 1970 | popup_get_selection ((XEvent *) 0, FRAME_X_DISPLAY_INFO (f), | 1965 | popup_get_selection (0, FRAME_X_DISPLAY_INFO (f), dialog_id, 1); |
| 1971 | dialog_id, 1); | ||
| 1972 | 1966 | ||
| 1973 | unbind_to (count, Qnil); | 1967 | unbind_to (count, Qnil); |
| 1974 | } | 1968 | } |
diff --git a/src/xrdb.c b/src/xrdb.c index 6ef5c3bcb41..60dcdae080d 100644 --- a/src/xrdb.c +++ b/src/xrdb.c | |||
| @@ -596,7 +596,7 @@ x_get_string_resource (XrmDatabase rdb, const char *name, const char *class) | |||
| 596 | if (x_get_resource (rdb, name, class, x_rm_string, &value)) | 596 | if (x_get_resource (rdb, name, class, x_rm_string, &value)) |
| 597 | return (char *) value.addr; | 597 | return (char *) value.addr; |
| 598 | 598 | ||
| 599 | return (char *) 0; | 599 | return 0; |
| 600 | } | 600 | } |
| 601 | 601 | ||
| 602 | /* Stand-alone test facilities. */ | 602 | /* Stand-alone test facilities. */ |
| @@ -646,10 +646,7 @@ main (int argc, char **argv) | |||
| 646 | displayname = "localhost:0.0"; | 646 | displayname = "localhost:0.0"; |
| 647 | 647 | ||
| 648 | lp = member ("-xrm", arg_list); | 648 | lp = member ("-xrm", arg_list); |
| 649 | if (! NIL (lp)) | 649 | resource_string = NIL (lp) ? 0 : car (cdr (lp)); |
| 650 | resource_string = car (cdr (lp)); | ||
| 651 | else | ||
| 652 | resource_string = (char *) 0; | ||
| 653 | 650 | ||
| 654 | lp = member ("-c", arg_list); | 651 | lp = member ("-c", arg_list); |
| 655 | if (! NIL (lp)) | 652 | if (! NIL (lp)) |
diff --git a/src/xsmfns.c b/src/xsmfns.c index cb7122202df..526d4c3610b 100644 --- a/src/xsmfns.c +++ b/src/xsmfns.c | |||
| @@ -107,8 +107,7 @@ x_session_check_input (int fd, void *data) | |||
| 107 | will be called. */ | 107 | will be called. */ |
| 108 | emacs_event.kind = NO_EVENT; | 108 | emacs_event.kind = NO_EVENT; |
| 109 | 109 | ||
| 110 | ret = IceProcessMessages (SmcGetIceConnection (smc_conn), | 110 | ret = IceProcessMessages (SmcGetIceConnection (smc_conn), 0, 0); |
| 111 | (IceReplyWaitInfo *)0, (Bool *)0); | ||
| 112 | if (ret != IceProcessMessagesSuccess) | 111 | if (ret != IceProcessMessagesSuccess) |
| 113 | { | 112 | { |
| 114 | /* Either IO error or Connection closed. */ | 113 | /* Either IO error or Connection closed. */ |
diff --git a/src/xterm.c b/src/xterm.c index 55347a3310e..6f57836c9aa 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -1366,7 +1366,7 @@ x_draw_glyphless_glyph_string_foreground (struct glyph_string *s) | |||
| 1366 | } | 1366 | } |
| 1367 | else if (glyph->u.glyphless.method == GLYPHLESS_DISPLAY_HEX_CODE) | 1367 | else if (glyph->u.glyphless.method == GLYPHLESS_DISPLAY_HEX_CODE) |
| 1368 | { | 1368 | { |
| 1369 | sprintf ((char *) buf, "%0*X", | 1369 | sprintf (buf, "%0*X", |
| 1370 | glyph->u.glyphless.ch < 0x10000 ? 4 : 6, | 1370 | glyph->u.glyphless.ch < 0x10000 ? 4 : 6, |
| 1371 | glyph->u.glyphless.ch); | 1371 | glyph->u.glyphless.ch); |
| 1372 | str = buf; | 1372 | str = buf; |
| @@ -4328,8 +4328,8 @@ x_scroll_bar_to_input_event (XEvent *event, struct input_event *ievent) | |||
| 4328 | static void | 4328 | static void |
| 4329 | xm_scroll_callback (Widget widget, XtPointer client_data, XtPointer call_data) | 4329 | xm_scroll_callback (Widget widget, XtPointer client_data, XtPointer call_data) |
| 4330 | { | 4330 | { |
| 4331 | struct scroll_bar *bar = (struct scroll_bar *) client_data; | 4331 | struct scroll_bar *bar = client_data; |
| 4332 | XmScrollBarCallbackStruct *cs = (XmScrollBarCallbackStruct *) call_data; | 4332 | XmScrollBarCallbackStruct *cs = call_data; |
| 4333 | int part = -1, whole = 0, portion = 0; | 4333 | int part = -1, whole = 0, portion = 0; |
| 4334 | 4334 | ||
| 4335 | switch (cs->reason) | 4335 | switch (cs->reason) |
| @@ -4403,12 +4403,11 @@ xg_scroll_callback (GtkRange *range, | |||
| 4403 | gdouble value, | 4403 | gdouble value, |
| 4404 | gpointer user_data) | 4404 | gpointer user_data) |
| 4405 | { | 4405 | { |
| 4406 | struct scroll_bar *bar = (struct scroll_bar *) user_data; | 4406 | struct scroll_bar *bar = user_data; |
| 4407 | gdouble position; | 4407 | gdouble position; |
| 4408 | int part = -1, whole = 0, portion = 0; | 4408 | int part = -1, whole = 0, portion = 0; |
| 4409 | GtkAdjustment *adj = GTK_ADJUSTMENT (gtk_range_get_adjustment (range)); | 4409 | GtkAdjustment *adj = GTK_ADJUSTMENT (gtk_range_get_adjustment (range)); |
| 4410 | struct frame *f = (struct frame *) g_object_get_data (G_OBJECT (range), | 4410 | struct frame *f = g_object_get_data (G_OBJECT (range), XG_FRAME_DATA); |
| 4411 | XG_FRAME_DATA); | ||
| 4412 | 4411 | ||
| 4413 | if (xg_ignore_gtk_scrollbar) return FALSE; | 4412 | if (xg_ignore_gtk_scrollbar) return FALSE; |
| 4414 | position = gtk_adjustment_get_value (adj); | 4413 | position = gtk_adjustment_get_value (adj); |
| @@ -4463,7 +4462,7 @@ xg_end_scroll_callback (GtkWidget *widget, | |||
| 4463 | GdkEventButton *event, | 4462 | GdkEventButton *event, |
| 4464 | gpointer user_data) | 4463 | gpointer user_data) |
| 4465 | { | 4464 | { |
| 4466 | struct scroll_bar *bar = (struct scroll_bar *) user_data; | 4465 | struct scroll_bar *bar = user_data; |
| 4467 | bar->dragging = Qnil; | 4466 | bar->dragging = Qnil; |
| 4468 | if (WINDOWP (window_being_scrolled)) | 4467 | if (WINDOWP (window_being_scrolled)) |
| 4469 | { | 4468 | { |
| @@ -4486,8 +4485,9 @@ xg_end_scroll_callback (GtkWidget *widget, | |||
| 4486 | static void | 4485 | static void |
| 4487 | xaw_jump_callback (Widget widget, XtPointer client_data, XtPointer call_data) | 4486 | xaw_jump_callback (Widget widget, XtPointer client_data, XtPointer call_data) |
| 4488 | { | 4487 | { |
| 4489 | struct scroll_bar *bar = (struct scroll_bar *) client_data; | 4488 | struct scroll_bar *bar = client_data; |
| 4490 | float top = *(float *) call_data; | 4489 | float *top_addr = call_data; |
| 4490 | float top = *top_addr; | ||
| 4491 | float shown; | 4491 | float shown; |
| 4492 | int whole, portion, height; | 4492 | int whole, portion, height; |
| 4493 | int part; | 4493 | int part; |
| @@ -4528,9 +4528,9 @@ xaw_jump_callback (Widget widget, XtPointer client_data, XtPointer call_data) | |||
| 4528 | static void | 4528 | static void |
| 4529 | xaw_scroll_callback (Widget widget, XtPointer client_data, XtPointer call_data) | 4529 | xaw_scroll_callback (Widget widget, XtPointer client_data, XtPointer call_data) |
| 4530 | { | 4530 | { |
| 4531 | struct scroll_bar *bar = (struct scroll_bar *) client_data; | 4531 | struct scroll_bar *bar = client_data; |
| 4532 | /* The position really is stored cast to a pointer. */ | 4532 | /* The position really is stored cast to a pointer. */ |
| 4533 | int position = (long) call_data; | 4533 | int position = (intptr_t) call_data; |
| 4534 | Dimension height; | 4534 | Dimension height; |
| 4535 | int part; | 4535 | int part; |
| 4536 | 4536 | ||