mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-06-14 12:31:25 +00:00
GCC 16’s -Wuseless-cast warning can be useful. Fix the useless casts it identifies, and also fix false positives by using compound literals, which are safer anyway than casts. * src/composite.c (composition_adjust_point) (Ffind_composition_internal): * lwlib/xlwmenu.c (xlwMenuResources, xlwMenuClassRec) (resource_widget_value, XlwMenuDestroy, Select): * src/alloc.c (process_mark_stack): * src/data.c (Faref): * src/emacs-module.c (module_extract_big_integer): * src/fileio.c (Finsert_file_contents): * src/frame.h (FRAME_MESSAGE_BUF_SIZE): * src/gtkutil.c (xg_tool_item_stale_p, update_frame_tool_bar): * src/image.c (pbm_load, png_load_body, jpeg_load_body) (tiff_load, gif_load): * src/pdumper.c (ptrdiff_t_to_dump_off, dump_queue_dequeue) (field_relpos, dump_field_emacs_ptr) (dump_object_start_pseudovector, pdumper_remember_scalar_impl) (pdumper_load, syms_of_pdumper): * src/regex-emacs.c (BUF_PUSH, BUF_PUSH_2, POINTER_TO_OFFSET): * src/xdisp.c (remember_mouse_glyph, pint2str): * src/xterm.c (cvt_string_to_pixel, handle_one_xevent): Omit useless casts. Perhaps they were formerly needed, but they should not be needed now. * src/alloc.c (Fmemory_info): * src/category.c (Fdefine_category, Fmodify_category_entry): * src/data.c (Fash): * src/dispextern.h (GLYPH_CODE_P): * src/emacs.c (load_seccomp): * src/fns.c (Flocale_info, maybe_resize_hash_table): * src/indent.c (check_display_width): * src/json.c (symset_size): * src/lisp.h (XUNTAG, BOOL_VECTOR_LENGTH_MAX, obarray_size) (hash_table_index_size): * src/lread.c (make_obarray, grow_obarray, Fobarray_clear): * src/menu.c (digest_single_submenu, x_popup_menu_1): * src/term.c (init_tty): * src/widget.c (update_wm_hints): * src/xdisp.c (truncate_echo_area): * src/xfns.c (x_set_border_pixel): * src/xfont.c (xfont_match, xfont_open): * src/xmenu.c (set_frame_menubar): * test/src/emacs-module-resources/mod-test.c (emacs_module_init): Use compound literal instead of a cast that is useless in some platforms but not others. * src/dispextern.h, src/haikugui.h, src/w32gui.h: (WINDOW_HANDLE_UINTPTR): New macro. * src/frame.c (gui_report_frame_params): * src/xterm.c (x_try_cr_xlib_drawable): Use it. * src/lisp.h (XUNTAG): And tag with UINTPTR_MAX to pacify gcc warning about a constant out of range. (hash_idx_t): Make it int_least32_t, as it need not be exactly 32 bits. (PRIdHASH_IDX): New macro. * src/pdumper.c (dump_queue_dequeue): Use it. * src/profiler.c (setup_cpu_timer): Make a local EMACS_INT rather than int, to avoid need for casting later. * src/syntax.c (uninitialized_interval): Use 1u rather than 1 so the cast is always useful. A compound literal wouldn’t do here, as this macro needs to be an integer constant expression. * src/xfns.c (XICCallback, XICProc): Remove macros. (Xxic_preedit_start_callback): Use a cleaner way to specify it, avoiding the need for type macros, and for a cast if HAVE_XICCALLBACK_CALLBACK. * src/xterm.c (handle_one_xevent): 2nd arg is now XEvent * on all platforms, as there is no need to diverge, and diverging meant we needed lots of unnecessary casts. |
||
|---|---|---|
| .. | ||
| comp-resources | ||
| emacs-module-resources | ||
| lread-resources | ||
| regex-resources | ||
| syntax-resources | ||
| alloc-tests.el | ||
| buffer-tests.el | ||
| callint-tests.el | ||
| callproc-tests.el | ||
| casefiddle-tests.el | ||
| character-tests.el | ||
| charset-tests.el | ||
| chartab-tests.el | ||
| cmds-tests.el | ||
| coding-tests.el | ||
| comp-tests.el | ||
| data-tests.el | ||
| decompress-tests.el | ||
| doc-tests.el | ||
| editfns-tests.el | ||
| emacs-module-tests.el | ||
| emacs-tests.el | ||
| eval-tests.el | ||
| fileio-tests.el | ||
| filelock-tests.el | ||
| floatfns-tests.el | ||
| fns-tests.el | ||
| font-tests.el | ||
| image-tests.el | ||
| indent-tests.el | ||
| inotify-tests.el | ||
| json-tests.el | ||
| keyboard-tests.el | ||
| keymap-tests.el | ||
| lcms-tests.el | ||
| lread-tests.el | ||
| marker-tests.el | ||
| minibuf-tests.el | ||
| print-tests.el | ||
| process-tests.el | ||
| profiler-tests.el | ||
| regex-emacs-tests.el | ||
| search-tests.el | ||
| sqlite-tests.el | ||
| syntax-tests.el | ||
| terminal-tests.el | ||
| textprop-tests.el | ||
| thread-tests.el | ||
| timefns-tests.el | ||
| treesit-tests.el | ||
| undo-tests.el | ||
| xdisp-tests.el | ||
| xfaces-tests.el | ||
| xml-tests.el | ||