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/nsfont.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/nsfont.m')
| -rw-r--r-- | src/nsfont.m | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/src/nsfont.m b/src/nsfont.m index 7a44182a93e..6f9294e082a 100644 --- a/src/nsfont.m +++ b/src/nsfont.m | |||
| @@ -100,7 +100,7 @@ ns_get_family (Lisp_Object font_spec) | |||
| 100 | return nil; | 100 | return nil; |
| 101 | else | 101 | else |
| 102 | { | 102 | { |
| 103 | char *tmp = xstrdup (SDATA (SYMBOL_NAME (tem))); | 103 | char *tmp = xstrdup (SSDATA (SYMBOL_NAME (tem))); |
| 104 | NSString *family; | 104 | NSString *family; |
| 105 | ns_unescape_name (tmp); | 105 | ns_unescape_name (tmp); |
| 106 | family = [NSString stringWithUTF8String: tmp]; | 106 | family = [NSString stringWithUTF8String: tmp]; |
| @@ -293,13 +293,13 @@ ns_charset_covers(NSCharacterSet *set1, NSCharacterSet *set2, float pct) | |||
| 293 | static NSString | 293 | static NSString |
| 294 | *ns_lang_to_script (Lisp_Object lang) | 294 | *ns_lang_to_script (Lisp_Object lang) |
| 295 | { | 295 | { |
| 296 | if (!strcmp (SDATA (SYMBOL_NAME (lang)), "ja")) | 296 | if (!strcmp (SSDATA (SYMBOL_NAME (lang)), "ja")) |
| 297 | return @"han"; | 297 | return @"han"; |
| 298 | /* NOTE: ja given for any hanzi that's also a kanji, but Chinese fonts | 298 | /* NOTE: ja given for any hanzi that's also a kanji, but Chinese fonts |
| 299 | have more characters. */ | 299 | have more characters. */ |
| 300 | else if (!strcmp (SDATA (SYMBOL_NAME (lang)), "zh")) | 300 | else if (!strcmp (SSDATA (SYMBOL_NAME (lang)), "zh")) |
| 301 | return @"han"; | 301 | return @"han"; |
| 302 | else if (!strcmp (SDATA (SYMBOL_NAME (lang)), "ko")) | 302 | else if (!strcmp (SSDATA (SYMBOL_NAME (lang)), "ko")) |
| 303 | return @"hangul"; | 303 | return @"hangul"; |
| 304 | else | 304 | else |
| 305 | return @""; | 305 | return @""; |
| @@ -313,7 +313,7 @@ static NSString | |||
| 313 | { | 313 | { |
| 314 | Lisp_Object script = assq_no_quit (XCAR (otf), Votf_script_alist); | 314 | Lisp_Object script = assq_no_quit (XCAR (otf), Votf_script_alist); |
| 315 | return CONSP (script) | 315 | return CONSP (script) |
| 316 | ? [NSString stringWithUTF8String: SDATA (SYMBOL_NAME (XCDR ((script))))] | 316 | ? [NSString stringWithUTF8String: SSDATA (SYMBOL_NAME (XCDR ((script))))] |
| 317 | : @""; | 317 | : @""; |
| 318 | } | 318 | } |
| 319 | 319 | ||
| @@ -326,10 +326,10 @@ static NSString | |||
| 326 | while CONSP (rts) | 326 | while CONSP (rts) |
| 327 | { | 327 | { |
| 328 | r = XCAR (XCAR (rts)); | 328 | r = XCAR (XCAR (rts)); |
| 329 | if (!strncmp(SDATA(r), reg, strlen(SDATA(r)))) | 329 | if (!strncmp(SSDATA(r), reg, strlen(SSDATA(r)))) |
| 330 | { | 330 | { |
| 331 | script = XCDR (XCAR (rts)); | 331 | script = XCDR (XCAR (rts)); |
| 332 | return [NSString stringWithUTF8String: SDATA (SYMBOL_NAME (script))]; | 332 | return [NSString stringWithUTF8String: SSDATA (SYMBOL_NAME (script))]; |
| 333 | } | 333 | } |
| 334 | rts = XCDR (rts); | 334 | rts = XCDR (rts); |
| 335 | } | 335 | } |
| @@ -355,7 +355,7 @@ static NSString | |||
| 355 | Lisp_Object key = XCAR (tmp), val = XCDR (tmp); | 355 | Lisp_Object key = XCAR (tmp), val = XCDR (tmp); |
| 356 | if (EQ (key, QCscript) && SYMBOLP (val)) | 356 | if (EQ (key, QCscript) && SYMBOLP (val)) |
| 357 | return [NSString stringWithUTF8String: | 357 | return [NSString stringWithUTF8String: |
| 358 | SDATA (SYMBOL_NAME (val))]; | 358 | SSDATA (SYMBOL_NAME (val))]; |
| 359 | if (EQ (key, QClang) && SYMBOLP (val)) | 359 | if (EQ (key, QClang) && SYMBOLP (val)) |
| 360 | return ns_lang_to_script (val); | 360 | return ns_lang_to_script (val); |
| 361 | if (EQ (key, QCotf) && CONSP (val) && SYMBOLP (XCAR (val))) | 361 | if (EQ (key, QCotf) && CONSP (val) && SYMBOLP (XCAR (val))) |
| @@ -373,7 +373,7 @@ static NSString | |||
| 373 | if (EQ (reg, Qiso10646_1)) | 373 | if (EQ (reg, Qiso10646_1)) |
| 374 | reg = Qiso8859_1; | 374 | reg = Qiso8859_1; |
| 375 | #endif | 375 | #endif |
| 376 | return ns_registry_to_script (SDATA (SYMBOL_NAME (reg))); | 376 | return ns_registry_to_script (SSDATA (SYMBOL_NAME (reg))); |
| 377 | } | 377 | } |
| 378 | 378 | ||
| 379 | return @""; | 379 | return @""; |
| @@ -464,7 +464,7 @@ static NSSet | |||
| 464 | while (1) | 464 | while (1) |
| 465 | { | 465 | { |
| 466 | NSEnumerator *allFamiliesEnum = [allFamilies objectEnumerator]; | 466 | NSEnumerator *allFamiliesEnum = [allFamilies objectEnumerator]; |
| 467 | while (family = [allFamiliesEnum nextObject]) | 467 | while ((family = [allFamiliesEnum nextObject])) |
| 468 | { | 468 | { |
| 469 | NSCharacterSet *fset = [[fontMgr fontWithFamily: family | 469 | NSCharacterSet *fset = [[fontMgr fontWithFamily: family |
| 470 | traits: 0 weight: 5 size: 12.0] coveredCharacterSet]; | 470 | traits: 0 weight: 5 size: 12.0] coveredCharacterSet]; |
| @@ -528,7 +528,7 @@ ns_findfonts (Lisp_Object font_spec, BOOL isMatch) | |||
| 528 | NSLog(@"Got desc %@ and found %d matching fonts from it: ", fdesc, | 528 | NSLog(@"Got desc %@ and found %d matching fonts from it: ", fdesc, |
| 529 | [matchingDescs count]); | 529 | [matchingDescs count]); |
| 530 | 530 | ||
| 531 | for (dEnum = [matchingDescs objectEnumerator]; desc = [dEnum nextObject]; ) | 531 | for (dEnum = [matchingDescs objectEnumerator]; (desc = [dEnum nextObject]);) |
| 532 | { | 532 | { |
| 533 | if (![cFamilies containsObject: | 533 | if (![cFamilies containsObject: |
| 534 | [desc objectForKey: NSFontFamilyAttribute]]) | 534 | [desc objectForKey: NSFontFamilyAttribute]]) |
| @@ -664,7 +664,7 @@ nsfont_list_family (Lisp_Object frame) | |||
| 664 | [[[NSFontManager sharedFontManager] availableFontFamilies] | 664 | [[[NSFontManager sharedFontManager] availableFontFamilies] |
| 665 | objectEnumerator]; | 665 | objectEnumerator]; |
| 666 | NSString *family; | 666 | NSString *family; |
| 667 | while (family = [families nextObject]) | 667 | while ((family = [families nextObject])) |
| 668 | list = Fcons (intern ([family UTF8String]), list); | 668 | list = Fcons (intern ([family UTF8String]), list); |
| 669 | /* FIXME: escape the name? */ | 669 | /* FIXME: escape the name? */ |
| 670 | 670 | ||
| @@ -692,7 +692,6 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size) | |||
| 692 | Lisp_Object tem; | 692 | Lisp_Object tem; |
| 693 | NSRect brect; | 693 | NSRect brect; |
| 694 | Lisp_Object font_object; | 694 | Lisp_Object font_object; |
| 695 | int i; | ||
| 696 | int fixLeopardBug; | 695 | int fixLeopardBug; |
| 697 | static NSMutableDictionary *fontCache = nil; | 696 | static NSMutableDictionary *fontCache = nil; |
| 698 | NSNumber *cached; | 697 | NSNumber *cached; |
| @@ -719,7 +718,7 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size) | |||
| 719 | } | 718 | } |
| 720 | 719 | ||
| 721 | tem = AREF (font_entity, FONT_ADSTYLE_INDEX); | 720 | tem = AREF (font_entity, FONT_ADSTYLE_INDEX); |
| 722 | synthItal = !NILP (tem) && !strncmp ("synthItal", SDATA (SYMBOL_NAME (tem)), | 721 | synthItal = !NILP (tem) && !strncmp ("synthItal", SSDATA (SYMBOL_NAME (tem)), |
| 723 | 9); | 722 | 9); |
| 724 | family = ns_get_family (font_entity); | 723 | family = ns_get_family (font_entity); |
| 725 | if (family == nil) | 724 | if (family == nil) |
| @@ -812,7 +811,6 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size) | |||
| 812 | 811 | ||
| 813 | { | 812 | { |
| 814 | const char *fontName = [[nsfont fontName] UTF8String]; | 813 | const char *fontName = [[nsfont fontName] UTF8String]; |
| 815 | int len = strlen (fontName); | ||
| 816 | 814 | ||
| 817 | /* The values specified by fonts are not always exact. For | 815 | /* The values specified by fonts are not always exact. For |
| 818 | * example, a 6x8 font could specify that the descender is | 816 | * example, a 6x8 font could specify that the descender is |
| @@ -1060,7 +1058,6 @@ nsfont_draw (struct glyph_string *s, int from, int to, int x, int y, | |||
| 1060 | NS to render the string, it will come out differently from the individual | 1058 | NS to render the string, it will come out differently from the individual |
| 1061 | character widths added up because of layout processing. */ | 1059 | character widths added up because of layout processing. */ |
| 1062 | { | 1060 | { |
| 1063 | XCharStruct *cs; | ||
| 1064 | int cwidth, twidth = 0; | 1061 | int cwidth, twidth = 0; |
| 1065 | int hi, lo; | 1062 | int hi, lo; |
| 1066 | /* FIXME: composition: no vertical displacement is considered. */ | 1063 | /* FIXME: composition: no vertical displacement is considered. */ |