From 5d6c37ed6975fbb9e745e360563dff3d44f7ae11 Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 23 Feb 2015 09:41:34 +0000 Subject: [PATCH] Cranked-up the warning level in the introjucer Xcode build, and fixed a few minor warnings. --- .../The Introjucer.xcodeproj/project.pbxproj | 4 ++-- extras/Introjucer/Introjucer.jucer | 2 +- .../ui/jucer_ResourceEditorPanel.cpp | 4 ++-- .../juce_cryptography/hashing/juce_Whirlpool.cpp | 6 +++--- .../juce_graphics/colour/juce_ColourGradient.cpp | 12 ++++++------ .../native/juce_mac_CoreGraphicsContext.mm | 14 +++++++------- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/extras/Introjucer/Builds/MacOSX/The Introjucer.xcodeproj/project.pbxproj b/extras/Introjucer/Builds/MacOSX/The Introjucer.xcodeproj/project.pbxproj index d8082d85eb..7fb9f44ea3 100644 --- a/extras/Introjucer/Builds/MacOSX/The Introjucer.xcodeproj/project.pbxproj +++ b/extras/Introjucer/Builds/MacOSX/The Introjucer.xcodeproj/project.pbxproj @@ -2002,7 +2002,7 @@ INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Applications"; MACOSX_DEPLOYMENT_TARGET_ppc = 10.4; - OTHER_CPLUSPLUSFLAGS = "-Wall -Wshadow -Wno-missing-field-initializers -Wshadow -Wshorten-64-to-32 -Wstrict-aliasing -Wuninitialized -Wunused-parameter"; + OTHER_CPLUSPLUSFLAGS = "-Wall -Wshadow -Wno-missing-field-initializers -Wshadow -Wshorten-64-to-32 -Wstrict-aliasing -Wuninitialized -Wunused-parameter -Wconversion -Wsign-compare -Wint-conversion -Woverloaded-virtual -Wreorder -Wconstant-conversion -Wsign-conversion"; SDKROOT_ppc = macosx10.5; }; name = Debug; }; B159CF4275B8A90122629FF4 = {isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(NATIVE_ARCH_ACTUAL)"; @@ -2026,7 +2026,7 @@ INSTALL_PATH = "$(HOME)/Applications"; MACOSX_DEPLOYMENT_TARGET = 10.5; MACOSX_DEPLOYMENT_TARGET_ppc = 10.4; - OTHER_CPLUSPLUSFLAGS = "-Wall -Wshadow -Wno-missing-field-initializers -Wshadow -Wshorten-64-to-32 -Wstrict-aliasing -Wuninitialized -Wunused-parameter"; + OTHER_CPLUSPLUSFLAGS = "-Wall -Wshadow -Wno-missing-field-initializers -Wshadow -Wshorten-64-to-32 -Wstrict-aliasing -Wuninitialized -Wunused-parameter -Wconversion -Wsign-compare -Wint-conversion -Woverloaded-virtual -Wreorder -Wconstant-conversion -Wsign-conversion"; SDKROOT_ppc = macosx10.5; }; name = Release; }; C42924A24AB55E6A940423EA = {isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; diff --git a/extras/Introjucer/Introjucer.jucer b/extras/Introjucer/Introjucer.jucer index 481e6ee678..0d10ec8b33 100644 --- a/extras/Introjucer/Introjucer.jucer +++ b/extras/Introjucer/Introjucer.jucer @@ -15,7 +15,7 @@ + extraCompilerFlags="-Wall -Wshadow -Wno-missing-field-initializers -Wshadow -Wshorten-64-to-32 -Wstrict-aliasing -Wuninitialized -Wunused-parameter -Wconversion -Wsign-compare -Wint-conversion -Woverloaded-virtual -Wreorder -Wconstant-conversion -Wsign-conversion"> diff --git a/extras/Introjucer/Source/ComponentEditor/ui/jucer_ResourceEditorPanel.cpp b/extras/Introjucer/Source/ComponentEditor/ui/jucer_ResourceEditorPanel.cpp index b9285179e8..5fa26c5e94 100644 --- a/extras/Introjucer/Source/ComponentEditor/ui/jucer_ResourceEditorPanel.cpp +++ b/extras/Introjucer/Source/ComponentEditor/ui/jucer_ResourceEditorPanel.cpp @@ -129,7 +129,7 @@ void ResourceEditorPanel::paintCell (Graphics& g, int rowNumber, int columnId, i else if (columnId == 2) text = r->originalFilename; else if (columnId == 3) - text = File::descriptionOfSizeInBytes (r->data.getSize()); + text = File::descriptionOfSizeInBytes ((int64) r->data.getSize()); g.setFont (13.0f); g.drawText (text, 4, 0, width - 6, height, Justification::centredLeft, true); @@ -169,7 +169,7 @@ int ResourceEditorPanel::getColumnAutoSizeWidth (int columnId) else if (columnId == 2) text = r->originalFilename; else if (columnId == 3) - text = File::descriptionOfSizeInBytes (r->data.getSize()); + text = File::descriptionOfSizeInBytes ((int64) r->data.getSize()); widest = jmax (widest, f.getStringWidth (text)); } diff --git a/modules/juce_cryptography/hashing/juce_Whirlpool.cpp b/modules/juce_cryptography/hashing/juce_Whirlpool.cpp index 13bc4fba38..0d0375dc7e 100644 --- a/modules/juce_cryptography/hashing/juce_Whirlpool.cpp +++ b/modules/juce_cryptography/hashing/juce_Whirlpool.cpp @@ -64,7 +64,7 @@ private: int sourceGap = (8 - (numBits & 7)) & 7; // space on source[sourcePos] int bufferRem = bufferBits & 7; // occupied bits on buffer[bufferPos] - uint64 value = numBits, carry = 0; + uint64 value = (uint64) numBits, carry = 0; for (int i = 32; --i >= 0 && (carry != 0 || value != 0);) { @@ -137,14 +137,14 @@ private: if (bufferPos > 32) { if (bufferPos < 64) - zeromem (buffer + bufferPos, 64 - bufferPos); + zeromem (buffer + bufferPos, (size_t) (64 - bufferPos)); processNextBuffer(); bufferPos = 0; } if (bufferPos < 32) - zeromem (buffer + bufferPos, 32 - bufferPos); + zeromem (buffer + bufferPos, (size_t) (32 - bufferPos)); bufferPos = 32; memcpy (buffer + 32, bitLength, 32); // append bit length of hashed data diff --git a/modules/juce_graphics/colour/juce_ColourGradient.cpp b/modules/juce_graphics/colour/juce_ColourGradient.cpp index 75d1712958..8e10816c1c 100644 --- a/modules/juce_graphics/colour/juce_ColourGradient.cpp +++ b/modules/juce_graphics/colour/juce_ColourGradient.cpp @@ -32,12 +32,12 @@ ColourGradient::ColourGradient() noexcept #endif } -ColourGradient::ColourGradient (Colour colour1, const float x1_, const float y1_, - Colour colour2, const float x2_, const float y2_, - const bool isRadial_) - : point1 (x1_, y1_), - point2 (x2_, y2_), - isRadial (isRadial_) +ColourGradient::ColourGradient (Colour colour1, const float x1, const float y1, + Colour colour2, const float x2, const float y2, + const bool radial) + : point1 (x1, y1), + point2 (x2, y2), + isRadial (radial) { colours.add (ColourPoint (0.0, colour1)); colours.add (ColourPoint (1.0, colour2)); diff --git a/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm b/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm index 31e7ee12cc..b1920861f5 100644 --- a/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm +++ b/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm @@ -707,7 +707,7 @@ void CoreGraphicsContext::SavedState::setFill (const FillType& newFill) static CGGradientRef createGradient (const ColourGradient& g, CGColorSpaceRef colourSpace) { const int numColours = g.getNumColours(); - CGFloat* const data = (CGFloat*) alloca (numColours * 5 * sizeof (CGFloat)); + CGFloat* const data = (CGFloat*) alloca ((size_t) numColours * 5 * sizeof (CGFloat)); CGFloat* const locations = data; CGFloat* const components = data + numColours; CGFloat* comps = components; @@ -715,14 +715,14 @@ static CGGradientRef createGradient (const ColourGradient& g, CGColorSpaceRef co for (int i = 0; i < numColours; ++i) { const Colour colour (g.getColour (i)); - *comps++ = colour.getFloatRed(); - *comps++ = colour.getFloatGreen(); - *comps++ = colour.getFloatBlue(); - *comps++ = colour.getFloatAlpha(); - locations[i] = g.getColourPosition (i); + *comps++ = (CGFloat) colour.getFloatRed(); + *comps++ = (CGFloat) colour.getFloatGreen(); + *comps++ = (CGFloat) colour.getFloatBlue(); + *comps++ = (CGFloat) colour.getFloatAlpha(); + locations[i] = (CGFloat) g.getColourPosition (i); } - return CGGradientCreateWithColorComponents (colourSpace, components, locations, numColours); + return CGGradientCreateWithColorComponents (colourSpace, components, locations, (size_t) numColours); } void CoreGraphicsContext::drawGradient()