aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2009-04-13 18:45:12 +0000
committerStefan Monnier2009-04-13 18:45:12 +0000
commit86fa089ec05c413bb2c30dd06cce852ec917bc51 (patch)
tree7c45b99ca3cce7923b7e17ea6953db13a41fee08
parent96d98c408ae64c98f71ef34a9d91797fac71c13e (diff)
downloademacs-86fa089ec05c413bb2c30dd06cce852ec917bc51.tar.gz
emacs-86fa089ec05c413bb2c30dd06cce852ec917bc51.zip
* 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.
-rw-r--r--src/ChangeLog9
-rw-r--r--src/lisp.h1
-rw-r--r--src/nsfont.m6
-rw-r--r--src/nsimage.m2
-rw-r--r--src/nsmenu.m6
-rw-r--r--src/nsselect.m6
6 files changed, 21 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f4bbfa43526..e518eaee1a5 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
12009-04-13 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * nsselect.m (symbol_to_nsstring, clean_local_selection_data)
4 (ns_string_to_pasteboard_internal):
5 * nsmenu.m (process_dialog):
6 * nsimage.m (ns_load_image): Use SDATA and ASET where appropriate.
7 * nsfont.m (nsfont_open): Use XHASH to make it compile with LISP_UNION.
8 * lisp.h (Fx_load_color_file): Declare.
9
12009-04-13 Kenichi Handa <handa@m17n.org> 102009-04-13 Kenichi Handa <handa@m17n.org>
2 11
3 * font.c (font_delete_unmatched): Preserve the order of list 12 * font.c (font_delete_unmatched): Preserve the order of list
diff --git a/src/lisp.h b/src/lisp.h
index 84252dd8288..84dcc8fb23e 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3330,6 +3330,7 @@ EXFUN (Fx_focus_frame, 1);
3330 3330
3331/* Defined in xfaces.c */ 3331/* Defined in xfaces.c */
3332EXFUN (Fclear_face_cache, 1); 3332EXFUN (Fclear_face_cache, 1);
3333EXFUN (Fx_load_color_file, 1);
3333extern void syms_of_xfaces P_ ((void)); 3334extern void syms_of_xfaces P_ ((void));
3334 3335
3335#ifndef HAVE_GETLOADAVG 3336#ifndef HAVE_GETLOADAVG
diff --git a/src/nsfont.m b/src/nsfont.m
index 902e73d48e9..b2e9c82bd67 100644
--- a/src/nsfont.m
+++ b/src/nsfont.m
@@ -576,7 +576,9 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size)
576 { 576 {
577 if (NSFONT_TRACE) 577 if (NSFONT_TRACE)
578 fprintf(stderr, "*** nsfont_open CACHE HIT!\n"); 578 fprintf(stderr, "*** nsfont_open CACHE HIT!\n");
579 return (Lisp_Object)[cached unsignedLongValue]; 579 // FIXME: Cast from (unsigned long) to Lisp_Object.
580 XHASH (font_object) = [cached unsignedLongValue];
581 return font_object;
580 } 582 }
581 else 583 else
582 { 584 {
@@ -585,7 +587,7 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size)
585 if (!synthItal) 587 if (!synthItal)
586 [fontCache 588 [fontCache
587 setObject: [NSNumber numberWithUnsignedLong: 589 setObject: [NSNumber numberWithUnsignedLong:
588 (unsigned long)font_object] 590 (unsigned long) XHASH (font_object)]
589 forKey: nsfont]; 591 forKey: nsfont];
590 } 592 }
591 593
diff --git a/src/nsimage.m b/src/nsimage.m
index c95ad09addd..9ef7ad37a0f 100644
--- a/src/nsimage.m
+++ b/src/nsimage.m
@@ -93,7 +93,7 @@ ns_load_image (struct frame *f, struct image *img,
93 } 93 }
94 else 94 else
95 { 95 {
96 NSData *data = [NSData dataWithBytes: XSTRING (spec_data)->data 96 NSData *data = [NSData dataWithBytes: SDATA (spec_data)
97 length: SBYTES (spec_data)]; 97 length: SBYTES (spec_data)];
98 eImg = [[EmacsImage alloc] initWithData: data]; 98 eImg = [[EmacsImage alloc] initWithData: data];
99 [eImg setPixmapData]; 99 [eImg setPixmapData];
diff --git a/src/nsmenu.m b/src/nsmenu.m
index 9a97492e751..190bbb37624 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -1717,11 +1717,11 @@ void process_dialog (id window, Lisp_Object list)
1717 item = XCAR (list); 1717 item = XCAR (list);
1718 if (XTYPE (item) == Lisp_String) 1718 if (XTYPE (item) == Lisp_String)
1719 { 1719 {
1720 [window addString: XSTRING (item)->data row: row++]; 1720 [window addString: SDATA (item) row: row++];
1721 } 1721 }
1722 else if (XTYPE (item) == Lisp_Cons) 1722 else if (XTYPE (item) == Lisp_Cons)
1723 { 1723 {
1724 [window addButton: XSTRING (XCAR (item))->data 1724 [window addButton: SDATA (XCAR (item))
1725 value: XCDR (item) row: row++]; 1725 value: XCDR (item) row: row++];
1726 } 1726 }
1727 else if (NILP (item)) 1727 else if (NILP (item))
@@ -1811,7 +1811,7 @@ void process_dialog (id window, Lisp_Object list)
1811 1811
1812 if (XTYPE (head) == Lisp_String) 1812 if (XTYPE (head) == Lisp_String)
1813 [title setStringValue: 1813 [title setStringValue:
1814 [NSString stringWithUTF8String: XSTRING (head)->data]]; 1814 [NSString stringWithUTF8String: SDATA (head)]];
1815 else if (isQ == YES) 1815 else if (isQ == YES)
1816 [title setStringValue: @"Question"]; 1816 [title setStringValue: @"Question"];
1817 else 1817 else
diff --git a/src/nsselect.m b/src/nsselect.m
index 548639908e1..b689d47747c 100644
--- a/src/nsselect.m
+++ b/src/nsselect.m
@@ -62,7 +62,7 @@ symbol_to_nsstring (Lisp_Object sym)
62 if (EQ (sym, QPRIMARY)) return NSGeneralPboard; 62 if (EQ (sym, QPRIMARY)) return NSGeneralPboard;
63 if (EQ (sym, QSECONDARY)) return NXSecondaryPboard; 63 if (EQ (sym, QSECONDARY)) return NXSecondaryPboard;
64 if (EQ (sym, QTEXT)) return NSStringPboardType; 64 if (EQ (sym, QTEXT)) return NSStringPboardType;
65 return [NSString stringWithUTF8String: XSTRING (XSYMBOL (sym)->xname)->data]; 65 return [NSString stringWithUTF8String: SDATA (XSYMBOL (sym)->xname)];
66} 66}
67 67
68 68
@@ -113,7 +113,7 @@ clean_local_selection_data (Lisp_Object obj)
113 return clean_local_selection_data (AREF (obj, 0)); 113 return clean_local_selection_data (AREF (obj, 0));
114 copy = Fmake_vector (make_number (size), Qnil); 114 copy = Fmake_vector (make_number (size), Qnil);
115 for (i = 0; i < size; i++) 115 for (i = 0; i < size; i++)
116 AREF (copy, i) = clean_local_selection_data (AREF (obj, i)); 116 ASET (copy, i, clean_local_selection_data (AREF (obj, i)));
117 return copy; 117 return copy;
118 } 118 }
119 119
@@ -150,7 +150,7 @@ ns_string_to_pasteboard_internal (id pb, Lisp_Object str, NSString *gtype)
150 150
151 CHECK_STRING (str); 151 CHECK_STRING (str);
152 152
153 utfStr = XSTRING (str)->data; 153 utfStr = SDATA (str);
154 nsStr = [NSString stringWithUTF8String: utfStr]; 154 nsStr = [NSString stringWithUTF8String: utfStr];
155 155
156 if (gtype == nil) 156 if (gtype == nil)