Browse Source

Cranked up the Clang warning level in the projucer, and fixed a few minor warnings

tags/2021-05-28
jules 7 years ago
parent
commit
7d24b39f18
12 changed files with 38 additions and 42 deletions
  1. +2
    -2
      extras/Projucer/Builds/MacOSX/Projucer.xcodeproj/project.pbxproj
  2. +1
    -1
      extras/Projucer/Projucer.jucer
  3. +1
    -1
      extras/Projucer/Source/ComponentEditor/Documents/jucer_ButtonDocument.cpp
  4. +7
    -4
      extras/Projucer/Source/ComponentEditor/UI/jucer_JucerDocumentEditor.cpp
  5. +6
    -5
      extras/Projucer/Source/ComponentEditor/jucer_JucerDocument.cpp
  6. +1
    -0
      extras/Projucer/Source/LiveBuildEngine/jucer_CompileEngineServer.cpp
  7. +2
    -2
      extras/Projucer/Source/Project/UI/jucer_ProjectContentComponent.cpp
  8. +2
    -2
      extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Android.h
  9. +0
    -12
      extras/Projucer/Source/Utility/Helpers/jucer_FileHelpers.cpp
  10. +1
    -0
      extras/Projucer/Source/Wizards/jucer_NewProjectWizardClasses.cpp
  11. +2
    -2
      modules/juce_core/zip/juce_ZipFile.cpp
  12. +13
    -11
      modules/juce_events/messages/juce_Initialisation.h

+ 2
- 2
extras/Projucer/Builds/MacOSX/Projucer.xcodeproj/project.pbxproj View File

@@ -784,7 +784,7 @@
INSTALL_PATH = "$(HOME)/Applications";
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET_ppc = 10.4;
OTHER_CPLUSPLUSFLAGS = "-Wall -Wshadow -Wstrict-aliasing -Wconversion -Wsign-compare -Woverloaded-virtual -Wextra-semi";
OTHER_CPLUSPLUSFLAGS = "-Wall -Wshadow -Wno-missing-field-initializers -Wshadow -Wshorten-64-to-32 -Wstrict-aliasing -Wuninitialized -Wunused-parameter -Wconversion -Wsign-compare -Wint-conversion -Wconditional-uninitialized -Woverloaded-virtual -Wreorder -Wconstant-conversion -Wsign-conversion -Wunused-private-field -Wbool-conversion -Wextra-semi -Wno-ignored-qualifiers -Wunreachable-code";
PRODUCT_BUNDLE_IDENTIFIER = com.juce.theprojucer;
SDKROOT_ppc = macosx10.5;
USE_HEADERMAP = NO; }; name = Debug; };
@@ -819,7 +819,7 @@
LLVM_LTO = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET_ppc = 10.4;
OTHER_CPLUSPLUSFLAGS = "-Wall -Wshadow -Wstrict-aliasing -Wconversion -Wsign-compare -Woverloaded-virtual -Wextra-semi";
OTHER_CPLUSPLUSFLAGS = "-Wall -Wshadow -Wno-missing-field-initializers -Wshadow -Wshorten-64-to-32 -Wstrict-aliasing -Wuninitialized -Wunused-parameter -Wconversion -Wsign-compare -Wint-conversion -Wconditional-uninitialized -Woverloaded-virtual -Wreorder -Wconstant-conversion -Wsign-conversion -Wunused-private-field -Wbool-conversion -Wextra-semi -Wno-ignored-qualifiers -Wunreachable-code";
PRODUCT_BUNDLE_IDENTIFIER = com.juce.theprojucer;
SDKROOT_ppc = macosx10.5;
USE_HEADERMAP = NO; }; name = Release; };


+ 1
- 1
extras/Projucer/Projucer.jucer View File

