| @@ -81,13 +81,13 @@ private: | |||||
| if (input != nullptr) | if (input != nullptr) | ||||
| { | { | ||||
| const int64 totalSize = input->getTotalLength(); | const int64 totalSize = input->getTotalLength(); | ||||
| ImageFileFormat* format = ImageFileFormat::findImageFormatForStream (*input); | |||||
| input = nullptr; | |||||
| String formatName; | String formatName; | ||||
| if (format != nullptr) | |||||
| if (ImageFileFormat* format = ImageFileFormat::findImageFormatForStream (*input)) | |||||
| formatName = " " + format->getFormatName(); | formatName = " " + format->getFormatName(); | ||||
| input = nullptr; | |||||
| Image image (ImageCache::getFromFile (file)); | Image image (ImageCache::getFromFile (file)); | ||||
| if (image.isValid()) | if (image.isValid()) | ||||
| @@ -518,9 +518,7 @@ void XmlDocument::readChildElements (XmlElement* parent) | |||||
| else | else | ||||
| { | { | ||||
| // this is some other element, so parse and add it.. | // this is some other element, so parse and add it.. | ||||
| XmlElement* const n = readNextElement (true); | |||||
| if (n != nullptr) | |||||
| if (XmlElement* const n = readNextElement (true)) | |||||
| childAppender.append (n); | childAppender.append (n); | ||||
| else | else | ||||
| break; | break; | ||||
| @@ -860,9 +860,11 @@ CGImageRef juce_createCoreGraphicsImage (const Image& juceImage, const bool forA | |||||
| CGContextRef juce_getImageContext (const Image& image) | CGContextRef juce_getImageContext (const Image& image) | ||||
| { | { | ||||
| CoreGraphicsImage* const cgi = dynamic_cast <CoreGraphicsImage*> (image.getPixelData()); | |||||
| jassert (cgi != nullptr); | |||||
| return cgi != nullptr ? cgi->context : 0; | |||||
| if (CoreGraphicsImage* const cgi = dynamic_cast <CoreGraphicsImage*> (image.getPixelData())) | |||||
| return cgi->context; | |||||
| jassertfalse; | |||||
| return 0; | |||||
| } | } | ||||
| #endif | #endif | ||||
| @@ -295,7 +295,7 @@ void Button::clicked() | |||||
| { | { | ||||
| } | } | ||||
| void Button::clicked (const ModifierKeys& /*modifiers*/) | |||||
| void Button::clicked (const ModifierKeys&) | |||||
| { | { | ||||
| clicked(); | clicked(); | ||||
| } | } | ||||
| @@ -424,7 +424,7 @@ public: | |||||
| }; | }; | ||||
| //============================================================================== | //============================================================================== | ||||
| /** A user-defined copmonent that can be used as an item in a popup menu. | |||||
| /** A user-defined component that can be used as an item in a popup menu. | |||||
| @see PopupMenu::addCustomItem | @see PopupMenu::addCustomItem | ||||
| */ | */ | ||||
| class JUCE_API CustomComponent : public Component, | class JUCE_API CustomComponent : public Component, | ||||
| @@ -585,7 +585,7 @@ namespace MainMenuHelpers | |||||
| // this can't be used in a plugin! | // this can't be used in a plugin! | ||||
| jassert (JUCEApplication::isStandaloneApp()); | jassert (JUCEApplication::isStandaloneApp()); | ||||
| if (JUCEApplication::getInstance() != nullptr) | |||||
| if (JUCEApplication* app = JUCEApplication::getInstance()) | |||||
| { | { | ||||
| JUCE_AUTORELEASEPOOL | JUCE_AUTORELEASEPOOL | ||||
| @@ -598,7 +598,7 @@ namespace MainMenuHelpers | |||||
| [mainMenu setSubmenu: appMenu forItem: item]; | [mainMenu setSubmenu: appMenu forItem: item]; | ||||
| [NSApp setMainMenu: mainMenu]; | [NSApp setMainMenu: mainMenu]; | ||||
| MainMenuHelpers::createStandardAppMenu (appMenu, JUCEApplication::getInstance()->getApplicationName(), extraItems); | |||||
| MainMenuHelpers::createStandardAppMenu (appMenu, app->getApplicationName(), extraItems); | |||||
| [appMenu release]; | [appMenu release]; | ||||
| [mainMenu release]; | [mainMenu release]; | ||||
| @@ -104,9 +104,7 @@ MarkerList::Marker* MarkerList::getMarkerByName (const String& name) const noexc | |||||
| void MarkerList::setMarker (const String& name, const RelativeCoordinate& position) | void MarkerList::setMarker (const String& name, const RelativeCoordinate& position) | ||||
| { | { | ||||
| Marker* const m = getMarkerByName (name); | |||||
| if (m != nullptr) | |||||
| if (Marker* const m = getMarkerByName (name)) | |||||
| { | { | ||||
| if (m->position != position) | if (m->position != position) | ||||
| { | { | ||||
| @@ -103,7 +103,7 @@ public: | |||||
| @param contentComponent the component to display inside the call-out. This should | @param contentComponent the component to display inside the call-out. This should | ||||
| already have a size set (although the call-out will also | already have a size set (although the call-out will also | ||||
| update itself when the component's size is changed later). | update itself when the component's size is changed later). | ||||
| This copmonent will be owned by the callout box and deleted | |||||
| This component will be owned by the callout box and deleted | |||||
| later when the box is dismissed. | later when the box is dismissed. | ||||
| @param areaToPointTo the area that the call-out's arrow should point towards. If | @param areaToPointTo the area that the call-out's arrow should point towards. If | ||||
| a parentComponent is supplied, then this is relative to that | a parentComponent is supplied, then this is relative to that | ||||
| @@ -162,25 +162,20 @@ JUCE_JNI_CALLBACK (GL_VIEW_CLASS_NAME, contextCreated, void, (JNIEnv* env, jobje | |||||
| { | { | ||||
| threadLocalJNIEnvHolder.getOrAttach(); | threadLocalJNIEnvHolder.getOrAttach(); | ||||
| OpenGLContext::NativeContext* const context = OpenGLContext::NativeContext::findContextFor (env, view); | |||||
| jassert (context != nullptr); | |||||
| if (context != nullptr) | |||||
| if (OpenGLContext::NativeContext* const context = OpenGLContext::NativeContext::findContextFor (env, view)) | |||||
| context->contextCreatedCallback(); | context->contextCreatedCallback(); | ||||
| else | |||||
| jassertfalse; | |||||
| } | } | ||||
| JUCE_JNI_CALLBACK (GL_VIEW_CLASS_NAME, contextChangedSize, void, (JNIEnv* env, jobject view)) | JUCE_JNI_CALLBACK (GL_VIEW_CLASS_NAME, contextChangedSize, void, (JNIEnv* env, jobject view)) | ||||
| { | { | ||||
| OpenGLContext::NativeContext* const context = OpenGLContext::NativeContext::findContextFor (env, view); | |||||
| if (context != nullptr) | |||||
| if (OpenGLContext::NativeContext* const context = OpenGLContext::NativeContext::findContextFor (env, view)) | |||||
| context->contextChangedSize(); | context->contextChangedSize(); | ||||
| } | } | ||||
| JUCE_JNI_CALLBACK (GL_VIEW_CLASS_NAME, render, void, (JNIEnv* env, jobject view)) | JUCE_JNI_CALLBACK (GL_VIEW_CLASS_NAME, render, void, (JNIEnv* env, jobject view)) | ||||
| { | { | ||||
| OpenGLContext::NativeContext* const context = OpenGLContext::NativeContext::findContextFor (env, view); | |||||
| if (context != nullptr) | |||||
| if (OpenGLContext::NativeContext* const context = OpenGLContext::NativeContext::findContextFor (env, view)) | |||||
| context->renderCallback(); | context->renderCallback(); | ||||
| } | } | ||||