diff --git a/extras/Introjucer/Source/Application/jucer_FilePreviewComponent.h b/extras/Introjucer/Source/Application/jucer_FilePreviewComponent.h index 1ab818cefe..d2ceba826e 100644 --- a/extras/Introjucer/Source/Application/jucer_FilePreviewComponent.h +++ b/extras/Introjucer/Source/Application/jucer_FilePreviewComponent.h @@ -81,13 +81,13 @@ private: if (input != nullptr) { const int64 totalSize = input->getTotalLength(); - ImageFileFormat* format = ImageFileFormat::findImageFormatForStream (*input); - input = nullptr; String formatName; - if (format != nullptr) + if (ImageFileFormat* format = ImageFileFormat::findImageFormatForStream (*input)) formatName = " " + format->getFormatName(); + input = nullptr; + Image image (ImageCache::getFromFile (file)); if (image.isValid()) diff --git a/modules/juce_core/xml/juce_XmlDocument.cpp b/modules/juce_core/xml/juce_XmlDocument.cpp index 645d8360f1..92bd458a02 100644 --- a/modules/juce_core/xml/juce_XmlDocument.cpp +++ b/modules/juce_core/xml/juce_XmlDocument.cpp @@ -518,9 +518,7 @@ void XmlDocument::readChildElements (XmlElement* parent) else { // 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); else break; diff --git a/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm b/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm index 806a51e1f6..341533ae8c 100644 --- a/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm +++ b/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm @@ -860,9 +860,11 @@ CGImageRef juce_createCoreGraphicsImage (const Image& juceImage, const bool forA CGContextRef juce_getImageContext (const Image& image) { - CoreGraphicsImage* const cgi = dynamic_cast (image.getPixelData()); - jassert (cgi != nullptr); - return cgi != nullptr ? cgi->context : 0; + if (CoreGraphicsImage* const cgi = dynamic_cast (image.getPixelData())) + return cgi->context; + + jassertfalse; + return 0; } #endif diff --git a/modules/juce_gui_basics/buttons/juce_Button.cpp b/modules/juce_gui_basics/buttons/juce_Button.cpp index bf973e1bbd..3a1876a090 100644 --- a/modules/juce_gui_basics/buttons/juce_Button.cpp +++ b/modules/juce_gui_basics/buttons/juce_Button.cpp @@ -295,7 +295,7 @@ void Button::clicked() { } -void Button::clicked (const ModifierKeys& /*modifiers*/) +void Button::clicked (const ModifierKeys&) { clicked(); } diff --git a/modules/juce_gui_basics/menus/juce_PopupMenu.h b/modules/juce_gui_basics/menus/juce_PopupMenu.h index e0d4f2b1c6..c26d0e8602 100644 --- a/modules/juce_gui_basics/menus/juce_PopupMenu.h +++ b/modules/juce_gui_basics/menus/juce_PopupMenu.h @@ -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 */ class JUCE_API CustomComponent : public Component, diff --git a/modules/juce_gui_basics/native/juce_mac_MainMenu.mm b/modules/juce_gui_basics/native/juce_mac_MainMenu.mm index f150d8ee61..2af10542d7 100644 --- a/modules/juce_gui_basics/native/juce_mac_MainMenu.mm +++ b/modules/juce_gui_basics/native/juce_mac_MainMenu.mm @@ -585,7 +585,7 @@ namespace MainMenuHelpers // this can't be used in a plugin! jassert (JUCEApplication::isStandaloneApp()); - if (JUCEApplication::getInstance() != nullptr) + if (JUCEApplication* app = JUCEApplication::getInstance()) { JUCE_AUTORELEASEPOOL @@ -598,7 +598,7 @@ namespace MainMenuHelpers [mainMenu setSubmenu: appMenu forItem: item]; [NSApp setMainMenu: mainMenu]; - MainMenuHelpers::createStandardAppMenu (appMenu, JUCEApplication::getInstance()->getApplicationName(), extraItems); + MainMenuHelpers::createStandardAppMenu (appMenu, app->getApplicationName(), extraItems); [appMenu release]; [mainMenu release]; diff --git a/modules/juce_gui_basics/positioning/juce_MarkerList.cpp b/modules/juce_gui_basics/positioning/juce_MarkerList.cpp index d8b5c19f14..9015a1e855 100644 --- a/modules/juce_gui_basics/positioning/juce_MarkerList.cpp +++ b/modules/juce_gui_basics/positioning/juce_MarkerList.cpp @@ -104,9 +104,7 @@ MarkerList::Marker* MarkerList::getMarkerByName (const String& name) const noexc 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) { diff --git a/modules/juce_gui_basics/windows/juce_CallOutBox.h b/modules/juce_gui_basics/windows/juce_CallOutBox.h index e6c09ce343..c69e4e73bb 100644 --- a/modules/juce_gui_basics/windows/juce_CallOutBox.h +++ b/modules/juce_gui_basics/windows/juce_CallOutBox.h @@ -103,7 +103,7 @@ public: @param contentComponent the component to display inside the call-out. This should already have a size set (although the call-out will also 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. @param areaToPointTo the area that the call-out's arrow should point towards. If a parentComponent is supplied, then this is relative to that diff --git a/modules/juce_opengl/native/juce_OpenGL_android.h b/modules/juce_opengl/native/juce_OpenGL_android.h index cb3eb8e9ba..4032265c63 100644 --- a/modules/juce_opengl/native/juce_OpenGL_android.h +++ b/modules/juce_opengl/native/juce_OpenGL_android.h @@ -162,25 +162,20 @@ JUCE_JNI_CALLBACK (GL_VIEW_CLASS_NAME, contextCreated, void, (JNIEnv* env, jobje { 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(); + else + jassertfalse; } 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(); } 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(); }