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.
This commit is contained in:
Philipp Stephani 2021-01-23 19:08:52 +01:00
parent 27a023d029
commit 17fec60370
3 changed files with 21 additions and 12 deletions

View file

@ -1487,7 +1487,6 @@ Frames are listed from topmost (first) to bottommost (last). */)
{
EmacsWindow *window = (EmacsWindow *)[FRAME_NS_VIEW (f1) window];
NSWindow *window2 = [FRAME_NS_VIEW (f2) window];
BOOL flag = !NILP (above);
if ([window restackWindow:window2 above:!NILP (above)])
return Qt;

View file

@ -101,7 +101,6 @@
static void
ns_update_menubar (struct frame *f, bool deep_p)
{
NSAutoreleasePool *pool;
BOOL needsSet = NO;
id menu = [NSApp mainMenu];
bool owfi;

View file

@ -272,7 +272,9 @@ - (NSColor *)colorUsingDefaultColorSpace
/* display update */
static struct frame *ns_updating_frame;
#if !defined (NS_DRAW_TO_BUFFER) || MAC_OS_X_VERSION_MIN_REQUIRED < 101400
static NSView *focus_view = NULL;
#endif
static int ns_window_num = 0;
static BOOL gsaved = NO;
static BOOL ns_fake_keydown = NO;
@ -1139,7 +1141,9 @@ static NSRect constrain_frame_rect(NSRect frameRect, bool isFullscreen)
external (RIF) call; for whole frame, called after gui_update_window_end
-------------------------------------------------------------------------- */
{
#if !defined (NS_DRAW_TO_BUFFER) || MAC_OS_X_VERSION_MIN_REQUIRED < 101400
EmacsView *view = FRAME_NS_VIEW (f);
#endif
NSTRACE_WHEN (NSTRACE_GROUP_UPDATES, "ns_update_end");
@ -1449,7 +1453,7 @@ -(void)remove
}
}
#if !defined (NS_DRAW_TO_BUFFER) || MAC_OS_X_VERSION_MIN_REQUIRED < 101400
static void
hide_bell (void)
/* --------------------------------------------------------------------------
@ -1463,6 +1467,7 @@ -(void)remove
[bell_view remove];
}
}
#endif
/* ==========================================================================
@ -2876,6 +2881,8 @@ so some key presses (TAB) are swallowed by the system. */
========================================================================== */
#if 0
/* FIXME: Remove this function. */
static void
ns_redraw_scroll_bars (struct frame *f)
{
@ -2890,6 +2897,7 @@ so some key presses (TAB) are swallowed by the system. */
[view display];
}
}
#endif
void
@ -8399,21 +8407,23 @@ - (void)copyRect:(NSRect)srcRect to:(NSRect)dstRect
void *pixels = CGBitmapContextGetData (context);
int rowSize = CGBitmapContextGetBytesPerRow (context);
int srcRowSize = NSWidth (srcRect) * scale * bpp;
void *srcPixels = pixels + (int)(NSMinY (srcRect) * scale * rowSize
+ NSMinX (srcRect) * scale * bpp);
void *dstPixels = pixels + (int)(NSMinY (dstRect) * scale * rowSize
+ NSMinX (dstRect) * scale * bpp);
void *srcPixels = (char *) pixels
+ (int) (NSMinY (srcRect) * scale * rowSize
+ NSMinX (srcRect) * scale * bpp);
void *dstPixels = (char *) pixels
+ (int) (NSMinY (dstRect) * scale * rowSize
+ NSMinX (dstRect) * scale * bpp);
if (NSIntersectsRect (srcRect, dstRect)
&& NSMinY (srcRect) < NSMinY (dstRect))
for (int y = NSHeight (srcRect) * scale - 1 ; y >= 0 ; y--)
memmove (dstPixels + y * rowSize,
srcPixels + y * rowSize,
memmove ((char *) dstPixels + y * rowSize,
(char *) srcPixels + y * rowSize,
srcRowSize);
else
for (int y = 0 ; y < NSHeight (srcRect) * scale ; y++)
memmove (dstPixels + y * rowSize,
srcPixels + y * rowSize,
memmove ((char *) dstPixels + y * rowSize,
(char *) srcPixels + y * rowSize,
srcRowSize);
#if MAC_OS_X_VERSION_MIN_REQUIRED < 101400
@ -8742,7 +8752,8 @@ - (void)makeKeyAndOrderFront:(id)sender
/* The array returned by [NSWindow parentWindow] may already be
sorted, but the documentation doesn't tell us whether or not it is,
so to be safe we'll sort it. */
NSInteger nswindow_orderedIndex_sort (id w1, id w2, void *c)
static NSInteger
nswindow_orderedIndex_sort (id w1, id w2, void *c)
{
NSInteger i1 = [w1 orderedIndex];
NSInteger i2 = [w2 orderedIndex];