[gtk/gtk-3-24] Remove unnecessary casts and silence may-not-return-value warning.
- From: John Ralls <jralls src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gtk-3-24] Remove unnecessary casts and silence may-not-return-value warning.
- Date: Tue, 19 Feb 2019 19:08:52 +0000 (UTC)
commit f3b1704a99b4afd88cce2021a428f3262c951dd6
Author: John Ralls <jralls ceridwen us>
Date: Tue Feb 19 10:52:43 2019 -0800
Remove unnecessary casts and silence may-not-return-value warning.
NSPoint and NSRect are typedefs of CGPoint and CGRect so the casts
were unnecessary and confused llvm when compiling 32-bit.
Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1640
gdk/quartz/GdkQuartzNSWindow.c | 38 ++++++++++++++++----------------------
1 file changed, 16 insertions(+), 22 deletions(-)
---
diff --git a/gdk/quartz/GdkQuartzNSWindow.c b/gdk/quartz/GdkQuartzNSWindow.c
index 89f42e771b..92fb8079bd 100644
--- a/gdk/quartz/GdkQuartzNSWindow.c
+++ b/gdk/quartz/GdkQuartzNSWindow.c
@@ -384,40 +384,34 @@
{
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
if (gdk_quartz_osx_version () >= GDK_OSX_MOJAVE)
- {
- return [super convertPointToScreen: point];
- }
+ return [super convertPointToScreen: point];
#endif
- if (gdk_quartz_osx_version () >= GDK_OSX_LION)
- {
- NSRect inrect = NSMakeRect (point.x, point.y, 0.0, 0.0);
- NSRect outrect = [self convertRectToScreen: inrect];
- return (NSPoint)((CGRect)outrect).origin;
- }
-
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
- return [self convertBaseToScreen:point];
+ if (gdk_quartz_osx_version () < GDK_OSX_LION)
+ return [self convertBaseToScreen:point];
#endif
+ {
+ NSRect inrect = NSMakeRect (point.x, point.y, 0.0, 0.0);
+ NSRect outrect = [self convertRectToScreen: inrect];
+ return outrect.origin;
+ }
}
- (NSPoint)convertPointFromScreen:(NSPoint)point
{
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
if (gdk_quartz_osx_version () >= GDK_OSX_MOJAVE)
- {
- return [super convertPointFromScreen: point];
- }
+ return [super convertPointFromScreen: point];
#endif
- if (gdk_quartz_osx_version () >= GDK_OSX_LION)
- {
- NSRect inrect = NSMakeRect (point.x, point.y, 0.0, 0.0);
- NSRect outrect = [self convertRectFromScreen: inrect];
- return (NSPoint)((CGRect)outrect).origin;
- }
-
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
- return [self convertScreenToBase:point];
+ if (gdk_quartz_osx_version () < GDK_OSX_LION)
+ return [self convertScreenToBase:point];
#endif
+ {
+ NSRect inrect = NSMakeRect (point.x, point.y, 0.0, 0.0);
+ NSRect outrect = [self convertRectFromScreen: inrect];
+ return outrect.origin;
+ }
}
- (BOOL)trackManualMove
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]