Skip to content

Commit 41d77ef

Browse files
committed
Resolved/suppressed compiler warnings in JUCE OS X code
1 parent fd94609 commit 41d77ef

5 files changed

Lines changed: 19 additions & 1 deletion

File tree

JuceLibraryCode/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ static CGBitmapInfo getCGImageFlags (const Image::PixelFormat& format)
507507
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
508508
// There's a bug in CGContextDrawTiledImage that makes it incredibly slow
509509
// if it's doing a transformation - it's quicker to just draw lots of images manually
510-
if (CGContextDrawTiledImage != 0 && transform.isOnlyTranslation())
510+
if (&CGContextDrawTiledImage != 0 && transform.isOnlyTranslation())
511511
CGContextDrawTiledImage (context, imageRect, image);
512512
else
513513
#endif

JuceLibraryCode/modules/juce_gui_basics/native/juce_mac_FileChooser.mm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,10 @@ static BOOL shouldShowFilename (id self, SEL, id /*sender*/, NSString* filename)
172172
[panel setDirectoryURL: [NSURL fileURLWithPath: juceStringToNS (directory)]];
173173
[panel setNameFieldStringValue: juceStringToNS (filename)];
174174

175+
#pragma GCC diagnostic push
176+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
175177
if ([panel runModal] == NSOKButton)
178+
#pragma GCC diagnostic pop
176179
#else
177180
if ([panel runModalForDirectory: juceStringToNS (directory)
178181
file: juceStringToNS (filename)] == NSOKButton)

JuceLibraryCode/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,10 @@ void redirectMouseMove (NSEvent* ev)
555555

556556
#if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
557557
if ([NSWindow respondsToSelector: @selector (windowNumberAtPoint:belowWindowWithWindowNumber:)]
558+
#pragma GCC diagnostic push
559+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
558560
&& [NSWindow windowNumberAtPoint: [[ev window] convertBaseToScreen: [ev locationInWindow]]
561+
#pragma GCC diagnostic pop
559562
belowWindowWithWindowNumber: 0] != [window windowNumber])
560563
{
561564
// moved into another window which overlaps this one, so trigger an exit

JuceLibraryCode/modules/juce_gui_basics/native/juce_mac_Windowing.mm

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,11 @@ int getResult() const
4545
{
4646
switch (getRawResult())
4747
{
48+
#pragma GCC diagnostic push
49+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
4850
case NSAlertDefaultReturn: return 1;
4951
case NSAlertOtherReturn: return 2;
52+
#pragma GCC diagnostic pop
5053
default: return 0;
5154
}
5255
}
@@ -97,9 +100,12 @@ NSInteger getRawResult() const
97100

98101
switch (iconType)
99102
{
103+
#pragma GCC diagnostic push
104+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
100105
case AlertWindow::InfoIcon: return NSRunInformationalAlertPanel (ttl, msg, b1, b2, b3);
101106
case AlertWindow::WarningIcon: return NSRunCriticalAlertPanel (ttl, msg, b1, b2, b3);
102107
default: return NSRunAlertPanel (ttl, msg, b1, b2, b3);
108+
#pragma GCC diagnostic pop
103109
}
104110
}
105111
};
@@ -185,13 +191,16 @@ NSInteger getRawResult() const
185191
dragPosition.x -= 16;
186192
dragPosition.y -= 16;
187193

194+
#pragma GCC diagnostic push
195+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
188196
[view dragImage: [[NSWorkspace sharedWorkspace] iconForFile: juceStringToNS (files[0])]
189197
at: dragPosition
190198
offset: NSMakeSize (0, 0)
191199
event: [[view window] currentEvent]
192200
pasteboard: pboard
193201
source: view
194202
slideBack: YES];
203+
#pragma GCC diagnostic pop
195204
}
196205

197206
return true;

JuceLibraryCode/modules/juce_opengl/native/juce_OpenGL_osx.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ class OpenGLContext::NativeContext
4040
NSOpenGLPFAOpenGLProfile, version >= openGL3_2 ? NSOpenGLProfileVersion3_2Core : NSOpenGLProfileVersionLegacy,
4141
#endif
4242
NSOpenGLPFADoubleBuffer,
43+
#pragma GCC diagnostic push
44+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
4345
NSOpenGLPFAMPSafe,
46+
#pragma GCC diagnostic pop
4447
NSOpenGLPFAClosestPolicy,
4548
NSOpenGLPFANoRecovery,
4649
NSOpenGLPFAColorSize, (NSOpenGLPixelFormatAttribute) (pixFormat.redBits + pixFormat.greenBits + pixFormat.blueBits),

0 commit comments

Comments
 (0)