Fix potential wrong-over-optimization in math utilities
[carla.git] / data / patches / qt55-newosx-fix.patch
blobdd9c098bc2bd3cdc7f61ed8f352bc8b5963d2d9b
1 From 0707260a4f8e64dfadf1df5f935e74cabb7c7d27 Mon Sep 17 00:00:00 2001
2 From: Jake Petroules <jake.petroules@qt.io>
3 Date: Sun, 1 Oct 2017 21:48:17 -0700
4 Subject: [PATCH] Fix build error with macOS 10.13 SDK
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=utf8
7 Content-Transfer-Encoding: 8bit
9 Several of these variables/macros are no longer defined. We didn't
10 validate the preconditions on iOS, tvOS, or watchOS, so no
11 need to bother validating them on macOS either. Nor did we check the
12 OSStatus result on any platform anyways.
14 Task-number: QTBUG-63401
15 Change-Id: Ife64dff767cf6d3f4b839fc53ec486181c176bf3
16 (cherry-picked from 861544583511d4e6f7745d2339b26ff1cd44132b)
17 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
18 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
19 ---
20 src/plugins/platforms/cocoa/qcocoahelpers.h | 2 +-
21 src/plugins/platforms/cocoa/qcocoahelpers.mm | 13 +------------
22 2 files changed, 2 insertions(+), 13 deletions(-)
24 diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.h b/src/plugins/platforms/cocoa/qcocoahelpers.h
25 index bbb3793..74371d5 100644
26 --- a/src/plugins/platforms/cocoa/qcocoahelpers.h
27 +++ b/src/plugins/platforms/cocoa/qcocoahelpers.h
28 @@ -80,7 +80,7 @@ QColor qt_mac_toQColor(CGColorRef color);
29 // Creates a mutable shape, it's the caller's responsibility to release.
30 HIMutableShapeRef qt_mac_QRegionToHIMutableShape(const QRegion &region);
32 -OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage);
33 +void qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage);
35 NSDragOperation qt_mac_mapDropAction(Qt::DropAction action);
36 NSDragOperation qt_mac_mapDropActions(Qt::DropActions actions);
37 diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm
38 index cd73148..3f8429e 100644
39 --- a/src/plugins/platforms/cocoa/qcocoahelpers.mm
40 +++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm
41 @@ -544,15 +544,8 @@ NSRect qt_mac_flipRect(const QRect &rect)
42 return NSMakeRect(rect.x(), flippedY, rect.width(), rect.height());
45 -OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage)
46 +void qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage)
48 - // Verbatim copy if HIViewDrawCGImage (as shown on Carbon-Dev)
49 - OSStatus err = noErr;
51 - require_action(inContext != NULL, InvalidContext, err = paramErr);
52 - require_action(inBounds != NULL, InvalidBounds, err = paramErr);
53 - require_action(inImage != NULL, InvalidImage, err = paramErr);
55 CGContextSaveGState( inContext );
56 CGContextTranslateCTM (inContext, 0, inBounds->origin.y + CGRectGetMaxY(*inBounds));
57 CGContextScaleCTM(inContext, 1, -1);
58 @@ -560,10 +553,6 @@ OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGIm
59 CGContextDrawImage(inContext, *inBounds, inImage);
61 CGContextRestoreGState(inContext);
62 -InvalidImage:
63 -InvalidBounds:
64 -InvalidContext:
65 - return err;
68 Qt::MouseButton cocoaButton2QtButton(NSInteger buttonNum)
69 --
70 2.7.4
72 diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
73 index 7e1dfd9..674c037 100644
74 --- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
75 +++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
76 @@ -736,7 +736,7 @@ void QCoreTextFontEngine::getUnscaledGlyph(glyph_t glyph, QPainterPath *path, gl
78 QFixed QCoreTextFontEngine::emSquareSize() const
80 - return QFixed::QFixed(int(CTFontGetUnitsPerEm(ctfont)));
81 + return QFixed(int(CTFontGetUnitsPerEm(ctfont)));
84 QFontEngine *QCoreTextFontEngine::cloneWithSize(qreal pixelSize) const