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>
* 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
memcpy (Bug#11907).
......
......@@ -471,11 +471,11 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
if ([[view window] miniwindowTitle] &&
([[[view window] miniwindowTitle]
isEqualToString: [NSString stringWithUTF8String:
SDATA (arg)]]))
SSDATA (arg)]]))
return;
[[view window] setMiniwindowTitle:
[NSString stringWithUTF8String: SDATA (arg)]];
[NSString stringWithUTF8String: SSDATA (arg)]];
}
static void
......@@ -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);
UNGCPRO;
str = [NSString stringWithUTF8String: SDATA (encoded_name)];
str = [NSString stringWithUTF8String: SSDATA (encoded_name)];
/* Don't change the name if it's already NAME. */
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
else
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] &&
! [[[view window] miniwindowTitle] isEqualToString: str])
......@@ -512,7 +512,6 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
static void
ns_set_name (struct frame *f, Lisp_Object name, int explicit)
{
NSView *view;
NSTRACE (ns_set_name);
if (ns_in_resize)
......@@ -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]
: [[[view window] title] UTF8String];
if (title && (! strcmp (title, SDATA (encoded_name))))
if (title && (! strcmp (title, SSDATA (encoded_name))))
{
[pool release];
UNBLOCK_INPUT;
return;
}
str = [NSString stringWithUTF8String: SDATA (encoded_name)];
str = [NSString stringWithUTF8String: SSDATA (encoded_name)];
if (str == nil) str = @"Bad coding";
if (FRAME_ICONIFIED_P (f))
......@@ -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);
UNGCPRO;
fstr = [NSString stringWithUTF8String: SDATA (encoded_filename)];
fstr = [NSString stringWithUTF8String: SSDATA (encoded_filename)];
if (fstr == nil) fstr = @"";
#ifdef NS_IMPL_COCOA
/* 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
x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
{
int nlines;
int olines = FRAME_MENU_BAR_LINES (f);
if (FRAME_MINIBUF_ONLY_P (f))
return;
......@@ -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)
{
int nlines;
Lisp_Object root_window;
if (FRAME_MINIBUF_ONLY_P (f))
return;
......@@ -780,7 +777,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
BLOCK_INPUT;
pool = [[NSAutoreleasePool alloc] init];
if (f->output_data.ns->miniimage
&& [[NSString stringWithUTF8String: SDATA (f->name)]
&& [[NSString stringWithUTF8String: SSDATA (f->name)]
isEqualToString: [(NSImage *)f->output_data.ns->miniimage name]])
{
[pool release];
......@@ -802,10 +799,10 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
{
elt = XCAR (chain);
/* 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 stringWithUTF8String: SDATA (f->name)];
= [NSString stringWithUTF8String: SSDATA (f->name)];
if ([[NSFileManager defaultManager] fileExistsAtPath: str])
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
if (image == nil)
image = [[NSImage imageNamed:
[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
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);
}
......@@ -863,7 +860,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
image = [EmacsImage allocInitFromFile: arg];
if (image == nil)
image =[NSImage imageNamed: [NSString stringWithUTF8String:
SDATA (arg)]];
SSDATA (arg)]];
if (image == nil)
{
......@@ -892,9 +889,9 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
{
char *str;
if (XTYPE (arg) == Lisp_String)
str = SDATA (arg);
str = SSDATA (arg);
else if (XTYPE (arg) == Lisp_Symbol)
str = SDATA (SYMBOL_NAME (arg));
str = SSDATA (SYMBOL_NAME (arg));
else return -1;
if (!strcmp (str, "box")) return FILLED_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
Lisp_Object fname;
NSString *promptS = NILP (prompt) || !STRINGP (prompt) ? nil :
[NSString stringWithUTF8String: SDATA (prompt)];
[NSString stringWithUTF8String: SSDATA (prompt)];
NSString *dirS = NILP (dir) || !STRINGP (dir) ?
[NSString stringWithUTF8String: SDATA (BVAR (current_buffer, directory))] :
[NSString stringWithUTF8String: SDATA (dir)];
[NSString stringWithUTF8String: SSDATA (BVAR (current_buffer, directory))] :
[NSString stringWithUTF8String: SSDATA (dir)];
NSString *initS = NILP (init) || !STRINGP (init) ? nil :
[NSString stringWithUTF8String: SDATA (init)];
[NSString stringWithUTF8String: SSDATA (init)];
check_ns ();
......@@ -1568,9 +1565,9 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
if (NILP (owner))
owner = build_string([ns_app_name UTF8String]);
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)
return build_string (value);
......@@ -1591,15 +1588,15 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
if (NILP (value))
{
[[NSUserDefaults standardUserDefaults] removeObjectForKey:
[NSString stringWithUTF8String: SDATA (name)]];
[NSString stringWithUTF8String: SSDATA (name)]];
}
else
{
CHECK_STRING (value);
[[NSUserDefaults standardUserDefaults] setObject:
[NSString stringWithUTF8String: SDATA (value)]
[NSString stringWithUTF8String: SSDATA (value)]
forKey: [NSString stringWithUTF8String:
SDATA (name)]];
SSDATA (name)]];
}
return Qnil;
......@@ -1795,10 +1792,10 @@ and GNUstep implementations ("distributor-specific release
{
if (!NILP (must_succeed))
fatal ("OpenStep on %s not responding.\n",
SDATA (display));
SSDATA (display));
else
error ("OpenStep on %s not responding.\n",
SDATA (display));
SSDATA (display));
}
/* Register our external input/output types, used for determining
......@@ -1897,14 +1894,14 @@ and GNUstep implementations ("distributor-specific release
{
char *nm;
CHECK_STRING (name);
nm = SDATA (name);
nm = SSDATA (name);
if (nm[0] != '-')
return name;
if (strstr (nm, "fontset") && !strstr (nm, "fontset-startup"))
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
BLOCK_INPUT;
colorlists = [[NSColorList availableColorLists] objectEnumerator];
while (clist = [colorlists nextObject])
while ((clist = [colorlists nextObject]))
{
if ([[clist name] length] < 7 ||
[[clist name] rangeOfString: @"PANTONE"].location == 0)
{
NSEnumerator *cnames = [[clist allKeys] reverseObjectEnumerator];
NSString *cname;
while (cname = [cnames nextObject])
while ((cname = [cnames nextObject]))
list = Fcons (build_string ([cname UTF8String]), list);
/* for (i = [[clist allKeys] count] - 1; i >= 0; i--)
list = Fcons (build_string ([[[clist allKeys] objectAtIndex: i]
......@@ -2014,12 +2011,11 @@ and GNUstep implementations ("distributor-specific release
id pb;
NSString *svcName;
char *utfStr;
int len;
CHECK_STRING (service);
check_ns ();
utfStr = SDATA (service);
utfStr = SSDATA (service);
svcName = [NSString stringWithUTF8String: utfStr];
pb =[NSPasteboard pasteboardWithUniqueName];
......@@ -2044,7 +2040,7 @@ and GNUstep implementations ("distributor-specific release
NSString *utfStr;
CHECK_STRING (str);
utfStr = [NSString stringWithUTF8String: SDATA (str)];
utfStr = [NSString stringWithUTF8String: SSDATA (str)];
if (![utfStr respondsToSelector:
@selector (precomposedStringWithCanonicalMapping)])
{
......@@ -2074,7 +2070,7 @@ and GNUstep implementations ("distributor-specific release
NSAppleScript* scriptObject =
[[NSAppleScript alloc] initWithSource:
[NSString stringWithUTF8String: SDATA (script)]];
[NSString stringWithUTF8String: SSDATA (script)]];
returnDescriptor = [scriptObject executeAndReturnError: &errorDict];
[scriptObject release];
......@@ -2173,7 +2169,7 @@ and GNUstep implementations ("distributor-specific release
else if (!STRINGP (result))
error ("AppleScript error %d", status);
else
error ("%s", SDATA (result));
error ("%s", SSDATA (result));
}
#endif
......@@ -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. */)
(Lisp_Object display)
{
int top;
NSScreen *screen;
NSRect vScreen;
......@@ -2558,7 +2553,7 @@ DY added (default is -10).
GCPRO4 (string, parms, frame, timeout);
CHECK_STRING (string);
str = SDATA (string);
str = SSDATA (string);
f = check_x_frame (frame);
if (NILP (timeout))
timeout = make_number (5);
......@@ -2692,8 +2687,6 @@ - (NSString *)panel: (id)sender userEnteredFilename: (NSString *)filename
void
syms_of_nsfns (void)
{
int i;
Qfontsize = intern_c_string ("fontsize");
staticpro (&Qfontsize);
......
......@@ -100,7 +100,7 @@ static void ns_glyph_metrics (struct nsfont_info *font_info,
return nil;
else
{
char *tmp = xstrdup (SDATA (SYMBOL_NAME (tem)));
char *tmp = xstrdup (SSDATA (SYMBOL_NAME (tem)));
NSString *family;
ns_unescape_name (tmp);
family = [NSString stringWithUTF8String: tmp];
......@@ -293,13 +293,13 @@ seems to be limited for now (2009/05) to ja, zh, and ko. */
static NSString
*ns_lang_to_script (Lisp_Object lang)
{
if (!strcmp (SDATA (SYMBOL_NAME (lang)), "ja"))
if (!strcmp (SSDATA (SYMBOL_NAME (lang)), "ja"))
return @"han";
/* NOTE: ja given for any hanzi that's also a kanji, but Chinese fonts
have more characters. */
else if (!strcmp (SDATA (SYMBOL_NAME (lang)), "zh"))
else if (!strcmp (SSDATA (SYMBOL_NAME (lang)), "zh"))
return @"han";
else if (!strcmp (SDATA (SYMBOL_NAME (lang)), "ko"))
else if (!strcmp (SSDATA (SYMBOL_NAME (lang)), "ko"))
return @"hangul";
else
return @"";
......@@ -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);
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. */
while CONSP (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));
return [NSString stringWithUTF8String: SDATA (SYMBOL_NAME (script))];
return [NSString stringWithUTF8String: SSDATA (SYMBOL_NAME (script))];
}
rts = XCDR (rts);
}
......@@ -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);
if (EQ (key, QCscript) && SYMBOLP (val))
return [NSString stringWithUTF8String:
SDATA (SYMBOL_NAME (val))];
SSDATA (SYMBOL_NAME (val))];
if (EQ (key, QClang) && SYMBOLP (val))
return ns_lang_to_script (val);
if (EQ (key, QCotf) && CONSP (val) && SYMBOLP (XCAR (val)))
......@@ -373,7 +373,7 @@ but also for ascii (which causes unnecessary font substitution). */
if (EQ (reg, Qiso10646_1))
reg = Qiso8859_1;
#endif
return ns_registry_to_script (SDATA (SYMBOL_NAME (reg)));
return ns_registry_to_script (SSDATA (SYMBOL_NAME (reg)));
}
return @"";
......@@ -464,7 +464,7 @@ but also for ascii (which causes unnecessary font substitution). */
while (1)
{
NSEnumerator *allFamiliesEnum = [allFamilies objectEnumerator];
while (family = [allFamiliesEnum nextObject])
while ((family = [allFamiliesEnum nextObject]))
{
NSCharacterSet *fset = [[fontMgr fontWithFamily: family
traits: 0 weight: 5 size: 12.0] coveredCharacterSet];
......@@ -528,7 +528,7 @@ but also for ascii (which causes unnecessary font substitution). */
NSLog(@"Got desc %@ and found %d matching fonts from it: ", fdesc,
[matchingDescs count]);
for (dEnum = [matchingDescs objectEnumerator]; desc = [dEnum nextObject]; )
for (dEnum = [matchingDescs objectEnumerator]; (desc = [dEnum nextObject]);)
{
if (![cFamilies containsObject:
[desc objectForKey: NSFontFamilyAttribute]])
......@@ -664,7 +664,7 @@ Properties to be considered are same as for list(). */
[[[NSFontManager sharedFontManager] availableFontFamilies]
objectEnumerator];
NSString *family;
while (family = [families nextObject])
while ((family = [families nextObject]))
list = Fcons (intern ([family UTF8String]), list);
/* FIXME: escape the name? */
......@@ -692,7 +692,6 @@ Properties to be considered are same as for list(). */
Lisp_Object tem;
NSRect brect;
Lisp_Object font_object;
int i;
int fixLeopardBug;
static NSMutableDictionary *fontCache = nil;
NSNumber *cached;
......@@ -719,7 +718,7 @@ avoid creating multiple struct font objects (with metrics cache, etc.)
}
tem = AREF (font_entity, FONT_ADSTYLE_INDEX);
synthItal = !NILP (tem) && !strncmp ("synthItal", SDATA (SYMBOL_NAME (tem)),
synthItal = !NILP (tem) && !strncmp ("synthItal", SSDATA (SYMBOL_NAME (tem)),
9);
family = ns_get_family (font_entity);
if (family == nil)
......@@ -812,7 +811,6 @@ when setting family in ns_spec_to_descriptor(). */
{
const char *fontName = [[nsfont fontName] UTF8String];
int len = strlen (fontName);
/* The values specified by fonts are not always exact. For
* example, a 6x8 font could specify that the descender is
......@@ -1060,7 +1058,6 @@ WITH_BACKGROUND is zero when (FROM > 0 || TO < S->nchars). */
NS to render the string, it will come out differently from the individual
character widths added up because of layout processing. */
{
XCharStruct *cs;
int cwidth, twidth = 0;
int hi, lo;
/* FIXME: composition: no vertical displacement is considered. */
......
......@@ -96,7 +96,7 @@ Updated by Christian Limpach (chris@nice.ch)
{
NSData *data;
data = [NSData dataWithBytes: SDATA (spec_data)
data = [NSData dataWithBytes: SSDATA (spec_data)
length: SBYTES (spec_data)];
eImg = [[EmacsImage alloc] initWithData: data];
[eImg setPixmapData];
......@@ -171,7 +171,7 @@ @implementation EmacsImage
/* look for an existing image of the same name */
while (image != nil &&
[[image name] compare: [NSString stringWithUTF8String: SDATA (file)]]
[[image name] compare: [NSString stringWithUTF8String: SSDATA (file)]]
!= NSOrderedSame)
image = [image imageListNext];
......@@ -187,7 +187,7 @@ @implementation EmacsImage
return nil;
image = [[EmacsImage alloc] initByReferencingFile:
[NSString stringWithUTF8String: SDATA (found)]];
[NSString stringWithUTF8String: SSDATA (found)]];
#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
imgRep = [NSBitmapImageRep imageRepWithData:[image TIFFRepresentation]];
......@@ -205,7 +205,7 @@ @implementation EmacsImage
[image setScalesWhenResized: YES];
[image setSize: NSMakeSize([imgRep pixelsWide], [imgRep pixelsHigh])];
[image setName: [NSString stringWithUTF8String: SDATA (file)]];
[image setName: [NSString stringWithUTF8String: SSDATA (file)]];
[image reference];
ImageList = [image imageListSetNext: ImageList];
......@@ -334,7 +334,6 @@ - (void)dealloc
- setXBMColor: (NSColor *)color
{
NSSize s = [self size];
int len = (int) s.width * s.height;
unsigned char *planes[5];
CGFloat r, g, b, a;
NSColor *rgbColor;
......@@ -400,7 +399,7 @@ - (void) setPixmapData
NSImageRep *rep;
reps = [[self representations] objectEnumerator];
while (rep = (NSImageRep *) [reps nextObject])
while ((rep = (NSImageRep *) [reps nextObject]))
{
if ([rep respondsToSelector: @selector (getBitmapDataPlanes:)])
{
......
......@@ -249,7 +249,7 @@
/* FIXME: we'd like to only parse the needed submenu, but this
was causing crashes in the _common parsing code.. need to make
sure proper initialization done.. */
/* if (submenu && strcmp (submenuTitle, SDATA (string)))
/* if (submenu && strcmp (submenuTitle, SSDATA (string)))
continue; */
submenu_start[i] = menu_items_used;
......@@ -318,8 +318,8 @@
if (!EQ (previous_items[i], AREF (menu_items, i)))
if (!(STRINGP (previous_items[i])
&& STRINGP (AREF (menu_items, i))
&& !strcmp (SDATA (previous_items[i]),
SDATA (AREF (menu_items, i)))))
&& !strcmp (SSDATA (previous_items[i]),
SSDATA (AREF (menu_items, i)))))
break;
if (i == previous_menu_items_used)
{
......@@ -356,7 +356,7 @@
string = AREF (items, i + 1);
if (NILP (string))
break;
/* if (submenu && strcmp (submenuTitle, SDATA (string)))
/* if (submenu && strcmp (submenuTitle, SSDATA (string)))
continue; */
wv->name = SSDATA (string);
......@@ -422,11 +422,13 @@
if (EQ (string, make_number (0))) // FIXME: Why??? --Stef
continue;
if (NILP (string))
{
if (previous_strings[i][0])
break;
else
continue;
if (memcmp (previous_strings[i], SDATA (string),
}
else if (memcmp (previous_strings[i], SDATA (string),
min (10, SBYTES (string) + 1)))
break;
}
......@@ -528,7 +530,7 @@ @implementation EmacsMenu
/* override designated initializer */
- initWithTitle: (NSString *)title
{
if (self = [super initWithTitle: title])
if ((self = [super initWithTitle: title]))
[self setAutoenablesItems: NO];
return self;
}
......@@ -793,7 +795,7 @@ - (Lisp_Object)runMenuAt: (NSPoint)p forFrame: (struct frame *)f
{
EmacsMenu *pmenu;
NSPoint p;
Lisp_Object window, tem, keymap;
Lisp_Object tem;
ptrdiff_t specpdl_count = SPECPDL_INDEX ();
widget_value *wv, *first_wv = 0;
......@@ -990,7 +992,7 @@ - (Lisp_Object)runMenuAt: (NSPoint)p forFrame: (struct frame *)f
}
pmenu = [[EmacsMenu alloc] initWithTitle:
[NSString stringWithUTF8String: SDATA (title)]];
[NSString stringWithUTF8String: SSDATA (title)]];
[pmenu fillWithWidgetValue: first_wv->contents];
free_menubar_widget_value_tree (first_wv);
unbind_to (specpdl_count, Qnil);
......@@ -1043,7 +1045,6 @@ - (Lisp_Object)runMenuAt: (NSPoint)p forFrame: (struct frame *)f
i * TOOL_BAR_ITEM_NSLOTS + (IDX))
BOOL enabled_p = !NILP (TOOLPROP (TOOL_BAR_ITEM_ENABLED_P));
BOOL selected_p = !NILP (TOOLPROP (TOOL_BAR_ITEM_SELECTED_P));
int idx;
ptrdiff_t img_id;
struct image *img;
......@@ -1473,7 +1474,6 @@ @implementation EmacsDialogPanel
{
NSSize spacing = {SPACER, SPACER};
NSRect area;
char this_cmd_name[80];
id cell;
static NSImageView *imgView;
static FlippedView *contentView;
......@@ -1581,11 +1581,11 @@ void process_dialog (id window, Lisp_Object list)
item = XCAR (list);
if (XTYPE (item) == Lisp_String)
{
[window addString: SDATA (item) row: row++];
[window addString: SSDATA (item) row: row++];
}
else if (XTYPE (item) == Lisp_Cons)
{
[window addButton: SDATA (XCAR (