Browse Source

Minor clean-ups.

tags/2021-05-28
jules 12 years ago
parent
commit
6f88b7ae60
9 changed files with 20 additions and 27 deletions
  1. +3
    -3
      extras/Introjucer/Source/Application/jucer_FilePreviewComponent.h
  2. +1
    -3
      modules/juce_core/xml/juce_XmlDocument.cpp
  3. +5
    -3
      modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm
  4. +1
    -1
      modules/juce_gui_basics/buttons/juce_Button.cpp
  5. +1
    -1
      modules/juce_gui_basics/menus/juce_PopupMenu.h
  6. +2
    -2
      modules/juce_gui_basics/native/juce_mac_MainMenu.mm
  7. +1
    -3
      modules/juce_gui_basics/positioning/juce_MarkerList.cpp
  8. +1
    -1
      modules/juce_gui_basics/windows/juce_CallOutBox.h
  9. +5
    -10
      modules/juce_opengl/native/juce_OpenGL_android.h

+ 3
- 3
extras/Introjucer/Source/Application/jucer_FilePreviewComponent.h View File

@@ -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())


+ 1
- 3
modules/juce_core/xml/juce_XmlDocument.cpp View File

@@ -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;


+ 5
- 3
modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm View File

@@ -860,9 +860,11 @@ CGImageRef juce_createCoreGraphicsImage (const Image& juceImage, const bool forA
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

+ 1
- 1
modules/juce_gui_basics/buttons/juce_Button.cpp View File

@@ -295,7 +295,7 @@ void Button::clicked()
{
}
void Button::clicked (const ModifierKeys& /*modifiers*/)
void Button::clicked (const ModifierKeys&)
{
clicked();
}


+ 1
- 1
modules/juce_gui_basics/menus/juce_PopupMenu.h View File

@@ -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,


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

@@ -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];


+ 1
- 3
modules/juce_gui_basics/positioning/juce_MarkerList.cpp View File

@@ -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)
{


+ 1
- 1
modules/juce_gui_basics/windows/juce_CallOutBox.h View File

@@ -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


+ 5
- 10
modules/juce_opengl/native/juce_OpenGL_android.h View File

@@ -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();
}

Loading…
Cancel
Save