diff options
| author | Philipp Stephani | 2021-01-23 19:08:52 +0100 |
|---|---|---|
| committer | Philipp Stephani | 2021-01-23 19:08:52 +0100 |
| commit | 17fec603709eb879297a4a0ff0c535c00a13066b (patch) | |
| tree | 3e2e7dced8dee1f7da5218bb2c6b681c5310b44f /src | |
| parent | 27a023d02928366f52ab8d5e5c398ef080483523 (diff) | |
| download | emacs-17fec603709eb879297a4a0ff0c535c00a13066b.tar.gz emacs-17fec603709eb879297a4a0ff0c535c00a13066b.zip | |
Avoid a few compilation warnings in Objective-C code.
* src/nsfns.m (Fns_frame_restack): Remove unused variable 'flag'.
* src/nsmenu.m (ns_update_menubar): Remove unused variable 'pool'.
* src/nsterm.m (focus_view, hide_bell): Define conditionally.
(ns_update_end): Define variable 'view' conditionally.
(ns_redraw_scroll_bars): Don't define unused function.
(copyRect): Don't perform arithmetic on 'void' pointers.
(nswindow_orderedIndex_sort): Make static.
Diffstat (limited to 'src')
| -rw-r--r-- | src/nsfns.m | 1 | ||||
| -rw-r--r-- | src/nsmenu.m | 1 | ||||
| -rw-r--r-- | src/nsterm.m | 31 |
3 files changed, 21 insertions, 12 deletions
diff --git a/src/nsfns.m b/src/nsfns.m index ae114f83e4d..24ea7d7f63b 100644 --- a/src/nsfns.m +++ b/src/nsfns.m | |||
| @@ -1487,7 +1487,6 @@ Some window managers may refuse to restack windows. */) | |||
| 1487 | { | 1487 | { |
| 1488 | EmacsWindow *window = (EmacsWindow *)[FRAME_NS_VIEW (f1) window]; | 1488 | EmacsWindow *window = (EmacsWindow *)[FRAME_NS_VIEW (f1) window]; |
| 1489 | NSWindow *window2 = [FRAME_NS_VIEW (f2) window]; | 1489 | NSWindow *window2 = [FRAME_NS_VIEW (f2) window]; |
| 1490 | BOOL flag = !NILP (above); | ||
| 1491 | 1490 | ||
| 1492 | if ([window restackWindow:window2 above:!NILP (above)]) | 1491 | if ([window restackWindow:window2 above:!NILP (above)]) |
| 1493 | return Qt; | 1492 | return Qt; |
diff --git a/src/nsmenu.m b/src/nsmenu.m index 8086f56854e..f8219d27026 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m | |||
| @@ -101,7 +101,6 @@ popup_activated (void) | |||
| 101 | static void | 101 | static void |
| 102 | ns_update_menubar (struct frame *f, bool deep_p) | 102 | ns_update_menubar (struct frame *f, bool deep_p) |
| 103 | { | 103 | { |
| 104 | NSAutoreleasePool *pool; | ||
| 105 | BOOL needsSet = NO; | 104 | BOOL needsSet = NO; |
| 106 | id menu = [NSApp mainMenu]; | 105 | id menu = [NSApp mainMenu]; |
| 107 | bool owfi; | 106 | bool owfi; |
diff --git a/src/nsterm.m b/src/nsterm.m index c5815ce8d10..df3934c5c34 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -272,7 +272,9 @@ long context_menu_value = 0; | |||
| 272 | 272 | ||
| 273 | /* display update */ | 273 | /* display update */ |
| 274 | static struct frame *ns_updating_frame; | 274 | static struct frame *ns_updating_frame; |
| 275 | #if !defined (NS_DRAW_TO_BUFFER) || MAC_OS_X_VERSION_MIN_REQUIRED < 101400 | ||
| 275 | static NSView *focus_view = NULL; | 276 | static NSView *focus_view = NULL; |
| 277 | #endif | ||
| 276 | static int ns_window_num = 0; | 278 | static int ns_window_num = 0; |
| 277 | static BOOL gsaved = NO; | 279 | static BOOL gsaved = NO; |
| 278 | static BOOL ns_fake_keydown = NO; | 280 | static BOOL ns_fake_keydown = NO; |
| @@ -1139,7 +1141,9 @@ ns_update_end (struct frame *f) | |||
| 1139 | external (RIF) call; for whole frame, called after gui_update_window_end | 1141 | external (RIF) call; for whole frame, called after gui_update_window_end |
| 1140 | -------------------------------------------------------------------------- */ | 1142 | -------------------------------------------------------------------------- */ |
| 1141 | { | 1143 | { |
| 1144 | #if !defined (NS_DRAW_TO_BUFFER) || MAC_OS_X_VERSION_MIN_REQUIRED < 101400 | ||
| 1142 | EmacsView *view = FRAME_NS_VIEW (f); | 1145 | EmacsView *view = FRAME_NS_VIEW (f); |
| 1146 | #endif | ||
| 1143 | 1147 | ||
| 1144 | NSTRACE_WHEN (NSTRACE_GROUP_UPDATES, "ns_update_end"); | 1148 | NSTRACE_WHEN (NSTRACE_GROUP_UPDATES, "ns_update_end"); |
| 1145 | 1149 | ||
| @@ -1449,7 +1453,7 @@ ns_ring_bell (struct frame *f) | |||
| 1449 | } | 1453 | } |
| 1450 | } | 1454 | } |
| 1451 | 1455 | ||
| 1452 | 1456 | #if !defined (NS_DRAW_TO_BUFFER) || MAC_OS_X_VERSION_MIN_REQUIRED < 101400 | |
| 1453 | static void | 1457 | static void |
| 1454 | hide_bell (void) | 1458 | hide_bell (void) |
| 1455 | /* -------------------------------------------------------------------------- | 1459 | /* -------------------------------------------------------------------------- |
| @@ -1463,6 +1467,7 @@ hide_bell (void) | |||
| 1463 | [bell_view remove]; | 1467 | [bell_view remove]; |
| 1464 | } | 1468 | } |
| 1465 | } | 1469 | } |
| 1470 | #endif | ||
| 1466 | 1471 | ||
| 1467 | 1472 | ||
| 1468 | /* ========================================================================== | 1473 | /* ========================================================================== |
| @@ -2876,6 +2881,8 @@ ns_get_shifted_character (NSEvent *event) | |||
| 2876 | ========================================================================== */ | 2881 | ========================================================================== */ |
| 2877 | 2882 | ||
| 2878 | 2883 | ||
| 2884 | #if 0 | ||
| 2885 | /* FIXME: Remove this function. */ | ||
| 2879 | static void | 2886 | static void |
| 2880 | ns_redraw_scroll_bars (struct frame *f) | 2887 | ns_redraw_scroll_bars (struct frame *f) |
| 2881 | { | 2888 | { |
| @@ -2890,6 +2897,7 @@ ns_redraw_scroll_bars (struct frame *f) | |||
| 2890 | [view display]; | 2897 | [view display]; |
| 2891 | } | 2898 | } |
| 2892 | } | 2899 | } |
| 2900 | #endif | ||
| 2893 | 2901 | ||
| 2894 | 2902 | ||
| 2895 | void | 2903 | void |
| @@ -8399,21 +8407,23 @@ not_in_argv (NSString *arg) | |||
| 8399 | void *pixels = CGBitmapContextGetData (context); | 8407 | void *pixels = CGBitmapContextGetData (context); |
| 8400 | int rowSize = CGBitmapContextGetBytesPerRow (context); | 8408 | int rowSize = CGBitmapContextGetBytesPerRow (context); |
| 8401 | int srcRowSize = NSWidth (srcRect) * scale * bpp; | 8409 | int srcRowSize = NSWidth (srcRect) * scale * bpp; |
| 8402 | void *srcPixels = pixels + (int)(NSMinY (srcRect) * scale * rowSize | 8410 | void *srcPixels = (char *) pixels |
| 8403 | + NSMinX (srcRect) * scale * bpp); | 8411 | + (int) (NSMinY (srcRect) * scale * rowSize |
| 8404 | void *dstPixels = pixels + (int)(NSMinY (dstRect) * scale * rowSize | 8412 | + NSMinX (srcRect) * scale * bpp); |
| 8405 | + NSMinX (dstRect) * scale * bpp); | 8413 | void *dstPixels = (char *) pixels |
| 8414 | + (int) (NSMinY (dstRect) * scale * rowSize | ||
| 8415 | + NSMinX (dstRect) * scale * bpp); | ||
| 8406 | 8416 | ||
| 8407 | if (NSIntersectsRect (srcRect, dstRect) | 8417 | if (NSIntersectsRect (srcRect, dstRect) |
| 8408 | && NSMinY (srcRect) < NSMinY (dstRect)) | 8418 | && NSMinY (srcRect) < NSMinY (dstRect)) |
| 8409 | for (int y = NSHeight (srcRect) * scale - 1 ; y >= 0 ; y--) | 8419 | for (int y = NSHeight (srcRect) * scale - 1 ; y >= 0 ; y--) |
| 8410 | memmove (dstPixels + y * rowSize, | 8420 | memmove ((char *) dstPixels + y * rowSize, |
| 8411 | srcPixels + y * rowSize, | 8421 | (char *) srcPixels + y * rowSize, |
| 8412 | srcRowSize); | 8422 | srcRowSize); |
| 8413 | else | 8423 | else |
| 8414 | for (int y = 0 ; y < NSHeight (srcRect) * scale ; y++) | 8424 | for (int y = 0 ; y < NSHeight (srcRect) * scale ; y++) |
| 8415 | memmove (dstPixels + y * rowSize, | 8425 | memmove ((char *) dstPixels + y * rowSize, |
| 8416 | srcPixels + y * rowSize, | 8426 | (char *) srcPixels + y * rowSize, |
| 8417 | srcRowSize); | 8427 | srcRowSize); |
| 8418 | 8428 | ||
| 8419 | #if MAC_OS_X_VERSION_MIN_REQUIRED < 101400 | 8429 | #if MAC_OS_X_VERSION_MIN_REQUIRED < 101400 |
| @@ -8742,7 +8752,8 @@ not_in_argv (NSString *arg) | |||
| 8742 | /* The array returned by [NSWindow parentWindow] may already be | 8752 | /* The array returned by [NSWindow parentWindow] may already be |
| 8743 | sorted, but the documentation doesn't tell us whether or not it is, | 8753 | sorted, but the documentation doesn't tell us whether or not it is, |
| 8744 | so to be safe we'll sort it. */ | 8754 | so to be safe we'll sort it. */ |
| 8745 | NSInteger nswindow_orderedIndex_sort (id w1, id w2, void *c) | 8755 | static NSInteger |
| 8756 | nswindow_orderedIndex_sort (id w1, id w2, void *c) | ||
| 8746 | { | 8757 | { |
| 8747 | NSInteger i1 = [w1 orderedIndex]; | 8758 | NSInteger i1 = [w1 orderedIndex]; |
| 8748 | NSInteger i2 = [w2 orderedIndex]; | 8759 | NSInteger i2 = [w2 orderedIndex]; |