• Paul Eggert's avatar
    Fix problems found by static checking --with-ns · 3c2c5026
    Paul Eggert authored
    This is for Fedora 24 when configured with --enable-gcc-warnings.
    Although it does not fix all the problems, it fixes many of them.
    * src/frame.c (XParseGeometry):
    * src/nsterm.m (mouseDown:):
    Mark locals with UNINIT to pacify --enable-gcc-warnings.
    * src/image.c (PIX_MASK_DRAW, DefaultDepthOfScreen):
    Remove unused macros.
    (slurp_file xbm_scan, xbm_read_bitmap_data, xbm_load_image)
    (xbm_file_p, xbm_load, xpm_scan, xpm_make_color_table_v)
    (xpm_put_color_table_v, xpm_get_color_table_v)
    (xpm_make_color_table_h, xpm_put_color_table_h)
    (xpm_get_color_table_h, xpm_load_image, xpm_load)
    (pbm_next_char, pbm_scan_number, pbm_load, svg_load)
    (svg_load_image):
    * src/nsfns.m (x_get_string_resource):
    * src/nsimage.m (ns_image_from_XBM):
    Fix pointer signedness problems.
    * src/image.c (xpm_load_image, x_build_heuristic_mask, pbm_load)
    (imagemagick_load_image): Omit unused locals.
    * src/nsfns.m (ns_send_types, ns_return_types, ns_drag_types)
    (Fx_open_connection):
    * src/nsfont.m (ns_antialias_threshold):
    Move extern decl to nsterm.h so it can be checked.
    * src/nsmenu.m (svcsMenu, dockMenu):
    Move to the only file that uses them, so they can be static.
    * src/nsterm.h (find_and_call_menu_selection):
    * src/nsterm.m (x_set_frame_alpha):
    Omit duplicate decls.
    * src/nsterm.h (ns_dump_glyphstring): Mark as EXTERNALLY_VISIBLE.
    * src/nsfns.m (ns_tooltip, ns_display_info_for_name)
    (ns_set_name_as_filename, x_set_menu_bar_lines)
    (x_set_tool_bar_lines, x_set_internal_border_width):
    * src/nsterm.m (ns_drag_types, ns_draw_text_decoration):
    Now static.
    * src/nsfns.m (ns_lisp_to_cursor_type, ns_cursor_type_to_lisp):
    * src/nsterm.m (ns_free_indexed_color, ns_color_to_lisp):
    Remove; unused.
    * src/nsfont.m (ns_dump_glyphstring):
    * src/nsterm.m (hide_bell, ns_get_color, ns_color_to_lisp)
    (ns_clear_frame, keyDown:):
    Fix signedness problem with printf arg.
    * src/nsterm.h (ns_input_events, ns_finish_events):
    * src/nsterm.m (ns_finish_events, hide_bell):
    Prototype the decls.
    * src/nsterm.m (NSMenuDidBeginTrackingNotification):
    Omit unnecessary decl.
    (dockMenu):
    (mainMenu) [NS_IMPL_COCOA]: Now static, and in this file.
    (ns_dumpglyphs_box_or_relief, changeFont:, initFrameFromEmacs:)
    (toggleFullScreen:): Use FACE_FROM_ID instead of
    FACE_FROM_ID_OR_NULL in contexts where the caller expects the
    result to be non-null.
    (applicationShouldTerminate:): Fix misleading indentation.
    3c2c5026
frame.c 167 KB