Browse Source

Cleaned up some pedantic warnings in the iOS build.

tags/2021-05-28
jules 12 years ago
parent
commit
c62da6c983
9 changed files with 69 additions and 40 deletions
  1. +2
    -2
      modules/juce_core/native/juce_mac_Files.mm
  2. +5
    -0
      modules/juce_core/native/juce_mac_Network.mm
  3. +3
    -2
      modules/juce_events/native/juce_ios_MessageManager.mm
  4. +20
    -6
      modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm
  5. +16
    -11
      modules/juce_gui_basics/native/juce_ios_Windowing.mm
  6. +10
    -10
      modules/juce_gui_basics/native/juce_mac_FileChooser.mm
  7. +2
    -2
      modules/juce_gui_basics/native/juce_mac_MouseCursor.mm
  8. +4
    -0
      modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm
  9. +7
    -7
      modules/juce_opengl/native/juce_OpenGL_ios.h

+ 2
- 2
modules/juce_core/native/juce_mac_Files.mm View File

@@ -101,7 +101,7 @@ namespace FileHelpers
}
#if JUCE_IOS
String getIOSSystemLocation (NSSearchPathDirectory type)
static String getIOSSystemLocation (NSSearchPathDirectory type)
{
return nsStringToJuce ([NSSearchPathForDirectoriesInDomains (type, NSUserDomainMask, YES)
objectAtIndex: 0]);
@@ -392,7 +392,7 @@ bool DirectoryIterator::NativeIterator::next (String& filenameFound,
//==============================================================================
bool JUCE_CALLTYPE Process::openDocument (const String& fileName, const String& parameters)
bool JUCE_CALLTYPE Process::openDocument (const String& fileName, const String& /*parameters*/)
{
JUCE_AUTORELEASEPOOL
{


+ 5
- 0
modules/juce_core/native/juce_mac_Network.mm View File

@@ -59,6 +59,11 @@ bool JUCE_CALLTYPE Process::openEmailWithAttachments (const String& targetEmailA
const StringArray& filesToAttach)
{
#if JUCE_IOS
(void) targetEmailAddress;
(void) emailSubject;
(void) bodyText;
(void) filesToAttach;
//xxx probably need to use MFMailComposeViewController
jassertfalse;
return false;


+ 3
- 2
modules/juce_events/native/juce_ios_MessageManager.mm View File

@@ -40,7 +40,7 @@ bool MessageManager::runDispatchLoopUntil (int millisecondsToRunFor)
{
jassert (isThisTheMessageThread()); // must only be called by the message thread
uint32 endTime = Time::getMillisecondCounter() + millisecondsToRunFor;
uint32 startTime = Time::getMillisecondCounter();
NSDate* endDate = [NSDate dateWithTimeIntervalSinceNow: millisecondsToRunFor * 0.001];
while (! quitMessagePosted)
@@ -50,7 +50,8 @@ bool MessageManager::runDispatchLoopUntil (int millisecondsToRunFor)
[[NSRunLoop currentRunLoop] runMode: NSDefaultRunLoopMode
beforeDate: endDate];
if (millisecondsToRunFor >= 0 && Time::getMillisecondCounter() >= endTime)
if (millisecondsToRunFor >= 0
&& Time::getMillisecondCounter() >= startTime + (uint32) millisecondsToRunFor)
break;
}
}


+ 20
- 6
modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm View File

@@ -287,11 +287,16 @@ private:
- (void) willRotateToInterfaceOrientation: (UIInterfaceOrientation) toInterfaceOrientation
duration: (NSTimeInterval) duration
{
(void) toInterfaceOrientation;
(void) duration;
[UIView setAnimationsEnabled: NO]; // disable this because it goes the wrong way and looks like crap.
}
- (void) didRotateFromInterfaceOrientation: (UIInterfaceOrientation) fromInterfaceOrientation
{
(void) fromInterfaceOrientation;
JuceUIView* juceView = (JuceUIView*) [self view];
jassert (juceView != nil && juceView->owner != nullptr);
juceView->owner->updateTransformAndScreenBounds();
@@ -308,11 +313,13 @@ private:
- (void) viewWillAppear: (BOOL) animated
{
(void) animated;
[self viewDidLoad];
}
- (void) viewDidAppear: (BOOL) animated
{
(void) animated;
[self viewDidLoad];
}
@@ -354,18 +361,24 @@ private:
//==============================================================================
- (void) touchesBegan: (NSSet*) touches withEvent: (UIEvent*) event
{
(void) touches;
if (owner != nullptr)
owner->handleTouches (event, true, false, false);
}
- (void) touchesMoved: (NSSet*) touches withEvent: (UIEvent*) event
{
(void) touches;
if (owner != nullptr)
owner->handleTouches (event, false, false, false);
}
- (void) touchesEnded: (NSSet*) touches withEvent: (UIEvent*) event
{
(void) touches;
if (owner != nullptr)
owner->handleTouches (event, false, true, false);
}
@@ -402,7 +415,8 @@ private:
- (BOOL) textView: (UITextView*) textView shouldChangeTextInRange: (NSRange) range replacementText: (NSString*) text
{
return owner->textViewReplaceCharacters (Range<int> (range.location, range.location + range.length),
(void) textView;
return owner->textViewReplaceCharacters (Range<int> ((int) range.location, (int) (range.location + range.length)),
nsStringToJuce (text));
}
@@ -432,7 +446,7 @@ private:
namespace juce
{
bool KeyPress::isKeyCurrentlyDown (const int keyCode)
bool KeyPress::isKeyCurrentlyDown (int)
{
return false;
}
@@ -534,7 +548,7 @@ void UIViewComponentPeer::setVisible (bool shouldBeVisible)
window.hidden = ! shouldBeVisible;
}
void UIViewComponentPeer::setTitle (const String& title)
void UIViewComponentPeer::setTitle (const String&)
{
// xxx is this possible?
}
@@ -669,7 +683,7 @@ void UIViewComponentPeer::toFront (bool makeActiveWindow)
if (isSharedWindow)
[[view superview] bringSubviewToFront: view];
if (window != nil && component.isVisible())
if (makeActiveWindow && window != nil && component.isVisible())
[window makeKeyAndVisible];
}
@@ -876,14 +890,14 @@ bool UIViewComponentPeer::canBecomeKeyWindow()
}
//==============================================================================
void Desktop::setKioskComponent (Component* kioskModeComponent, bool enableOrDisable, bool allowMenusAndBars)
void Desktop::setKioskComponent (Component* kioskModeComp, bool enableOrDisable, bool /*allowMenusAndBars*/)
{
[[UIApplication sharedApplication] setStatusBarHidden: enableOrDisable
withAnimation: UIStatusBarAnimationSlide];
displays->refresh();
if (ComponentPeer* const peer = kioskModeComponent->getPeer())
if (ComponentPeer* const peer = kioskModeComp->getPeer())
peer->setFullScreen (enableOrDisable);
}


+ 16
- 11
modules/juce_gui_basics/native/juce_ios_Windowing.mm View File

@@ -39,6 +39,7 @@
- (void) applicationDidFinishLaunching: (UIApplication*) application
{
(void) application;
initialiseJuce_GUI();
JUCEApplicationBase* app = JUCEApplicationBase::createInstance();
@@ -49,17 +50,20 @@
- (void) applicationWillTerminate: (UIApplication*) application
{
(void) application;
JUCEApplicationBase::appWillTerminateByForce();
}
- (void) applicationDidEnterBackground: (UIApplication*) application
{
(void) application;
if (JUCEApplicationBase* const app = JUCEApplicationBase::getInstance())
app->suspended();
}
- (void) applicationWillEnterForeground: (UIApplication*) application
{
(void) application;
if (JUCEApplicationBase* const app = JUCEApplicationBase::getInstance())
app->resumed();
}
@@ -69,6 +73,7 @@
namespace juce
{
int juce_iOSMain (int argc, const char* argv[]);
int juce_iOSMain (int argc, const char* argv[])
{
return UIApplicationMain (argc, const_cast<char**> (argv), nil, @"JuceAppStartupDelegate");
@@ -177,9 +182,9 @@ namespace juce
//==============================================================================
#if JUCE_MODAL_LOOPS_PERMITTED
void JUCE_CALLTYPE NativeMessageBox::showMessageBox (AlertWindow::AlertIconType iconType,
void JUCE_CALLTYPE NativeMessageBox::showMessageBox (AlertWindow::AlertIconType /*iconType*/,
const String& title, const String& message,
Component* associatedComponent)
Component* /*associatedComponent*/)
{
JUCE_AUTORELEASEPOOL
{
@@ -189,17 +194,17 @@ void JUCE_CALLTYPE NativeMessageBox::showMessageBox (AlertWindow::AlertIconType
}
#endif
void JUCE_CALLTYPE NativeMessageBox::showMessageBoxAsync (AlertWindow::AlertIconType iconType,
void JUCE_CALLTYPE NativeMessageBox::showMessageBoxAsync (AlertWindow::AlertIconType /*iconType*/,
const String& title, const String& message,
Component* associatedComponent,
Component* /*associatedComponent*/,
ModalComponentManager::Callback* callback)
{
new iOSMessageBox (title, message, @"OK", nil, nil, callback, true);
}
bool JUCE_CALLTYPE NativeMessageBox::showOkCancelBox (AlertWindow::AlertIconType iconType,
bool JUCE_CALLTYPE NativeMessageBox::showOkCancelBox (AlertWindow::AlertIconType /*iconType*/,
const String& title, const String& message,
Component* associatedComponent,
Component* /*associatedComponent*/,
ModalComponentManager::Callback* callback)
{
ScopedPointer<iOSMessageBox> mb (new iOSMessageBox (title, message, @"Cancel", @"OK",
@@ -212,9 +217,9 @@ bool JUCE_CALLTYPE NativeMessageBox::showOkCancelBox (AlertWindow::AlertIconType
return false;
}
int JUCE_CALLTYPE NativeMessageBox::showYesNoCancelBox (AlertWindow::AlertIconType iconType,
int JUCE_CALLTYPE NativeMessageBox::showYesNoCancelBox (AlertWindow::AlertIconType /*iconType*/,
const String& title, const String& message,
Component* associatedComponent,
Component* /*associatedComponent*/,
ModalComponentManager::Callback* callback)
{
ScopedPointer<iOSMessageBox> mb (new iOSMessageBox (title, message, @"Cancel", @"Yes", @"No", callback, callback != nullptr));
@@ -227,13 +232,13 @@ int JUCE_CALLTYPE NativeMessageBox::showYesNoCancelBox (AlertWindow::AlertIconTy
}
//==============================================================================
bool DragAndDropContainer::performExternalDragDropOfFiles (const StringArray& files, const bool canMoveFiles)
bool DragAndDropContainer::performExternalDragDropOfFiles (const StringArray&, bool)
{
jassertfalse; // no such thing on iOS!
return false;
}
bool DragAndDropContainer::performExternalDragDropOfText (const String& text)
bool DragAndDropContainer::performExternalDragDropOfText (const String&)
{
jassertfalse; // no such thing on iOS!
return false;
@@ -257,7 +262,7 @@ bool juce_areThereAnyAlwaysOnTopWindows()
}
//==============================================================================
Image juce_createIconForFile (const File& file)
Image juce_createIconForFile (const File&)
{
return Image::null;
}


+ 10
- 10
modules/juce_gui_basics/native/juce_mac_FileChooser.mm View File

@@ -209,16 +209,16 @@ bool FileChooser::isPlatformDialogAvailable()
return false;
}
void FileChooser::showPlatformDialog (Array<File>& results,
const String& title,
const File& currentFileOrDirectory,
const String& filter,
bool selectsDirectory,
bool selectsFiles,
bool isSaveDialogue,
bool warnAboutOverwritingExistingFiles,
bool selectMultipleFiles,
FilePreviewComponent* extraInfoComponent)
void FileChooser::showPlatformDialog (Array<File>&,
const String& /*title*/,
const File& /*currentFileOrDirectory*/,
const String& /*filter*/,
bool /*selectsDirectory*/,
bool /*selectsFiles*/,
bool /*isSaveDialogue*/,
bool /*warnAboutOverwritingExistingFiles*/,
bool /*selectMultipleFiles*/,
FilePreviewComponent*)
{
jassertfalse; //there's no such thing in iOS
}


+ 2
- 2
modules/juce_gui_basics/native/juce_mac_MouseCursor.mm View File

@@ -146,8 +146,8 @@ void MouseCursor::showInWindow (ComponentPeer*) const
#else
void* CustomMouseCursorInfo::create() const { return nullptr; }
void* MouseCursor::createStandardMouseCursor (MouseCursor::StandardCursorType type) { return nullptr; }
void MouseCursor::deleteMouseCursor (void* const cursorHandle, const bool isStandard) {}
void* MouseCursor::createStandardMouseCursor (MouseCursor::StandardCursorType) { return nullptr; }
void MouseCursor::deleteMouseCursor (void*, bool) {}
void MouseCursor::showInAllWindows() const {}
void MouseCursor::showInWindow (ComponentPeer*) const {}


+ 4
- 0
modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm View File

@@ -80,6 +80,8 @@ private:
- (BOOL) gestureRecognizer: (UIGestureRecognizer*) gestureRecognizer
shouldRecognizeSimultaneouslyWithGestureRecognizer: (UIGestureRecognizer*) otherGestureRecognizer
{
(void) gestureRecognizer;
(void) otherGestureRecognizer;
return YES;
}
@@ -106,6 +108,8 @@ private:
- (BOOL) webView: (UIWebView*) webView shouldStartLoadWithRequest: (NSURLRequest*) request navigationType: (UIWebViewNavigationType) navigationType
{
(void) webView;
(void) navigationType;
return ownerComponent->pageAboutToLoad (nsStringToJuce (request.URL.absoluteString));
}
@end


+ 7
- 7
modules/juce_opengl/native/juce_OpenGL_ios.h View File

@@ -44,14 +44,14 @@ class OpenGLContext::NativeContext
{
public:
NativeContext (Component& component,
const OpenGLPixelFormat& pixelFormat,
void* contextToShareWith,
bool useMultisampling)
const OpenGLPixelFormat& pixFormat,
void* contextToShare,
bool multisampling)
: frameBufferHandle (0), colorBufferHandle (0), depthBufferHandle (0),
msaaColorHandle (0), msaaBufferHandle (0),
lastWidth (0), lastHeight (0), needToRebuildBuffers (false),
swapFrames (0), useDepthBuffer (pixelFormat.depthBufferBits > 0),
useMSAA (useMultisampling)
swapFrames (0), useDepthBuffer (pixFormat.depthBufferBits > 0),
useMSAA (multisampling)
{
JUCE_AUTORELEASEPOOL
{
@@ -78,8 +78,8 @@ public:
const NSUInteger type = kEAGLRenderingAPIOpenGLES2;
if (contextToShareWith != nullptr)
[context initWithAPI: type sharegroup: [(EAGLContext*) contextToShareWith sharegroup]];
if (contextToShare != nullptr)
[context initWithAPI: type sharegroup: [(EAGLContext*) contextToShare sharegroup]];
else
[context initWithAPI: type];


Loading…
Cancel
Save