Commit 0dc8cf50 authored by Jan Djärv's avatar Jan Djärv

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.
parent b55b9f85
2012-07-13 Jan Djärv <jan.h.d@swipnet.se> 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
* 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.
* 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.
* 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.
* nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
appropriate.
(setXBMColor): Remove unused variable len.
(setPixmapData): Put () around assignment in loop statement.
* 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.
* 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.
* nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
memcpy (Bug#11907). memcpy (Bug#11907).
......
...@@ -471,11 +471,11 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side ...@@ -471,11 +471,11 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
if ([[view window] miniwindowTitle] && if ([[view window] miniwindowTitle] &&
([[[view window] miniwindowTitle] ([[[view window] miniwindowTitle]
isEqualToString: [NSString stringWithUTF8String: isEqualToString: [NSString stringWithUTF8String:
SDATA (arg)]])) SSDATA (arg)]]))
return; return;
[[view window] setMiniwindowTitle: [[view window] setMiniwindowTitle:
[NSString stringWithUTF8String: SDATA (arg)]]; [NSString stringWithUTF8String: SSDATA (arg)]];
} }
static void static void
...@@ -490,7 +490,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side ...@@ -490,7 +490,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
encoded_name = ENCODE_UTF_8 (name); encoded_name = ENCODE_UTF_8 (name);
UNGCPRO; UNGCPRO;
str = [NSString stringWithUTF8String: SDATA (encoded_name)]; str = [NSString stringWithUTF8String: SSDATA (encoded_name)];
/* Don't change the name if it's already NAME. */ /* Don't change the name if it's already NAME. */
if (! [[[view window] title] isEqualToString: str]) if (! [[[view window] title] isEqualToString: str])
...@@ -501,7 +501,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side ...@@ -501,7 +501,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
else else
encoded_icon_name = ENCODE_UTF_8 (f->icon_name); encoded_icon_name = ENCODE_UTF_8 (f->icon_name);
str = [NSString stringWithUTF8String: SDATA (encoded_icon_name)]; str = [NSString stringWithUTF8String: SSDATA (encoded_icon_name)];
if ([[view window] miniwindowTitle] && if ([[view window] miniwindowTitle] &&
! [[[view window] miniwindowTitle] isEqualToString: str]) ! [[[view window] miniwindowTitle] isEqualToString: str])
...@@ -512,7 +512,6 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side ...@@ -512,7 +512,6 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
static void static void
ns_set_name (struct frame *f, Lisp_Object name, int explicit) ns_set_name (struct frame *f, Lisp_Object name, int explicit)
{ {
NSView *view;
NSTRACE (ns_set_name); NSTRACE (ns_set_name);
if (ns_in_resize) if (ns_in_resize)
...@@ -641,14 +640,14 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side ...@@ -641,14 +640,14 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
title = FRAME_ICONIFIED_P (f) ? [[[view window] miniwindowTitle] UTF8String] title = FRAME_ICONIFIED_P (f) ? [[[view window] miniwindowTitle] UTF8String]
: [[[view window] title] UTF8String]; : [[[view window] title] UTF8String];
if (title && (! strcmp (title, SDATA (encoded_name)))) if (title && (! strcmp (title, SSDATA (encoded_name))))
{ {
[pool release]; [pool release];
UNBLOCK_INPUT; UNBLOCK_INPUT;
return; return;
} }
str = [NSString stringWithUTF8String: SDATA (encoded_name)]; str = [NSString stringWithUTF8String: SSDATA (encoded_name)];
if (str == nil) str = @"Bad coding"; if (str == nil) str = @"Bad coding";
if (FRAME_ICONIFIED_P (f)) if (FRAME_ICONIFIED_P (f))
...@@ -663,7 +662,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side ...@@ -663,7 +662,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
encoded_filename = ENCODE_UTF_8 (filename); encoded_filename = ENCODE_UTF_8 (filename);
UNGCPRO; UNGCPRO;
fstr = [NSString stringWithUTF8String: SDATA (encoded_filename)]; fstr = [NSString stringWithUTF8String: SSDATA (encoded_filename)];
if (fstr == nil) fstr = @""; if (fstr == nil) fstr = @"";
#ifdef NS_IMPL_COCOA #ifdef NS_IMPL_COCOA
/* work around a bug observed on 10.3 and later where /* work around a bug observed on 10.3 and later where
...@@ -706,7 +705,6 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side ...@@ -706,7 +705,6 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
{ {
int nlines; int nlines;
int olines = FRAME_MENU_BAR_LINES (f);
if (FRAME_MINIBUF_ONLY_P (f)) if (FRAME_MINIBUF_ONLY_P (f))
return; return;
...@@ -737,7 +735,6 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side ...@@ -737,7 +735,6 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
{ {
int nlines; int nlines;
Lisp_Object root_window;
if (FRAME_MINIBUF_ONLY_P (f)) if (FRAME_MINIBUF_ONLY_P (f))
return; return;
...@@ -780,7 +777,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side ...@@ -780,7 +777,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
BLOCK_INPUT; BLOCK_INPUT;
pool = [[NSAutoreleasePool alloc] init]; pool = [[NSAutoreleasePool alloc] init];
if (f->output_data.ns->miniimage if (f->output_data.ns->miniimage
&& [[NSString stringWithUTF8String: SDATA (f->name)] && [[NSString stringWithUTF8String: SSDATA (f->name)]
isEqualToString: [(NSImage *)f->output_data.ns->miniimage name]]) isEqualToString: [(NSImage *)f->output_data.ns->miniimage name]])
{ {
[pool release]; [pool release];
...@@ -802,10 +799,10 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side ...@@ -802,10 +799,10 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
{ {
elt = XCAR (chain); elt = XCAR (chain);
/* special case: 't' means go by file type */ /* special case: 't' means go by file type */
if (SYMBOLP (elt) && EQ (elt, Qt) && SDATA (f->name)[0] == '/') if (SYMBOLP (elt) && EQ (elt, Qt) && SSDATA (f->name)[0] == '/')
{ {
NSString *str NSString *str
= [NSString stringWithUTF8String: SDATA (f->name)]; = [NSString stringWithUTF8String: SSDATA (f->name)];
if ([[NSFileManager defaultManager] fileExistsAtPath: str]) if ([[NSFileManager defaultManager] fileExistsAtPath: str])
image = [[[NSWorkspace sharedWorkspace] iconForFile: str] retain]; image = [[[NSWorkspace sharedWorkspace] iconForFile: str] retain];
} }
...@@ -818,7 +815,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side ...@@ -818,7 +815,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
if (image == nil) if (image == nil)
image = [[NSImage imageNamed: image = [[NSImage imageNamed:
[NSString stringWithUTF8String: [NSString stringWithUTF8String:
SDATA (XCDR (elt))]] retain]; SSDATA (XCDR (elt))]] retain];
} }
} }
...@@ -847,7 +844,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side ...@@ -847,7 +844,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
if (!NILP (arg) && SYMBOLP (arg)) if (!NILP (arg) && SYMBOLP (arg))
{ {
arg =build_string (SDATA (SYMBOL_NAME (arg))); arg =build_string (SSDATA (SYMBOL_NAME (arg)));
store_frame_param (f, Qicon_type, arg); store_frame_param (f, Qicon_type, arg);
} }
...@@ -863,7 +860,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side ...@@ -863,7 +860,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
image = [EmacsImage allocInitFromFile: arg]; image = [EmacsImage allocInitFromFile: arg];
if (image == nil) if (image == nil)
image =[NSImage imageNamed: [NSString stringWithUTF8String: image =[NSImage imageNamed: [NSString stringWithUTF8String:
SDATA (arg)]]; SSDATA (arg)]];
if (image == nil) if (image == nil)
{ {
...@@ -892,9 +889,9 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side ...@@ -892,9 +889,9 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
{ {
char *str; char *str;
if (XTYPE (arg) == Lisp_String) if (XTYPE (arg) == Lisp_String)
str = SDATA (arg); str = SSDATA (arg);
else if (XTYPE (arg) == Lisp_Symbol) else if (XTYPE (arg) == Lisp_Symbol)
str = SDATA (SYMBOL_NAME (arg)); str = SSDATA (SYMBOL_NAME (arg));
else return -1; else return -1;
if (!strcmp (str, "box")) return FILLED_BOX_CURSOR; if (!strcmp (str, "box")) return FILLED_BOX_CURSOR;
if (!strcmp (str, "hollow")) return HOLLOW_BOX_CURSOR; if (!strcmp (str, "hollow")) return HOLLOW_BOX_CURSOR;
...@@ -1493,12 +1490,12 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side ...@@ -1493,12 +1490,12 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
Lisp_Object fname; Lisp_Object fname;
NSString *promptS = NILP (prompt) || !STRINGP (prompt) ? nil : NSString *promptS = NILP (prompt) || !STRINGP (prompt) ? nil :
[NSString stringWithUTF8String: SDATA (prompt)]; [NSString stringWithUTF8String: SSDATA (prompt)];
NSString *dirS = NILP (dir) || !STRINGP (dir) ? NSString *dirS = NILP (dir) || !STRINGP (dir) ?
[NSString stringWithUTF8String: SDATA (BVAR (current_buffer, directory))] : [NSString stringWithUTF8String: SSDATA (BVAR (current_buffer, directory))] :
[NSString stringWithUTF8String: SDATA (dir)]; [NSString stringWithUTF8String: SSDATA (dir)];
NSString *initS = NILP (init) || !STRINGP (init) ? nil : NSString *initS = NILP (init) || !STRINGP (init) ? nil :
[NSString stringWithUTF8String: SDATA (init)]; [NSString stringWithUTF8String: SSDATA (init)];
check_ns (); check_ns ();
...@@ -1568,9 +1565,9 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side ...@@ -1568,9 +1565,9 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
if (NILP (owner)) if (NILP (owner))
owner = build_string([ns_app_name UTF8String]); owner = build_string([ns_app_name UTF8String]);
CHECK_STRING (name); CHECK_STRING (name);
/*fprintf (stderr, "ns-get-resource checking resource '%s'\n", SDATA (name)); */ /*fprintf (stderr, "ns-get-resource checking resource '%s'\n", SSDATA (name)); */
value = ns_get_defaults_value (SDATA (name)); value = ns_get_defaults_value (SSDATA (name));
if (value) if (value)
return build_string (value); return build_string (value);
...@@ -1591,15 +1588,15 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side ...@@ -1591,15 +1588,15 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
if (NILP (value)) if (NILP (value))
{ {
[[NSUserDefaults standardUserDefaults] removeObjectForKey: [[NSUserDefaults standardUserDefaults] removeObjectForKey:
[NSString stringWithUTF8String: SDATA (name)]]; [NSString stringWithUTF8String: SSDATA (name)]];
} }
else else
{ {
CHECK_STRING (value); CHECK_STRING (value);
[[NSUserDefaults standardUserDefaults] setObject: [[NSUserDefaults standardUserDefaults] setObject:
[NSString stringWithUTF8String: SDATA (value)] [NSString stringWithUTF8String: SSDATA (value)]
forKey: [NSString stringWithUTF8String: forKey: [NSString stringWithUTF8String:
SDATA (name)]]; SSDATA (name)]];
} }
return Qnil; return Qnil;
...@@ -1795,10 +1792,10 @@ and GNUstep implementations ("distributor-specific release ...@@ -1795,10 +1792,10 @@ and GNUstep implementations ("distributor-specific release
{ {
if (!NILP (must_succeed)) if (!NILP (must_succeed))
fatal ("OpenStep on %s not responding.\n", fatal ("OpenStep on %s not responding.\n",
SDATA (display)); SSDATA (display));
else else
error ("OpenStep on %s not responding.\n", error ("OpenStep on %s not responding.\n",
SDATA (display)); SSDATA (display));
} }
/* Register our external input/output types, used for determining /* Register our external input/output types, used for determining
...@@ -1897,14 +1894,14 @@ and GNUstep implementations ("distributor-specific release ...@@ -1897,14 +1894,14 @@ and GNUstep implementations ("distributor-specific release
{ {
char *nm; char *nm;
CHECK_STRING (name); CHECK_STRING (name);
nm = SDATA (name); nm = SSDATA (name);
if (nm[0] != '-') if (nm[0] != '-')
return name; return name;
if (strstr (nm, "fontset") && !strstr (nm, "fontset-startup")) if (strstr (nm, "fontset") && !strstr (nm, "fontset-startup"))
return name; return name;
return build_string (ns_xlfd_to_fontname (SDATA (name))); return build_string (ns_xlfd_to_fontname (SSDATA (name)));
} }
...@@ -1927,14 +1924,14 @@ and GNUstep implementations ("distributor-specific release ...@@ -1927,14 +1924,14 @@ and GNUstep implementations ("distributor-specific release
BLOCK_INPUT; BLOCK_INPUT;
colorlists = [[NSColorList availableColorLists] objectEnumerator]; colorlists = [[NSColorList availableColorLists] objectEnumerator];
while (clist = [colorlists nextObject]) while ((clist = [colorlists nextObject]))
{ {
if ([[clist name] length] < 7 || if ([[clist name] length] < 7 ||
[[clist name] rangeOfString: @"PANTONE"].location == 0) [[clist name] rangeOfString: @"PANTONE"].location == 0)
{ {
NSEnumerator *cnames = [[clist allKeys] reverseObjectEnumerator]; NSEnumerator *cnames = [[clist allKeys] reverseObjectEnumerator];
NSString *cname; NSString *cname;
while (cname = [cnames nextObject]) while ((cname = [cnames nextObject]))
list = Fcons (build_string ([cname UTF8String]), list); list = Fcons (build_string ([cname UTF8String]), list);
/* for (i = [[clist allKeys] count] - 1; i >= 0; i--) /* for (i = [[clist allKeys] count] - 1; i >= 0; i--)
list = Fcons (build_string ([[[clist allKeys] objectAtIndex: i] list = Fcons (build_string ([[[clist allKeys] objectAtIndex: i]
...@@ -2014,12 +2011,11 @@ and GNUstep implementations ("distributor-specific release ...@@ -2014,12 +2011,11 @@ and GNUstep implementations ("distributor-specific release
id pb; id pb;
NSString *svcName; NSString *svcName;
char *utfStr; char *utfStr;
int len;
CHECK_STRING (service); CHECK_STRING (service);
check_ns (); check_ns ();
utfStr = SDATA (service); utfStr = SSDATA (service);
svcName = [NSString stringWithUTF8String: utfStr]; svcName = [NSString stringWithUTF8String: utfStr];
pb =[NSPasteboard pasteboardWithUniqueName]; pb =[NSPasteboard pasteboardWithUniqueName];
...@@ -2044,7 +2040,7 @@ and GNUstep implementations ("distributor-specific release ...@@ -2044,7 +2040,7 @@ and GNUstep implementations ("distributor-specific release
NSString *utfStr; NSString *utfStr;
CHECK_STRING (str); CHECK_STRING (str);
utfStr = [NSString stringWithUTF8String: SDATA (str)]; utfStr = [NSString stringWithUTF8String: SSDATA (str)];
if (![utfStr respondsToSelector: if (![utfStr respondsToSelector:
@selector (precomposedStringWithCanonicalMapping)]) @selector (precomposedStringWithCanonicalMapping)])
{ {
...@@ -2074,7 +2070,7 @@ and GNUstep implementations ("distributor-specific release ...@@ -2074,7 +2070,7 @@ and GNUstep implementations ("distributor-specific release
NSAppleScript* scriptObject = NSAppleScript* scriptObject =
[[NSAppleScript alloc] initWithSource: [[NSAppleScript alloc] initWithSource:
[NSString stringWithUTF8String: SDATA (script)]]; [NSString stringWithUTF8String: SSDATA (script)]];
returnDescriptor = [scriptObject executeAndReturnError: &errorDict]; returnDescriptor = [scriptObject executeAndReturnError: &errorDict];
[scriptObject release]; [scriptObject release];
...@@ -2173,7 +2169,7 @@ and GNUstep implementations ("distributor-specific release ...@@ -2173,7 +2169,7 @@ and GNUstep implementations ("distributor-specific release
else if (!STRINGP (result)) else if (!STRINGP (result))
error ("AppleScript error %d", status); error ("AppleScript error %d", status);
else else
error ("%s", SDATA (result)); error ("%s", SSDATA (result));
} }
#endif #endif
...@@ -2400,7 +2396,6 @@ The return value is a list of integers (LEFT TOP WIDTH HEIGHT), which ...@@ -2400,7 +2396,6 @@ The return value is a list of integers (LEFT TOP WIDTH HEIGHT), which
that stands for the selected frame's display. */) that stands for the selected frame's display. */)
(Lisp_Object display) (Lisp_Object display)
{ {
int top;
NSScreen *screen; NSScreen *screen;
NSRect vScreen; NSRect vScreen;
...@@ -2558,7 +2553,7 @@ DY added (default is -10). ...@@ -2558,7 +2553,7 @@ DY added (default is -10).
GCPRO4 (string, parms, frame, timeout); GCPRO4 (string, parms, frame, timeout);
CHECK_STRING (string); CHECK_STRING (string);
str = SDATA (string); str = SSDATA (string);
f = check_x_frame (frame); f = check_x_frame (frame);
if (NILP (timeout)) if (NILP (timeout))
timeout = make_number (5); timeout = make_number (5);
...@@ -2692,8 +2687,6 @@ - (NSString *)panel: (id)sender userEnteredFilename: (NSString *)filename ...@@ -2692,8 +2687,6 @@ - (NSString *)panel: (id)sender userEnteredFilename: (NSString *)filename
void void
syms_of_nsfns (void) syms_of_nsfns (void)
{ {
int i;
Qfontsize = intern_c_string ("fontsize"); Qfontsize = intern_c_string ("fontsize");
staticpro (&Qfontsize); staticpro (&Qfontsize);
......
...@@ -100,7 +100,7 @@ static void ns_glyph_metrics (struct nsfont_info *font_info, ...@@ -100,7 +100,7 @@ static void ns_glyph_metrics (struct nsfont_info *font_info,
return nil; return nil;
else else
{ {
char *tmp = xstrdup (SDATA (SYMBOL_NAME (tem))); char *tmp = xstrdup (SSDATA (SYMBOL_NAME (tem)));
NSString *family; NSString *family;
ns_unescape_name (tmp); ns_unescape_name (tmp);
family = [NSString stringWithUTF8String: tmp]; family = [NSString stringWithUTF8String: tmp];
...@@ -293,13 +293,13 @@ seems to be limited for now (2009/05) to ja, zh, and ko. */ ...@@ -293,13 +293,13 @@ seems to be limited for now (2009/05) to ja, zh, and ko. */
static NSString static NSString
*ns_lang_to_script (Lisp_Object lang) *ns_lang_to_script (Lisp_Object lang)
{ {
if (!strcmp (SDATA (SYMBOL_NAME (lang)), "ja")) if (!strcmp (SSDATA (SYMBOL_NAME (lang)), "ja"))
return @"han"; return @"han";
/* NOTE: ja given for any hanzi that's also a kanji, but Chinese fonts /* NOTE: ja given for any hanzi that's also a kanji, but Chinese fonts
have more characters. */ have more characters. */
else if (!strcmp (SDATA (SYMBOL_NAME (lang)), "zh")) else if (!strcmp (SSDATA (SYMBOL_NAME (lang)), "zh"))
return @"han"; return @"han";
else if (!strcmp (SDATA (SYMBOL_NAME (lang)), "ko")) else if (!strcmp (SSDATA (SYMBOL_NAME (lang)), "ko"))
return @"hangul"; return @"hangul";
else else
return @""; return @"";
...@@ -313,7 +313,7 @@ seems to be limited for now (2009/05) to ja, zh, and ko. */ ...@@ -313,7 +313,7 @@ seems to be limited for now (2009/05) to ja, zh, and ko. */
{ {
Lisp_Object script = assq_no_quit (XCAR (otf), Votf_script_alist); Lisp_Object script = assq_no_quit (XCAR (otf), Votf_script_alist);
return CONSP (script) return CONSP (script)
? [NSString stringWithUTF8String: SDATA (SYMBOL_NAME (XCDR ((script))))] ? [NSString stringWithUTF8String: SSDATA (SYMBOL_NAME (XCDR ((script))))]
: @""; : @"";
} }
...@@ -326,10 +326,10 @@ seems to be limited for now (2009/05) to ja, zh, and ko. */ ...@@ -326,10 +326,10 @@ seems to be limited for now (2009/05) to ja, zh, and ko. */
while CONSP (rts) while CONSP (rts)
{ {
r = XCAR (XCAR (rts)); r = XCAR (XCAR (rts));
if (!strncmp(SDATA(r), reg, strlen(SDATA(r)))) if (!strncmp(SSDATA(r), reg, strlen(SSDATA(r))))
{ {
script = XCDR (XCAR (rts)); script = XCDR (XCAR (rts));
return [NSString stringWithUTF8String: SDATA (SYMBOL_NAME (script))]; return [NSString stringWithUTF8String: SSDATA (SYMBOL_NAME (script))];
} }
rts = XCDR (rts); rts = XCDR (rts);
} }
...@@ -355,7 +355,7 @@ seems to be limited for now (2009/05) to ja, zh, and ko. */ ...@@ -355,7 +355,7 @@ seems to be limited for now (2009/05) to ja, zh, and ko. */
Lisp_Object key = XCAR (tmp), val = XCDR (tmp); Lisp_Object key = XCAR (tmp), val = XCDR (tmp);
if (EQ (key, QCscript) && SYMBOLP (val)) if (EQ (key, QCscript) && SYMBOLP (val))
return [NSString stringWithUTF8String: return [NSString stringWithUTF8String:
SDATA (SYMBOL_NAME (val))]; SSDATA (SYMBOL_NAME (val))];
if (EQ (key, QClang) && SYMBOLP (val)) if (EQ (key, QClang) && SYMBOLP (val))
return ns_lang_to_script (val); return ns_lang_to_script (val);
if (EQ (key, QCotf) && CONSP (val) && SYMBOLP (XCAR (val))) if (EQ (key, QCotf) && CONSP (val) && SYMBOLP (XCAR (val)))
...@@ -373,7 +373,7 @@ but also for ascii (which causes unnecessary font substitution). */ ...@@ -373,7 +373,7 @@ but also for ascii (which causes unnecessary font substitution). */
if (EQ (reg, Qiso10646_1)) if (EQ (reg, Qiso10646_1))
reg = Qiso8859_1; reg = Qiso8859_1;
#endif #endif
return ns_registry_to_script (SDATA (SYMBOL_NAME (reg))); return ns_registry_to_script (SSDATA (SYMBOL_NAME (reg)));
} }
return @""; return @"";
...@@ -464,7 +464,7 @@ but also for ascii (which causes unnecessary font substitution). */ ...@@ -464,7 +46