@@ -8,7 +8,7 @@
<EXPORTFORMATS>
<XCODE_MAC targetFolder="Builds/MacOSX" vstFolder="~/SDKs/vstsdk2.4" rtasFolder="~/SDKs/PT_80_SDK"
documentExtensions=".jucer" objCExtraSuffix="zkVtji" bigIcon="rv1F4h"
extraLinkerFlags="" extraCompilerFlags="-Wall -Wshadow -Wstrict-aliasing -Wconversion -Wsign-compare -Woverloaded-virtual -Wextra-semi"
extraLinkerFlags="" extraCompilerFlags="-Wall -Wshadow -Wno-missing-field-initializers -Wshadow -Wshorten-64-to-32 -Wstrict-aliasing -Wuninitialized -Wunused-parameter -Wconversion -Wsign-compare -Wint-conversion -Wconditional-uninitialized -Woverloaded-virtual -Wreorder -Wconstant-conversion -Wsign-conversion -Wunused-private-field -Wbool-conversion -Wextra-semi -Wno-ignored-qualifiers -Wunreachable-code"
customPList="&lt;plist&gt;&#10;&lt;dict&gt;&#10;&#9;&lt;key&gt;NSAppTransportSecurity&lt;/key&gt;&#10;&#9;&lt;dict&gt;&#10;&#9;&#9;&lt;key&gt;NSAllowsArbitraryLoads&lt;/key&gt;&#10;&#9;&#9;&lt;true/&gt;&#10;&#9;&#9;&lt;key&gt;NSExceptionDomains&lt;/key&gt;&#10;&#9;&#9;&lt;dict&gt;&#10;&#9;&#9;&#9;&lt;key&gt;amazonaws.com&lt;/key&gt;&#10;&#9;&#9;&#9;&lt;dict&gt;&#10;&#9;&#9;&#9;&#9;&lt;key&gt;NSExceptionAllowsInsecureHTTPLoads&lt;/key&gt;&#10;&#9;&#9;&#9;&#9;&lt;true/&gt;&#10;&#9;&#9;&#9;&#9;&lt;key&gt;NSIncludesSubdomains&lt;/key&gt;&#10;&#9;&#9;&#9;&#9;&lt;true/&gt;&#10;&#9;&#9;&#9;&lt;/dict&gt;&#10;&#9;&#9;&lt;/dict&gt;&#10;&#9;&lt;/dict&gt;&#10;&lt;/dict&gt;&#10;&lt;/plist&gt;"
extraFrameworks="AudioUnit; Accelerate; AVFoundation; CoreAudio; CoreAudioKit; CoreMIDI; DiscRecording; QuartzCore; AudioToolbox; OpenGL; QTKit; QuickTime">
<CONFIGURATIONS>


+ 1
- 1
extras/Projucer/Source/ComponentEditor/Documents/jucer_ButtonDocument.cpp View File

