diff options
| author | Jan Djärv | 2012-07-13 20:03:10 +0200 |
|---|---|---|
| committer | Jan Djärv | 2012-07-13 20:03:10 +0200 |
| commit | 0dc8cf5002ba3f79bf840de5b83c0f4f2e4e6279 (patch) | |
| tree | f30ab901e9631069f4c7b8a62a6b704a2e7c53d1 /src/nsmenu.m | |
| parent | b55b9f85db85737b365e32585542046b349c1f2e (diff) | |
| download | emacs-0dc8cf5002ba3f79bf840de5b83c0f4f2e4e6279.tar.gz emacs-0dc8cf5002ba3f79bf840de5b83c0f4f2e4e6279.zip | |
Remove compiler warnings in objective-C files.
* nsfns.m (x_set_icon_name, ns_set_name_internal)
(ns_set_name_as_filename, ns_implicitly_set_icon_type)
(x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
(Fns_get_resource, Fns_set_resource, Fx_open_connection)
(Fns_font_name, Fns_perform_service)
(Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
(Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
(ns_set_name): Remove unused variable view.
(x_set_menu_bar_lines): Remove unused variable olines.
(x_set_tool_bar_lines): Remove unused variable root_window.
(Fns_list_colors): Put () around assignment in while statement.
(Fns_perform_service): Remove unused variable len.
(Fns_display_usable_bounds): Remove unused variable top.
(syms_of_nsfns): Remove unused variable i.
* nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
(ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
where appropriate.
(ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
around assignment in loop statement.
(nsfont_open): Remove unused variable i.
(nsfont_open): Remove unused variable len.
(nsfont_draw): Remove unused variable cs.
* nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
appropriate.
(setXBMColor): Remove unused variable len.
(setPixmapData): Put () around assignment in loop statement.
* nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
(initFromContents): Use SSDATA where appropriate.
(ns_update_menubar): Add braces to ambigous if-else.
(initWithTitle): Put () around assignment in if statement.
(ns_menu_show): Remove unused variables window and keymap.
(update_frame_tool_bar): Remove unused variable selected_p.
(initWithContentRect): Remove unused variable this_cmd_name.
* nsterm.h (menuDown): Add id as type to argument sender.
(ns_display_info_for_name): Add Lisp_Object argument.
(ns_term_init): Add Lisp_Object argument.
(ns_map_event_to_object): Add void argument.
(ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
prototype with arguments and only declare if __OBJC__.
(nxatoms_of_nsselect): Add void argument.
(ns_lisp_to_cursor_type): Add Lisp_Object argument.
(ns_alloc_autorelease_pool): Add void argument.
(ns_release_autorelease_pool): Add void* argument.
(ns_get_defaults_value): Add const char* argument.
* nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
(x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
(ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
(ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
where appropriate.
(ns_exec_path, ns_load_path, changeFont): Put () around assignment used
as boolean expression.
(x_set_window_size): Remove unused variable toolbar.
(ns_get_color_default, ns_mod_to_lisp): Remove.
(ns_mouse_position): Remove unused variables xchar and ychar.
(ns_compute_glyph_string_overhangs): Remove unused variable face.
(ns_set_vertical_scroll_bar): Remove unused variable count.
(ns_delete_terminal): Remove unused variable i.
(ns_term_init): Remove unused variables r, g and b.
(mouseDown): Remove unused variable window.
(windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
(initFrameFromEmacs): Remove unused variable vbextra.
(mouseEntered): Remove unused variables p and dpyinfo.
(mouseExited): Remove unused variables p and r.
(ns_define_frame_cursor, ns_clear_frame_area)
(ns_draw_window_cursor, ns_initialize_display_info): Make static.
(menuDown): Assign [sender tag] to variable and cast the variable.
Diffstat (limited to 'src/nsmenu.m')
| -rw-r--r-- | src/nsmenu.m | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/nsmenu.m b/src/nsmenu.m index f3bd9dd3ecb..c919f350c6c 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m | |||
| @@ -249,7 +249,7 @@ ns_update_menubar (struct frame *f, int deep_p, EmacsMenu *submenu) | |||
| 249 | /* FIXME: we'd like to only parse the needed submenu, but this | 249 | /* FIXME: we'd like to only parse the needed submenu, but this |
| 250 | was causing crashes in the _common parsing code.. need to make | 250 | was causing crashes in the _common parsing code.. need to make |
| 251 | sure proper initialization done.. */ | 251 | sure proper initialization done.. */ |
| 252 | /* if (submenu && strcmp (submenuTitle, SDATA (string))) | 252 | /* if (submenu && strcmp (submenuTitle, SSDATA (string))) |
| 253 | continue; */ | 253 | continue; */ |
| 254 | 254 | ||
| 255 | submenu_start[i] = menu_items_used; | 255 | submenu_start[i] = menu_items_used; |
| @@ -318,8 +318,8 @@ ns_update_menubar (struct frame *f, int deep_p, EmacsMenu *submenu) | |||
| 318 | if (!EQ (previous_items[i], AREF (menu_items, i))) | 318 | if (!EQ (previous_items[i], AREF (menu_items, i))) |
| 319 | if (!(STRINGP (previous_items[i]) | 319 | if (!(STRINGP (previous_items[i]) |
| 320 | && STRINGP (AREF (menu_items, i)) | 320 | && STRINGP (AREF (menu_items, i)) |
| 321 | && !strcmp (SDATA (previous_items[i]), | 321 | && !strcmp (SSDATA (previous_items[i]), |
| 322 | SDATA (AREF (menu_items, i))))) | 322 | SSDATA (AREF (menu_items, i))))) |
| 323 | break; | 323 | break; |
| 324 | if (i == previous_menu_items_used) | 324 | if (i == previous_menu_items_used) |
| 325 | { | 325 | { |
| @@ -356,7 +356,7 @@ ns_update_menubar (struct frame *f, int deep_p, EmacsMenu *submenu) | |||
| 356 | string = AREF (items, i + 1); | 356 | string = AREF (items, i + 1); |
| 357 | if (NILP (string)) | 357 | if (NILP (string)) |
| 358 | break; | 358 | break; |
| 359 | /* if (submenu && strcmp (submenuTitle, SDATA (string))) | 359 | /* if (submenu && strcmp (submenuTitle, SSDATA (string))) |
| 360 | continue; */ | 360 | continue; */ |
| 361 | 361 | ||
| 362 | wv->name = SSDATA (string); | 362 | wv->name = SSDATA (string); |
| @@ -422,11 +422,13 @@ ns_update_menubar (struct frame *f, int deep_p, EmacsMenu *submenu) | |||
| 422 | if (EQ (string, make_number (0))) // FIXME: Why??? --Stef | 422 | if (EQ (string, make_number (0))) // FIXME: Why??? --Stef |
| 423 | continue; | 423 | continue; |
| 424 | if (NILP (string)) | 424 | if (NILP (string)) |
| 425 | if (previous_strings[i][0]) | 425 | { |
| 426 | break; | 426 | if (previous_strings[i][0]) |
| 427 | else | 427 | break; |
| 428 | continue; | 428 | else |
| 429 | if (memcmp (previous_strings[i], SDATA (string), | 429 | continue; |
| 430 | } | ||
| 431 | else if (memcmp (previous_strings[i], SDATA (string), | ||
| 430 | min (10, SBYTES (string) + 1))) | 432 | min (10, SBYTES (string) + 1))) |
| 431 | break; | 433 | break; |
| 432 | } | 434 | } |
| @@ -528,7 +530,7 @@ set_frame_menubar (struct frame *f, int first_time, int deep_p) | |||
| 528 | /* override designated initializer */ | 530 | /* override designated initializer */ |
| 529 | - initWithTitle: (NSString *)title | 531 | - initWithTitle: (NSString *)title |
| 530 | { | 532 | { |
| 531 | if (self = [super initWithTitle: title]) | 533 | if ((self = [super initWithTitle: title])) |
| 532 | [self setAutoenablesItems: NO]; | 534 | [self setAutoenablesItems: NO]; |
| 533 | return self; | 535 | return self; |
| 534 | } | 536 | } |
| @@ -793,7 +795,7 @@ ns_menu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps, | |||
| 793 | { | 795 | { |
| 794 | EmacsMenu *pmenu; | 796 | EmacsMenu *pmenu; |
| 795 | NSPoint p; | 797 | NSPoint p; |
| 796 | Lisp_Object window, tem, keymap; | 798 | Lisp_Object tem; |
| 797 | ptrdiff_t specpdl_count = SPECPDL_INDEX (); | 799 | ptrdiff_t specpdl_count = SPECPDL_INDEX (); |
| 798 | widget_value *wv, *first_wv = 0; | 800 | widget_value *wv, *first_wv = 0; |
| 799 | 801 | ||
| @@ -990,7 +992,7 @@ ns_menu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps, | |||
| 990 | } | 992 | } |
| 991 | 993 | ||
| 992 | pmenu = [[EmacsMenu alloc] initWithTitle: | 994 | pmenu = [[EmacsMenu alloc] initWithTitle: |
| 993 | [NSString stringWithUTF8String: SDATA (title)]]; | 995 | [NSString stringWithUTF8String: SSDATA (title)]]; |
| 994 | [pmenu fillWithWidgetValue: first_wv->contents]; | 996 | [pmenu fillWithWidgetValue: first_wv->contents]; |
| 995 | free_menubar_widget_value_tree (first_wv); | 997 | free_menubar_widget_value_tree (first_wv); |
| 996 | unbind_to (specpdl_count, Qnil); | 998 | unbind_to (specpdl_count, Qnil); |
| @@ -1043,7 +1045,6 @@ update_frame_tool_bar (FRAME_PTR f) | |||
| 1043 | i * TOOL_BAR_ITEM_NSLOTS + (IDX)) | 1045 | i * TOOL_BAR_ITEM_NSLOTS + (IDX)) |
| 1044 | 1046 | ||
| 1045 | BOOL enabled_p = !NILP (TOOLPROP (TOOL_BAR_ITEM_ENABLED_P)); | 1047 | BOOL enabled_p = !NILP (TOOLPROP (TOOL_BAR_ITEM_ENABLED_P)); |
| 1046 | BOOL selected_p = !NILP (TOOLPROP (TOOL_BAR_ITEM_SELECTED_P)); | ||
| 1047 | int idx; | 1048 | int idx; |
| 1048 | ptrdiff_t img_id; | 1049 | ptrdiff_t img_id; |
| 1049 | struct image *img; | 1050 | struct image *img; |
| @@ -1473,7 +1474,6 @@ ns_popup_dialog (Lisp_Object position, Lisp_Object contents, Lisp_Object header) | |||
| 1473 | { | 1474 | { |
| 1474 | NSSize spacing = {SPACER, SPACER}; | 1475 | NSSize spacing = {SPACER, SPACER}; |
| 1475 | NSRect area; | 1476 | NSRect area; |
| 1476 | char this_cmd_name[80]; | ||
| 1477 | id cell; | 1477 | id cell; |
| 1478 | static NSImageView *imgView; | 1478 | static NSImageView *imgView; |
| 1479 | static FlippedView *contentView; | 1479 | static FlippedView *contentView; |
| @@ -1581,11 +1581,11 @@ void process_dialog (id window, Lisp_Object list) | |||
| 1581 | item = XCAR (list); | 1581 | item = XCAR (list); |
| 1582 | if (XTYPE (item) == Lisp_String) | 1582 | if (XTYPE (item) == Lisp_String) |
| 1583 | { | 1583 | { |
| 1584 | [window addString: SDATA (item) row: row++]; | 1584 | [window addString: SSDATA (item) row: row++]; |
| 1585 | } | 1585 | } |
| 1586 | else if (XTYPE (item) == Lisp_Cons) | 1586 | else if (XTYPE (item) == Lisp_Cons) |
| 1587 | { | 1587 | { |
| 1588 | [window addButton: SDATA (XCAR (item)) | 1588 | [window addButton: SSDATA (XCAR (item)) |
| 1589 | value: XCDR (item) row: row++]; | 1589 | value: XCDR (item) row: row++]; |
| 1590 | } | 1590 | } |
| 1591 | else if (NILP (item)) | 1591 | else if (NILP (item)) |
| @@ -1675,7 +1675,7 @@ void process_dialog (id window, Lisp_Object list) | |||
| 1675 | 1675 | ||
| 1676 | if (XTYPE (head) == Lisp_String) | 1676 | if (XTYPE (head) == Lisp_String) |
| 1677 | [title setStringValue: | 1677 | [title setStringValue: |
| 1678 | [NSString stringWithUTF8String: SDATA (head)]]; | 1678 | [NSString stringWithUTF8String: SSDATA (head)]]; |
| 1679 | else if (isQ == YES) | 1679 | else if (isQ == YES) |
| 1680 | [title setStringValue: @"Question"]; | 1680 | [title setStringValue: @"Question"]; |
| 1681 | else | 1681 | else |