Fix compiler and run time warnings in nsmenu.m and nsterm.m
authorJan Djärv <jan.h.d@swipnet.se>
Tue, 31 Jul 2012 16:19:03 +0000 (18:19 +0200)
committerJan Djärv <jan.h.d@swipnet.se>
Tue, 31 Jul 2012 16:19:03 +0000 (18:19 +0200)
*  nsfns.m, nsmenu.m, msterm.m: Adopt to struct frame/FVAR changes.

* nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.

* nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
instead of compositeToPoint.
(applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.

src/ChangeLog
src/nsmenu.m
src/nsterm.m

index 95de49d..41b87fc 100644 (file)
@@ -1,5 +1,11 @@
 2012-07-31  Jan Djärv  <jan.h.d@swipnet.se>
 
+       * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
+
+       * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
+       instead of compositeToPoint.
+       (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
+
        *  nsfns.m, nsmenu.m, msterm.m: Adopt to struct frame/FVAR changes.
 
 2012-07-31  Dmitry Antipov  <dmantipov@yandex.ru>
index 61c4bd1..86ffeec 100644 (file)
@@ -1102,7 +1102,7 @@ update_frame_tool_bar (FRAME_PTR f)
       NSDictionary *dict = [toolbar configurationDictionary];
       NSMutableDictionary *newDict = [dict mutableCopy];
       NSEnumerator *keys = [[dict allKeys] objectEnumerator];
-      NSObject *key;
+      id key;
       while ((key = [keys nextObject]) != nil)
         {
           NSObject *val = [dict objectForKey: key];
index c1d889a..f8557aa 100644 (file)
@@ -2267,7 +2267,6 @@ ns_draw_fringe_bitmap (struct window *w, struct glyph_row *row,
   if (p->which)
     {
       NSRect r = NSMakeRect (p->x+xAdjust, p->y, p->wd, p->h);
-      NSPoint pt = r.origin;
       EmacsImage *img = bimgs[p->which - 1];
 
       if (!img)
@@ -2290,9 +2289,13 @@ ns_draw_fringe_bitmap (struct window *w, struct glyph_row *row,
          to erase the whole background. */
       [ns_lookup_indexed_color(face->background, f) set];
       NSRectFill (r);
-      pt.y += p->h;
       [img setXBMColor: ns_lookup_indexed_color(face->foreground, f)];
-      [img compositeToPoint: pt operation: NSCompositeSourceOver];
+      [img drawInRect: r
+              fromRect: NSZeroRect
+             operation: NSCompositeSourceOver
+              fraction: 1.0
+           respectFlipped: YES
+                hints: nil];
     }
   ns_unfocus (f);
 }
@@ -3035,8 +3038,12 @@ ns_dumpglyphs_image (struct glyph_string *s, NSRect r)
 
   /* Draw the image.. do we need to draw placeholder if img ==nil? */
   if (img != nil)
-    [img compositeToPoint: NSMakePoint (x, y + s->slice.height)
-                operation: NSCompositeSourceOver];
+      [img drawInRect: br
+              fromRect: NSZeroRect
+             operation: NSCompositeSourceOver
+              fraction: 1.0
+           respectFlipped: YES
+                hints: nil];
 
   if (s->hl == DRAW_CURSOR)
     {
@@ -4433,7 +4440,7 @@ ns_term_shutdown (int sig)
     return NSTerminateNow;
 
     ret = NSRunAlertPanel(ns_app_name,
-                          [NSString stringWithUTF8String:"Exit requested.  Would you like to Save Buffers and Exit, or Cancel the request?"],
+                          @"Exit requested.  Would you like to Save Buffers and Exit, or Cancel the request?",
                           @"Save Buffers and Exit", @"Cancel", nil);
 
     if (ret == NSAlertDefaultReturn)