@@ -71,7 +71,7 @@ static const char* const stateNames[] =
"common background"
};
int stateNameToIndex (const String& name)
static int stateNameToIndex (const String& name)
{
for (int i = 7; --i >= 0;)
if (name.equalsIgnoreCase (stateNames[i]))


+ 7
- 4
extras/Projucer/Source/ComponentEditor/UI/jucer_JucerDocumentEditor.cpp View File

@@ -1229,9 +1229,10 @@ Image JucerDocumentEditor::createComponentLayerSnapshot() const
const int gridSnapMenuItemBase = 0x8723620;
const int snapSizes[] = { 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24, 32 };
void createGUIEditorMenu (PopupMenu&);
void createGUIEditorMenu (PopupMenu& menu)
{
ApplicationCommandManager* commandManager = &ProjucerApplication::getCommandManager();
auto* commandManager = &ProjucerApplication::getCommandManager();
menu.addCommandItem (commandManager, JucerCommandIDs::editCompLayout);
menu.addCommandItem (commandManager, JucerCommandIDs::editCompGraphics);
@@ -1269,12 +1270,12 @@ void createGUIEditorMenu (PopupMenu& menu)
menu.addCommandItem (commandManager, JucerCommandIDs::showGrid);
menu.addCommandItem (commandManager, JucerCommandIDs::enableSnapToGrid);
JucerDocumentEditor* holder = JucerDocumentEditor::getActiveDocumentHolder();
auto* holder = JucerDocumentEditor::getActiveDocumentHolder();
{
const int currentSnapSize = holder != nullptr ? holder->getDocument()->getSnappingGridSize() : -1;
auto currentSnapSize = holder != nullptr ? holder->getDocument()->getSnappingGridSize() : -1;
PopupMenu m;
for (int i = 0; i < numElementsInArray (snapSizes); ++i)
m.addItem (gridSnapMenuItemBase + i, String (snapSizes[i]) + " pixels",
true, snapSizes[i] == currentSnapSize);
@@ -1303,6 +1304,7 @@ void createGUIEditorMenu (PopupMenu& menu)
}
}
void handleGUIEditorMenuCommand (int);
void handleGUIEditorMenuCommand (int menuItemID)
{
if (auto* ed = JucerDocumentEditor::getActiveDocumentHolder())
@@ -1320,6 +1322,7 @@ void handleGUIEditorMenuCommand (int menuItemID)
}
}
void registerGUIEditorCommands();
void registerGUIEditorCommands()
{
JucerDocumentEditor dh (nullptr);


+ 6
- 5
extras/Projucer/Source/ComponentEditor/jucer_JucerDocument.cpp View File

@@ -735,27 +735,27 @@ public:
};
};
OpenDocumentManager::DocumentType* createGUIDocumentType();
OpenDocumentManager::DocumentType* createGUIDocumentType()
{
return new JucerComponentDocument::Type();
}
//==============================================================================
class NewGUIComponentWizard : public NewFileWizard::Type
struct NewGUIComponentWizard : public NewFileWizard::Type
{
public:
NewGUIComponentWizard() {}
String getName() override { return "GUI Component"; }
void createNewFile (Project& project, Project::Item parent) override
{
const File newFile (askUserToChooseNewFile (String (defaultClassName) + ".h", "*.h;*.cpp", parent));
auto newFile = askUserToChooseNewFile (String (defaultClassName) + ".h", "*.h;*.cpp", parent);
if (newFile != File())
{
const File headerFile (newFile.withFileExtension (".h"));
const File cppFile (newFile.withFileExtension (".cpp"));
auto headerFile = newFile.withFileExtension (".h");
auto cppFile = newFile.withFileExtension (".cpp");
headerFile.replaceWithText (String());
cppFile.replaceWithText (String());
@@ -787,6 +787,7 @@ public:
}
};
NewFileWizard::Type* createGUIComponentWizard();
NewFileWizard::Type* createGUIComponentWizard()
{
return new NewGUIComponentWizard();


+ 1
- 0
extras/Projucer/Source/LiveBuildEngine/jucer_CompileEngineServer.cpp View File

@@ -26,6 +26,7 @@
#include "../Application/jucer_Headers.h"
#include "../Application/jucer_Application.h"
#include "jucer_CompileEngineServer.h"
#include "jucer_CompileEngineDLL.h"
#include "jucer_MessageIDs.h"
#include "jucer_CppHelpers.h"


+ 2
- 2
extras/Projucer/Source/Project/UI/jucer_ProjectContentComponent.cpp View File

@@ -188,7 +188,7 @@ void ProjectContentComponent::setProject (Project* newProject)
}
//==============================================================================
LiveBuildTab* findBuildTab (const TabbedComponent& tabs)
static LiveBuildTab* findBuildTab (const TabbedComponent& tabs)
{
return dynamic_cast<LiveBuildTab*> (tabs.getTabContentComponent (1));
}
@@ -742,7 +742,7 @@ struct AsyncCommandRetrier : public Timer
JUCE_DECLARE_NON_COPYABLE (AsyncCommandRetrier)
};
bool reinvokeCommandAfterCancellingModalComps (const ApplicationCommandTarget::InvocationInfo& info)
static bool reinvokeCommandAfterCancellingModalComps (const ApplicationCommandTarget::InvocationInfo& info)
{
if (ModalComponentManager::getInstance()->cancelAllModalComponents())
{


+ 2
- 2
extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Android.h View File

@@ -1854,12 +1854,12 @@ private:
JUCE_DECLARE_NON_COPYABLE (AndroidProjectExporter)
};
ProjectExporter* createAndroidExporter (Project& p, const ValueTree& t)
inline ProjectExporter* createAndroidExporter (Project& p, const ValueTree& t)
{
return new AndroidProjectExporter (p, t);
}
ProjectExporter* createAndroidExporterForSetting (Project& p, const ValueTree& t)
inline ProjectExporter* createAndroidExporterForSetting (Project& p, const ValueTree& t)
{
return AndroidProjectExporter::createForSettings (p, t);
}

+ 0
- 12
extras/Projucer/Source/Utility/Helpers/jucer_FileHelpers.cpp View File

@@ -124,18 +124,6 @@ namespace FileHelpers
|| path.startsWithIgnoreCase ("smb:");
}
String appendPath (const String& path, const String& subpath)
{
if (isAbsolutePath (subpath))
return unixStylePath (subpath);
String path1 (unixStylePath (path));
if (! path1.endsWithChar ('/'))
path1 << '/';
return path1 + unixStylePath (subpath);
}
bool shouldPathsBeRelative (String path1, String path2)
{
path1 = unixStylePath (path1);


+ 1
- 0
extras/Projucer/Source/Wizards/jucer_NewProjectWizardClasses.cpp View File

@@ -25,6 +25,7 @@
*/
#include "../Application/jucer_Headers.h"
#include "jucer_NewProjectWizardClasses.h"
#include "../ProjectSaving/jucer_ProjectExporter.h"
#include "../Utility/UI/jucer_SlidingPanelComponent.h"


+ 2
- 2
modules/juce_core/zip/juce_ZipFile.cpp View File

@@ -23,13 +23,13 @@
namespace juce
{
uint16 readUnalignedLittleEndianShort (const void* buffer)
inline uint16 readUnalignedLittleEndianShort (const void* buffer)
{
auto data = readUnaligned<uint16> (buffer);
return ByteOrder::littleEndianShort (&data);
}
uint32 readUnalignedLittleEndianInt (const void* buffer)
inline uint32 readUnalignedLittleEndianInt (const void* buffer)
{
auto data = readUnaligned<uint32> (buffer);
return ByteOrder::littleEndianInt (&data);


+ 13
- 11
modules/juce_events/messages/juce_Initialisation.h View File

@@ -121,6 +121,7 @@ public:
#else
#define JUCE_CREATE_APPLICATION_DEFINE(AppClass) \
juce::JUCEApplicationBase* juce_CreateApplication(); \
juce::JUCEApplicationBase* juce_CreateApplication() { return new AppClass(); }
#define JUCE_MAIN_FUNCTION_DEFINITION \
@@ -158,35 +159,36 @@ public:
risk if you decide to use your own delegate and subtle, hard to debug bugs may occur.
@interface MyCustomDelegate : NSObject <UIApplicationDelegate> { NSObject<UIApplicationDelegate>* juceDelegate; } @end
@implementation MyCustomDelegate
-(id) init
{
self = [super init];
juceDelegate = reinterpret_cast<NSObject<UIApplicationDelegate>*> ([[NSClassFromString (@"JuceAppStartupDelegate") alloc] init]);
return self;
}
-(void)dealloc
-(void) dealloc
{
[juceDelegate release];
[super dealloc];
}
- (void)forwardInvocation:(NSInvocation *)anInvocation
- (void) forwardInvocation: (NSInvocation*) anInvocation
{
if (juceDelegate != nullptr && [juceDelegate respondsToSelector:[anInvocation selector]])
[anInvocation invokeWithTarget:juceDelegate];
else
[super forwardInvocation:anInvocation];
if (juceDelegate != nullptr && [juceDelegate respondsToSelector: [anInvocation selector]])
[anInvocation invokeWithTarget: juceDelegate];
else
[super forwardInvocation: anInvocation];
}
-(BOOL)respondsToSelector:(SEL)aSelector
-(BOOL) respondsToSelector: (SEL) aSelector
{
if (juceDelegate != nullptr && [juceDelegate respondsToSelector:aSelector])
return YES;
if (juceDelegate != nullptr && [juceDelegate respondsToSelector: aSelector])
return YES;
return [super respondsToSelector:aSelector];
return [super respondsToSelector: aSelector];
}
@end
*/


Loading…
Cancel
Save