changeset 102954:b5a34573cf82

* nsselect.m (symbol_to_nsstring, clean_local_selection_data) (ns_string_to_pasteboard_internal): * nsmenu.m (process_dialog): * nsimage.m (ns_load_image): Use SDATA and ASET where appropriate. * nsfont.m (nsfont_open): Use XHASH to make it compile with LISP_UNION. * lisp.h (Fx_load_color_file): Declare.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 13 Apr 2009 18:45:12 +0000
parents e8415f19d774
children e59697cf4141
files src/ChangeLog src/lisp.h src/nsfont.m src/nsimage.m src/nsmenu.m src/nsselect.m
diffstat 6 files changed, 21 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon Apr 13 17:23:27 2009 +0000
+++ b/src/ChangeLog	Mon Apr 13 18:45:12 2009 +0000
@@ -1,3 +1,12 @@
+2009-04-13  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* nsselect.m (symbol_to_nsstring, clean_local_selection_data)
+	(ns_string_to_pasteboard_internal):
+	* nsmenu.m (process_dialog):
+	* nsimage.m (ns_load_image): Use SDATA and ASET where appropriate.
+	* nsfont.m (nsfont_open): Use XHASH to make it compile with LISP_UNION.
+	* lisp.h (Fx_load_color_file): Declare.
+
 2009-04-13  Kenichi Handa  <handa@m17n.org>
 
 	* font.c (font_delete_unmatched): Preserve the order of list
--- a/src/lisp.h	Mon Apr 13 17:23:27 2009 +0000
+++ b/src/lisp.h	Mon Apr 13 18:45:12 2009 +0000
@@ -3330,6 +3330,7 @@
 
 /* Defined in xfaces.c */
 EXFUN (Fclear_face_cache, 1);
+EXFUN (Fx_load_color_file, 1);
 extern void syms_of_xfaces P_ ((void));
 
 #ifndef HAVE_GETLOADAVG
--- a/src/nsfont.m	Mon Apr 13 17:23:27 2009 +0000
+++ b/src/nsfont.m	Mon Apr 13 18:45:12 2009 +0000
@@ -576,7 +576,9 @@
     {
       if (NSFONT_TRACE)
         fprintf(stderr, "*** nsfont_open CACHE HIT!\n");
-      return (Lisp_Object)[cached unsignedLongValue];
+      // FIXME: Cast from (unsigned long) to Lisp_Object.
+      XHASH (font_object) = [cached unsignedLongValue];
+      return font_object;
     }
   else
     {
@@ -585,7 +587,7 @@
       if (!synthItal)
         [fontCache
           setObject: [NSNumber numberWithUnsignedLong:
-                                 (unsigned long)font_object]
+                                 (unsigned long) XHASH (font_object)]
           forKey: nsfont];
     }
 
--- a/src/nsimage.m	Mon Apr 13 17:23:27 2009 +0000
+++ b/src/nsimage.m	Mon Apr 13 18:45:12 2009 +0000
@@ -93,7 +93,7 @@
     }
   else
     {
-      NSData *data = [NSData dataWithBytes: XSTRING (spec_data)->data
+      NSData *data = [NSData dataWithBytes: SDATA (spec_data)
                                     length: SBYTES (spec_data)];
       eImg = [[EmacsImage alloc] initWithData: data];
       [eImg setPixmapData];
--- a/src/nsmenu.m	Mon Apr 13 17:23:27 2009 +0000
+++ b/src/nsmenu.m	Mon Apr 13 18:45:12 2009 +0000
@@ -1717,11 +1717,11 @@
       item = XCAR (list);
       if (XTYPE (item) == Lisp_String)
         {
-          [window addString: XSTRING (item)->data row: row++];
+          [window addString: SDATA (item) row: row++];
         }
       else if (XTYPE (item) == Lisp_Cons)
         {
-          [window addButton: XSTRING (XCAR (item))->data
+          [window addButton: SDATA (XCAR (item))
                       value: XCDR (item) row: row++];
         }
       else if (NILP (item))
@@ -1811,7 +1811,7 @@
 
   if (XTYPE (head) == Lisp_String)
       [title setStringValue:
-                 [NSString stringWithUTF8String: XSTRING (head)->data]];
+                 [NSString stringWithUTF8String: SDATA (head)]];
   else if (isQ == YES)
       [title setStringValue: @"Question"];
   else
--- a/src/nsselect.m	Mon Apr 13 17:23:27 2009 +0000
+++ b/src/nsselect.m	Mon Apr 13 18:45:12 2009 +0000
@@ -62,7 +62,7 @@
   if (EQ (sym, QPRIMARY))     return NSGeneralPboard;
   if (EQ (sym, QSECONDARY))   return NXSecondaryPboard;
   if (EQ (sym, QTEXT))        return NSStringPboardType;
-  return [NSString stringWithUTF8String: XSTRING (XSYMBOL (sym)->xname)->data];
+  return [NSString stringWithUTF8String: SDATA (XSYMBOL (sym)->xname)];
 }
 
 
@@ -113,7 +113,7 @@
         return clean_local_selection_data (AREF (obj, 0));
       copy = Fmake_vector (make_number (size), Qnil);
       for (i = 0; i < size; i++)
-        AREF (copy, i) = clean_local_selection_data (AREF (obj, i));
+        ASET (copy, i, clean_local_selection_data (AREF (obj, i)));
       return copy;
     }
 
@@ -150,7 +150,7 @@
 
       CHECK_STRING (str);
 
-      utfStr = XSTRING (str)->data;
+      utfStr = SDATA (str);
       nsStr = [NSString stringWithUTF8String: utfStr];
 
       if (gtype == nil)