From b9443c8ba34e0c9d96de9916ffbd43dec71ef45a Mon Sep 17 00:00:00 2001 From: Julian Storer Date: Tue, 4 May 2010 21:27:45 +0100 Subject: [PATCH] Cleaned up some compiler warnings. Jucer development. --- .../Types/jucer_ComponentTypeManager.cpp | 31 +- .../Component/Types/jucer_GenericComponent.h | 23 + .../model/Component/jucer_CodeGenerator.cpp | 16 - .../model/Component/jucer_CodeGenerator.h | 6 + .../Component/jucer_ComponentDocument.cpp | 122 ++--- .../model/Component/jucer_ComponentDocument.h | 8 +- .../model/Drawable/jucer_DrawableDocument.cpp | 21 +- .../model/Drawable/jucer_DrawableDocument.h | 2 + .../model/Project/jucer_ProjectExport_MSVC.h | 8 +- .../model/Project/jucer_ProjectExport_XCode.h | 138 +++--- .../model/Project/jucer_ProjectExporter.h | 4 +- .../Source/model/Project/jucer_ProjectSaver.h | 6 +- .../ui/Code Editor/jucer_SourceCodeEditor.cpp | 4 +- .../jucer_ComponentEditor.cpp | 4 +- .../jucer_ComponentEditorToolbar.h | 3 + .../jucer_ComponentEditorTreeView.h | 26 +- .../Drawable Editor/jucer_DrawableEditor.cpp | 4 +- .../jucer_DrawableEditorToolbar.h | 3 + .../jucer_DrawableEditorTreeView.h | 14 +- .../jucer_ProjectTreeViewBase.cpp | 18 +- .../Source/utility/jucer_Coordinate.cpp | 17 + .../Source/utility/jucer_Coordinate.h | 6 + .../jucer_CoordinatePropertyComponent.h | 12 +- .../Source/utility/jucer_MarkerListBase.h | 106 ++++- .../Source/utility/jucer_UtilityFunctions.cpp | 3 + .../Source/utility/jucer_UtilityFunctions.h | 2 +- .../utility/jucer_ValueRemapperSource.h | 8 +- juce_amalgamated.cpp | 443 ++++++++++-------- juce_amalgamated.h | 37 +- src/core/juce_Atomic.h | 8 +- src/gui/components/controls/juce_ListBox.cpp | 1 - src/gui/components/controls/juce_Slider.h | 8 - .../components/controls/juce_TextEditor.cpp | 6 +- .../controls/juce_ToolbarItemComponent.cpp | 6 +- src/gui/components/controls/juce_TreeView.cpp | 51 +- .../filebrowser/juce_FileBrowserComponent.cpp | 2 + src/gui/components/juce_Component.cpp | 32 +- src/gui/components/juce_Component.h | 5 - .../juce_KeyMappingEditorComponent.cpp | 9 +- src/gui/components/layout/juce_ScrollBar.cpp | 4 +- .../layout/juce_TabbedComponent.cpp | 4 +- .../components/mouse/juce_LassoComponent.h | 2 +- .../special/juce_ColourSelector.cpp | 22 +- .../special/juce_MidiKeyboardComponent.cpp | 10 +- .../components/windows/juce_AlertWindow.cpp | 12 +- .../windows/juce_DocumentWindow.cpp | 10 +- .../windows/juce_ResizableWindow.cpp | 8 +- .../windows/juce_TopLevelWindow.cpp | 8 +- src/gui/graphics/drawables/juce_SVGParser.cpp | 28 +- src/gui/graphics/fonts/juce_Font.cpp | 8 +- src/gui/graphics/geometry/juce_Path.cpp | 4 +- src/gui/graphics/geometry/juce_Rectangle.h | 10 +- .../image_file_formats/jpglib/jccoefct.c | 2 +- .../image_file_formats/jpglib/jccolor.c | 2 +- .../image_file_formats/jpglib/jcmarker.c | 2 +- .../image_file_formats/jpglib/jcsample.c | 2 +- .../image_file_formats/jpglib/jctrans.c | 2 +- .../image_file_formats/jpglib/jdatasrc.c | 2 +- .../image_file_formats/jpglib/jdcoefct.c | 2 +- .../image_file_formats/jpglib/jdcolor.c | 2 +- .../image_file_formats/jpglib/jdmerge.c | 6 +- .../image_file_formats/jpglib/jdpostct.c | 8 +- .../image_file_formats/jpglib/jdsample.c | 12 +- .../image_file_formats/jpglib/jmemnobs.c | 20 +- .../image_file_formats/jpglib/jquant1.c | 8 +- .../image_file_formats/jpglib/jquant2.c | 4 +- .../image_file_formats/jpglib/transupp.c | 4 +- .../image_file_formats/pnglib/pngerror.c | 2 +- .../image_file_formats/pnglib/pngrutil.c | 2 +- .../image_file_formats/pnglib/pngset.c | 6 +- src/native/common/juce_posix_SharedCode.h | 2 +- .../mac/juce_mac_CarbonViewWrapperComponent.h | 4 +- src/native/mac/juce_mac_CoreAudio.cpp | 16 +- .../mac/juce_mac_CoreGraphicsContext.mm | 2 +- src/native/mac/juce_mac_CoreMidi.cpp | 10 +- src/native/mac/juce_mac_FileChooser.mm | 1 + src/native/mac/juce_mac_MainMenu.mm | 2 + src/native/mac/juce_mac_MessageManager.mm | 12 +- src/native/mac/juce_mac_MiscUtilities.mm | 4 +- src/native/mac/juce_mac_MouseCursor.mm | 2 +- src/native/mac/juce_mac_NSViewComponent.mm | 2 +- .../mac/juce_mac_NSViewComponentPeer.mm | 14 + src/native/mac/juce_mac_Network.mm | 14 +- src/native/mac/juce_mac_Threads.mm | 4 +- .../mac/juce_mac_WebBrowserComponent.mm | 8 +- src/text/juce_XmlElement.cpp | 4 +- src/utilities/juce_PropertiesFile.cpp | 4 +- src/utilities/juce_SelectedItemSet.h | 4 +- 88 files changed, 862 insertions(+), 688 deletions(-) diff --git a/extras/Jucer (experimental)/Source/model/Component/Types/jucer_ComponentTypeManager.cpp b/extras/Jucer (experimental)/Source/model/Component/Types/jucer_ComponentTypeManager.cpp index 4e8855d41d..df5a0eefc8 100644 --- a/extras/Jucer (experimental)/Source/model/Component/Types/jucer_ComponentTypeManager.cpp +++ b/extras/Jucer (experimental)/Source/model/Component/Types/jucer_ComponentTypeManager.cpp @@ -43,6 +43,7 @@ public: : CoordinatePropertyComponent (document_, name, Value (new CoordExtractor (coordValue_, type_)), type_ == left || type_ == right), + document (document_), type (type_), compState (compState_) { @@ -133,6 +134,7 @@ public: } private: + ComponentDocument& document; Type type; ValueTree compState; @@ -164,9 +166,9 @@ ComponentTypeHandler::~ComponentTypeHandler() { } -Value ComponentTypeHandler::getValue (const var::identifier& name, ValueTree& state, ComponentDocument& document) const +Value ComponentTypeHandler::getValue (const var::identifier& name_, ValueTree& state, ComponentDocument& document) const { - return state.getPropertyAsValue (name, document.getUndoManager()); + return state.getPropertyAsValue (name_, document.getUndoManager()); } void ComponentTypeHandler::updateComponent (ComponentDocument& document, Component* comp, const ValueTree& state) @@ -186,7 +188,7 @@ void ComponentTypeHandler::updateComponent (ComponentDocument& document, Compone void ComponentTypeHandler::initialiseNewItem (ComponentDocument& document, ValueTree& state) { state.setProperty (ComponentDocument::compNameProperty, String::empty, 0); - state.setProperty (ComponentDocument::memberNameProperty, document.getNonExistentMemberName (getMemberNameRoot()), 0); + state.setProperty (ComponentDocument::memberNameProperty, document.getNonexistentMemberName (getMemberNameRoot()), 0); const Rectangle bounds (getDefaultSize().withPosition (Point (Random::getSystemRandom().nextInt (100) + 100, Random::getSystemRandom().nextInt (100) + 100))); @@ -202,10 +204,9 @@ class CompMemberNameValueSource : public Value::ValueSource, public Value::Listener { public: - CompMemberNameValueSource (ComponentDocument& document_, const ValueTree& state_) - : sourceValue (state_.getPropertyAsValue (ComponentDocument::memberNameProperty, document_.getUndoManager())), - document (document_), - state (state_) + CompMemberNameValueSource (ComponentDocument& document_, const ValueTree& state) + : sourceValue (state.getPropertyAsValue (ComponentDocument::memberNameProperty, document_.getUndoManager())), + document (document_) { sourceValue.addListener (this); } @@ -217,21 +218,21 @@ public: void setValue (const var& newValue) { - String newVal (newValue.toString()); + if (newValue == sourceValue) + return; - //xxx check for uniqueness + rename any coords that use the name.. + const String name (document.getNonexistentMemberName (newValue)); - - newVal = makeValidCppIdentifier (newVal, false, true, false); - - if (sourceValue != newVal) - sourceValue = newVal; + if (sourceValue != name) + { + document.renameAnchor (sourceValue.toString(), name); + sourceValue = name; + } } private: Value sourceValue; ComponentDocument& document; - ValueTree state; CompMemberNameValueSource (const CompMemberNameValueSource&); const CompMemberNameValueSource& operator= (const CompMemberNameValueSource&); diff --git a/extras/Jucer (experimental)/Source/model/Component/Types/jucer_GenericComponent.h b/extras/Jucer (experimental)/Source/model/Component/Types/jucer_GenericComponent.h index fdb1e8b82c..6c1b86cae9 100644 --- a/extras/Jucer (experimental)/Source/model/Component/Types/jucer_GenericComponent.h +++ b/extras/Jucer (experimental)/Source/model/Component/Types/jucer_GenericComponent.h @@ -45,13 +45,29 @@ public: { } + void setDetails (const String& memberName, const String& className) + { + const String name (memberName + " (" + className + ")"); + + if (name != getName()) + { + setName (name); + repaint(); + } + } + void paint (Graphics& g) { + g.fillAll (Colours::white.withAlpha (0.2f)); g.setColour (Colours::grey); g.drawRect (getLocalBounds()); g.drawLine (0.5f, 0.5f, getWidth() - 0.5f, getHeight() - 0.5f); g.drawLine (0.5f, getHeight() - 0.5f, getWidth() - 0.5f, 0.5f); + + g.setColour (Colours::black); + g.setFont (11.0f); + g.drawFittedText (getName(), 2, 2, getWidth() - 4, getHeight() - 4, Justification::centredTop, 2); } }; @@ -61,14 +77,21 @@ public: void update (ComponentDocument& document, Component* comp, const ValueTree& state) { + static_cast (comp)->setDetails (state [ComponentDocument::memberNameProperty], + state ["class"]); } void initialiseNew (ComponentDocument& document, ValueTree& state) { + state.setProperty ("class", "Component", 0); } void createProperties (ComponentDocument& document, ValueTree& state, Array & props) { + addFocusOrderProperty (document, state, props); + + props.add (new TextPropertyComponent (getValue ("class", state, document), "Class", 256, false)); + props.getLast()->setTooltip ("The class that this component is an instance of."); } }; diff --git a/extras/Jucer (experimental)/Source/model/Component/jucer_CodeGenerator.cpp b/extras/Jucer (experimental)/Source/model/Component/jucer_CodeGenerator.cpp index 0ab89ec6b1..cfd26bc965 100644 --- a/extras/Jucer (experimental)/Source/model/Component/jucer_CodeGenerator.cpp +++ b/extras/Jucer (experimental)/Source/model/Component/jucer_CodeGenerator.cpp @@ -221,22 +221,6 @@ static const String getIncludeFileCode (StringArray files) return s; } -//============================================================================== -static bool getUserSection (const StringArray& lines, const String& tag, StringArray& resultLines) -{ - const int start = indexOfLineStartingWith (lines, "//[" + tag + "]", 0); - - if (start < 0) - return false; - - const int end = indexOfLineStartingWith (lines, "//[/" + tag + "]", start + 1); - - for (int i = start + 1; i < end; ++i) - resultLines.add (lines [i]); - - return true; -} - //============================================================================== static void replaceTemplate (String& text, const String& itemName, const String& value) { diff --git a/extras/Jucer (experimental)/Source/model/Component/jucer_CodeGenerator.h b/extras/Jucer (experimental)/Source/model/Component/jucer_CodeGenerator.h index 49a7df626c..d8c0a1b363 100644 --- a/extras/Jucer (experimental)/Source/model/Component/jucer_CodeGenerator.h +++ b/extras/Jucer (experimental)/Source/model/Component/jucer_CodeGenerator.h @@ -97,6 +97,9 @@ public: private: CodeDocument* const doc; + + CodeDocumentRef (const CodeDocumentRef&); + CodeDocumentRef& operator= (const CodeDocumentRef&); }; //============================================================================== @@ -124,6 +127,9 @@ public: CustomCodeList& customCode; StringArray lines; int i; + + Iterator (const Iterator&); + Iterator& operator= (const Iterator&); }; private: diff --git a/extras/Jucer (experimental)/Source/model/Component/jucer_ComponentDocument.cpp b/extras/Jucer (experimental)/Source/model/Component/jucer_ComponentDocument.cpp index 20eb3a6b67..aab34b1e80 100644 --- a/extras/Jucer (experimental)/Source/model/Component/jucer_ComponentDocument.cpp +++ b/extras/Jucer (experimental)/Source/model/Component/jucer_ComponentDocument.cpp @@ -412,6 +412,33 @@ bool ComponentDocument::setCoordsFor (ValueTree& state, const RectangleCoordinat return true; } +const String ComponentDocument::getNonexistentMemberName (String name) +{ + String n (makeValidCppIdentifier (name, false, true, false)); + int suffix = 2; + + while (markersX->getMarkerNamed (n).isValid() || markersY->getMarkerNamed (n).isValid() + || getComponentWithMemberName (n).isValid()) + n = n.trimCharactersAtEnd ("0123456789") + String (suffix++); + + return n; +} + +void ComponentDocument::renameAnchor (const String& oldName, const String& newName) +{ + int i; + for (i = getNumComponents(); --i >= 0;) + { + ValueTree v (getComponent(i)); + RectangleCoordinates coords (getCoordsFor (v)); + coords.renameAnchorIfUsed (oldName, newName); + setCoordsFor (v, coords); + } + + markersX->renameAnchorInMarkers (oldName, newName); + markersY->renameAnchorInMarkers (oldName, newName); +} + void ComponentDocument::addMarkerMenuItem (int i, const Coordinate& coord, const String& name, PopupMenu& menu, bool isAnchor1, const String& fullCoordName) { @@ -555,24 +582,6 @@ void ComponentDocument::removeComponent (const ValueTree& state) getComponentGroup().removeChild (state, getUndoManager()); } -const String ComponentDocument::getNonExistentMemberName (String suggestedName) -{ - suggestedName = makeValidCppIdentifier (suggestedName, false, true, false); - const String original (suggestedName); - int num = 1; - - while (getComponentWithMemberName (suggestedName).isValid()) - { - suggestedName = original; - while (String ("0123456789").containsChar (suggestedName.getLastCharacter())) - suggestedName = suggestedName.dropLastCharacters (1); - - suggestedName << num++; - } - - return suggestedName; -} - //============================================================================== ComponentDocument::MarkerList::MarkerList (ComponentDocument& document_, const bool isX_) : MarkerListBase (document_.getRoot().getChildWithName (isX_ ? markersGroupXTag : markersGroupYTag), isX_), @@ -589,19 +598,24 @@ UndoManager* ComponentDocument::MarkerList::getUndoManager() const const String ComponentDocument::MarkerList::getNonexistentMarkerName (const String& name) { - return document.getNonexistentMarkerName (name); + return document.getNonexistentMemberName (name); } -const Coordinate ComponentDocument::MarkerList::findMarker (const String& name, bool isHorizontal) const +void ComponentDocument::MarkerList::renameAnchor (const String& oldName, const String& newName) { - if (isHorizontal == isX) - { - if (name == Coordinate::parentRightMarkerName) return Coordinate ((double) document.getCanvasWidth().getValue(), isHorizontal); - if (name == Coordinate::parentBottomMarkerName) return Coordinate ((double) document.getCanvasHeight().getValue(), isHorizontal); + document.renameAnchor (oldName, newName); +} - const ValueTree marker (document.getMarkerList (isHorizontal).getMarkerNamed (name)); +const Coordinate ComponentDocument::MarkerList::findMarker (const String& name, bool isHorizontal_) const +{ + if (isHorizontal_ == isX) + { + if (name == Coordinate::parentRightMarkerName) return Coordinate ((double) document.getCanvasWidth().getValue(), isX); + if (name == Coordinate::parentBottomMarkerName) return Coordinate ((double) document.getCanvasHeight().getValue(), isX); + + const ValueTree marker (document.getMarkerList (isX).getMarkerNamed (name)); if (marker.isValid()) - return document.getMarkerList (isHorizontal).getCoordinate (marker); + return document.getMarkerList (isX).getCoordinate (marker); } return Coordinate (isX); @@ -643,69 +657,25 @@ const String ComponentDocument::MarkerList::getChosenMarkerMenuItem (const Coord return String::empty; } + //============================================================================== -class MarkerPositionComponent : public CoordinatePropertyComponent -{ -public: - //============================================================================== - MarkerPositionComponent (ComponentDocument& document_, const String& name, const ValueTree& markerState_, - const Value& coordValue_, bool isHorizontal_) - : CoordinatePropertyComponent (document_, name, coordValue_, isHorizontal_), - markerState (markerState_) - { - } - - ~MarkerPositionComponent() - { - } - - const String pickMarker (TextButton* button, const String& currentMarker, bool isAnchor1) - { - Coordinate coord (getCoordinate()); - - PopupMenu m; - document.getMarkerList (coord.isHorizontal()) - .addMarkerMenuItems (markerState, coord, m, isAnchor1); - - const int r = m.showAt (button); - - if (r > 0) - return document.getMarkerList (coord.isHorizontal()).getChosenMarkerMenuItem (coord, r); - - return String::empty; - } - -private: - ValueTree markerState; -}; - bool ComponentDocument::MarkerList::createProperties (Array & props, const String& itemId) { ValueTree marker (group.getChildWithProperty (idProperty, itemId)); if (marker.isValid()) { - props.add (new TextPropertyComponent (getNameAsValue (marker), "Marker Name", 256, false)); - props.add (new MarkerPositionComponent (document, "Position", marker, - marker.getPropertyAsValue (getMarkerPosProperty(), document.getUndoManager()), - contains (marker))); + props.add (new TextPropertyComponent (Value (new MarkerListBase::MarkerNameValueSource (this, getNameAsValue (marker))), + "Marker Name", 256, false)); + + props.add (new MarkerListBase::PositionPropertyComponent (document, *this, "Position", marker, + marker.getPropertyAsValue (getMarkerPosProperty(), document.getUndoManager()))); return true; } return false; } -const String ComponentDocument::getNonexistentMarkerName (const String& name) -{ - String n (makeValidCppIdentifier (name, false, true, false)); - int suffix = 2; - - while (markersX->getMarkerNamed (n).isValid() || markersY->getMarkerNamed (n).isValid()) - n = n.trimCharactersAtEnd ("0123456789") + String (suffix++); - - return n; -} - //============================================================================== bool ComponentDocument::createItemProperties (Array & props, const String& itemId) { diff --git a/extras/Jucer (experimental)/Source/model/Component/jucer_ComponentDocument.h b/extras/Jucer (experimental)/Source/model/Component/jucer_ComponentDocument.h index 94869e4815..761874953e 100644 --- a/extras/Jucer (experimental)/Source/model/Component/jucer_ComponentDocument.h +++ b/extras/Jucer (experimental)/Source/model/Component/jucer_ComponentDocument.h @@ -62,7 +62,7 @@ public: void createClassProperties (Array & props); - const String getNonExistentMemberName (String suggestedName); + const String getNonexistentMemberName (String suggestedName); //============================================================================== int getNumComponents() const; @@ -77,6 +77,7 @@ public: void removeComponent (const ValueTree& state); const RectangleCoordinates getCoordsFor (const ValueTree& componentState) const; bool setCoordsFor (ValueTree& componentState, const RectangleCoordinates& newSize); + void renameAnchor (const String& oldName, const String& newName); // for Coordinate::MarkerResolver: const Coordinate findMarker (const String& name, bool isHorizontal) const; @@ -99,8 +100,11 @@ public: void addMarkerMenuItems (const ValueTree& markerState, const Coordinate& coord, PopupMenu& menu, bool isAnchor1); const String getChosenMarkerMenuItem (const Coordinate& coord, int itemId) const; UndoManager* getUndoManager() const; + void renameAnchor (const String& oldName, const String& newName); const String getNonexistentMarkerName (const String& name); + ComponentDocument& getDocument() throw() { return document; } + private: ComponentDocument& document; @@ -112,8 +116,6 @@ public: MarkerList& getMarkerListY() const { return *markersY; } MarkerList& getMarkerList (bool isX) const { return isX ? *markersX : *markersY; } - const String getNonexistentMarkerName (const String& name); - //============================================================================== void createItemProperties (Array & props, const StringArray& selectedItemIds); diff --git a/extras/Jucer (experimental)/Source/model/Drawable/jucer_DrawableDocument.cpp b/extras/Jucer (experimental)/Source/model/Drawable/jucer_DrawableDocument.cpp index 3d09addf6f..8ba35e4369 100644 --- a/extras/Jucer (experimental)/Source/model/Drawable/jucer_DrawableDocument.cpp +++ b/extras/Jucer (experimental)/Source/model/Drawable/jucer_DrawableDocument.cpp @@ -307,16 +307,16 @@ DrawableDocument::MarkerList::MarkerList (DrawableDocument& document_, bool isX_ { } -const Coordinate DrawableDocument::MarkerList::findMarker (const String& name, bool isHorizontal) const +const Coordinate DrawableDocument::MarkerList::findMarker (const String& name, bool isHorizontal_) const { - if (isHorizontal == isX) + if (isHorizontal_ == isX) { - if (name == Coordinate::parentRightMarkerName) return Coordinate ((double) document.getCanvasWidth().getValue(), isHorizontal); - if (name == Coordinate::parentBottomMarkerName) return Coordinate ((double) document.getCanvasHeight().getValue(), isHorizontal); + if (name == Coordinate::parentRightMarkerName) return Coordinate ((double) document.getCanvasWidth().getValue(), isX); + if (name == Coordinate::parentBottomMarkerName) return Coordinate ((double) document.getCanvasHeight().getValue(), isX); - const ValueTree marker (document.getMarkerList (isHorizontal).getMarkerNamed (name)); + const ValueTree marker (document.getMarkerList (isX).getMarkerNamed (name)); if (marker.isValid()) - return document.getMarkerList (isHorizontal).getCoordinate (marker); + return document.getMarkerList (isX).getCoordinate (marker); } return Coordinate (isX); @@ -404,3 +404,12 @@ const String DrawableDocument::getNonexistentMarkerName (const String& name) return n; } + +void DrawableDocument::MarkerList::renameAnchor (const String& oldName, const String& newName) +{ + document.renameAnchor (oldName, newName); +} + +void DrawableDocument::renameAnchor (const String& oldName, const String& newName) +{ +} diff --git a/extras/Jucer (experimental)/Source/model/Drawable/jucer_DrawableDocument.h b/extras/Jucer (experimental)/Source/model/Drawable/jucer_DrawableDocument.h index dc5fa85110..8a1adc14b7 100644 --- a/extras/Jucer (experimental)/Source/model/Drawable/jucer_DrawableDocument.h +++ b/extras/Jucer (experimental)/Source/model/Drawable/jucer_DrawableDocument.h @@ -75,6 +75,7 @@ public: const String getChosenMarkerMenuItem (const Coordinate& coord, int itemId) const; UndoManager* getUndoManager() const; const String getNonexistentMarkerName (const String& name); + void renameAnchor (const String& oldName, const String& newName); private: DrawableDocument& document; @@ -88,6 +89,7 @@ public: MarkerList& getMarkerList (bool isX) const { return isX ? *markersX : *markersY; } const String getNonexistentMarkerName (const String& name); + void renameAnchor (const String& oldName, const String& newName); //============================================================================== void valueTreePropertyChanged (ValueTree& tree, const var::identifier& name); diff --git a/extras/Jucer (experimental)/Source/model/Project/jucer_ProjectExport_MSVC.h b/extras/Jucer (experimental)/Source/model/Project/jucer_ProjectExport_MSVC.h index a14f86a888..eb44de5567 100644 --- a/extras/Jucer (experimental)/Source/model/Project/jucer_ProjectExport_MSVC.h +++ b/extras/Jucer (experimental)/Source/model/Project/jucer_ProjectExport_MSVC.h @@ -237,10 +237,10 @@ private: } } - XmlElement* createGroup (const String& name, XmlElement& parent) + XmlElement* createGroup (const String& groupName, XmlElement& parent) { XmlElement* filter = parent.createNewChildElement ("Filter"); - filter->setAttribute ("Name", name); + filter->setAttribute ("Name", groupName); return filter; } @@ -409,10 +409,10 @@ private: return searchPaths; } - XmlElement* createToolElement (XmlElement& parent, const String& name) const + XmlElement* createToolElement (XmlElement& parent, const String& toolName) const { XmlElement* const e = parent.createNewChildElement ("Tool"); - e->setAttribute ("Name", name); + e->setAttribute ("Name", toolName); return e; } diff --git a/extras/Jucer (experimental)/Source/model/Project/jucer_ProjectExport_XCode.h b/extras/Jucer (experimental)/Source/model/Project/jucer_ProjectExport_XCode.h index 6c2fa12981..e4254b18e9 100644 --- a/extras/Jucer (experimental)/Source/model/Project/jucer_ProjectExport_XCode.h +++ b/extras/Jucer (experimental)/Source/model/Project/jucer_ProjectExport_XCode.h @@ -368,57 +368,57 @@ private: const StringArray getProjectSettings (const Project::BuildConfiguration& config) { - StringArray settings; - settings.add ("ALWAYS_SEARCH_USER_PATHS = NO"); - settings.add ("GCC_C_LANGUAGE_STANDARD = c99"); - settings.add ("GCC_WARN_ABOUT_RETURN_TYPE = YES"); - settings.add ("GCC_WARN_CHECK_SWITCH_STATEMENTS = YES"); - settings.add ("GCC_WARN_UNUSED_VARIABLE = YES"); - settings.add ("GCC_WARN_MISSING_PARENTHESES = YES"); - settings.add ("GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES"); - settings.add ("GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES"); - settings.add ("GCC_MODEL_TUNING = G5"); - settings.add ("GCC_INLINES_ARE_PRIVATE_EXTERN = YES"); - settings.add ("ZERO_LINK = NO"); - settings.add ("DEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\""); - settings.add ("PRODUCT_NAME = \"" + config.getTargetBinaryName().toString() + "\""); - return settings; + StringArray s; + s.add ("ALWAYS_SEARCH_USER_PATHS = NO"); + s.add ("GCC_C_LANGUAGE_STANDARD = c99"); + s.add ("GCC_WARN_ABOUT_RETURN_TYPE = YES"); + s.add ("GCC_WARN_CHECK_SWITCH_STATEMENTS = YES"); + s.add ("GCC_WARN_UNUSED_VARIABLE = YES"); + s.add ("GCC_WARN_MISSING_PARENTHESES = YES"); + s.add ("GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES"); + s.add ("GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES"); + s.add ("GCC_MODEL_TUNING = G5"); + s.add ("GCC_INLINES_ARE_PRIVATE_EXTERN = YES"); + s.add ("ZERO_LINK = NO"); + s.add ("DEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\""); + s.add ("PRODUCT_NAME = \"" + config.getTargetBinaryName().toString() + "\""); + return s; } const StringArray getTargetSettings (const Project::BuildConfiguration& config) { - StringArray settings; - settings.add ("ARCHS = \"$(ARCHS_STANDARD_32_BIT)\""); - settings.add ("PREBINDING = NO"); - settings.add ("HEADER_SEARCH_PATHS = \"" + getHeaderSearchPaths (config).joinIntoString (" ") + " $(inherited)\""); - settings.add ("GCC_OPTIMIZATION_LEVEL = " + config.getGCCOptimisationFlag()); - settings.add ("INFOPLIST_FILE = " + infoPlistFile.getFileName()); + StringArray s; + s.add ("ARCHS = \"$(ARCHS_STANDARD_32_BIT)\""); + s.add ("PREBINDING = NO"); + s.add ("HEADER_SEARCH_PATHS = \"" + getHeaderSearchPaths (config).joinIntoString (" ") + " $(inherited)\""); + s.add ("GCC_OPTIMIZATION_LEVEL = " + config.getGCCOptimisationFlag()); + s.add ("INFOPLIST_FILE = " + infoPlistFile.getFileName()); if (getExtraCompilerFlags().toString().isNotEmpty()) - settings.add ("OTHER_CPLUSPLUSFLAGS = " + getExtraCompilerFlags().toString()); + s.add ("OTHER_CPLUSPLUSFLAGS = " + getExtraCompilerFlags().toString()); switch ((int) project.getProjectType().getValue()) { case Project::application: - settings.add ("INSTALL_PATH = \"$(HOME)/Applications\""); + s.add ("INSTALL_PATH = \"$(HOME)/Applications\""); break; case Project::commandLineApp: break; case Project::audioPlugin: - settings.add ("LIBRARY_STYLE = Bundle"); - settings.add ("INSTALL_PATH = \"$(HOME)/Library/Audio/Plug-Ins/Components/\""); - settings.add ("WRAPPER_EXTENSION = " + getAudioPluginBundleExtension()); - settings.add ("GENERATE_PKGINFO_FILE = YES"); - settings.add ("OTHER_REZFLAGS = \"-d ppc_$ppc -d i386_$i386 -d ppc64_$ppc64 -d x86_64_$x86_64" - " -I /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Versions/A/Headers" - " -I \\\"$(DEVELOPER_DIR)/Extras/CoreAudio/AudioUnits/AUPublic/AUBase\\\"\""); + s.add ("LIBRARY_STYLE = Bundle"); + s.add ("INSTALL_PATH = \"$(HOME)/Library/Audio/Plug-Ins/Components/\""); + s.add ("WRAPPER_EXTENSION = " + getAudioPluginBundleExtension()); + s.add ("GENERATE_PKGINFO_FILE = YES"); + s.add ("OTHER_REZFLAGS = \"-d ppc_$ppc -d i386_$i386 -d ppc64_$ppc64 -d x86_64_$x86_64" + " -I /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Versions/A/Headers" + " -I \\\"$(DEVELOPER_DIR)/Extras/CoreAudio/AudioUnits/AUPublic/AUBase\\\"\""); break; case Project::browserPlugin: - settings.add ("LIBRARY_STYLE = Bundle"); - settings.add ("INSTALL_PATH = \"/Library/Internet Plug-Ins/\""); + s.add ("LIBRARY_STYLE = Bundle"); + s.add ("INSTALL_PATH = \"/Library/Internet Plug-Ins/\""); break; case Project::library: @@ -427,12 +427,12 @@ private: RelativePath binaryPath (config.getTargetBinaryRelativePath().toString(), RelativePath::projectFolder); binaryPath = binaryPath.rebased (project.getFile().getParentDirectory(), getTargetFolder(), RelativePath::buildTargetFolder); - settings.add ("DSTROOT = " + sanitisePath (binaryPath.toUnixStyle())); - settings.add ("SYMROOT = " + sanitisePath (binaryPath.toUnixStyle())); + s.add ("DSTROOT = " + sanitisePath (binaryPath.toUnixStyle())); + s.add ("SYMROOT = " + sanitisePath (binaryPath.toUnixStyle())); } - settings.add ("CONFIGURATION_BUILD_DIR = \"$(BUILD_DIR)\""); - settings.add ("DEPLOYMENT_LOCATION = YES"); + s.add ("CONFIGURATION_BUILD_DIR = \"$(BUILD_DIR)\""); + s.add ("DEPLOYMENT_LOCATION = YES"); break; default: @@ -441,27 +441,27 @@ private: if (iPhone) { - settings.add ("SDKROOT = iphonesimulator3.0"); + s.add ("SDKROOT = iphonesimulator3.0"); } else { switch ((int) config.getMacSDKVersion().getValue()) { - case 2: settings.add ("SDKROOT = macosx10.4"); settings.add ("GCC_VERSION = 4.0"); break; - case 3: settings.add ("SDKROOT = macosx10.5"); break; - case 4: settings.add ("SDKROOT = macosx10.6"); break; + case 2: s.add ("SDKROOT = macosx10.4"); s.add ("GCC_VERSION = 4.0"); break; + case 3: s.add ("SDKROOT = macosx10.5"); break; + case 4: s.add ("SDKROOT = macosx10.6"); break; default: break; } switch ((int) config.getMacCompatibilityVersion().getValue()) { - case 2: settings.add ("MACOSX_DEPLOYMENT_TARGET = 10.4"); break; - case 3: settings.add ("MACOSX_DEPLOYMENT_TARGET = 10.5"); break; - case 4: settings.add ("MACOSX_DEPLOYMENT_TARGET = 10.6"); break; + case 2: s.add ("MACOSX_DEPLOYMENT_TARGET = 10.4"); break; + case 3: s.add ("MACOSX_DEPLOYMENT_TARGET = 10.5"); break; + case 4: s.add ("MACOSX_DEPLOYMENT_TARGET = 10.6"); break; default: break; } - settings.add ("MACOSX_DEPLOYMENT_TARGET_ppc = 10.4"); + s.add ("MACOSX_DEPLOYMENT_TARGET_ppc = 10.4"); } { @@ -469,7 +469,7 @@ private: getLinkerFlags (config, linkerFlags, librarySearchPaths); if (linkerFlags.size() > 0) - settings.add ("OTHER_LDFLAGS = \"" + linkerFlags.joinIntoString (" ") + "\""); + s.add ("OTHER_LDFLAGS = \"" + linkerFlags.joinIntoString (" ") + "\""); if (librarySearchPaths.size() > 0) { @@ -478,7 +478,7 @@ private: for (int i = 0; i < librarySearchPaths.size(); ++i) libPaths += ", \"\\\"" + librarySearchPaths[i] + "\\\"\""; - settings.add (libPaths + ")"); + s.add (libPaths + ")"); } } @@ -488,17 +488,17 @@ private: { defines.add ("_DEBUG=1"); defines.add ("DEBUG=1 "); - settings.add ("ONLY_ACTIVE_ARCH = YES"); - settings.add ("COPY_PHASE_STRIP = NO"); - settings.add ("GCC_DYNAMIC_NO_PIC = NO"); - settings.add ("GCC_ENABLE_FIX_AND_CONTINUE = YES"); + s.add ("ONLY_ACTIVE_ARCH = YES"); + s.add ("COPY_PHASE_STRIP = NO"); + s.add ("GCC_DYNAMIC_NO_PIC = NO"); + s.add ("GCC_ENABLE_FIX_AND_CONTINUE = YES"); } else { defines.add ("_NDEBUG=1"); defines.add ("NDEBUG=1 "); - settings.add ("GCC_GENERATE_DEBUGGING_SYMBOLS = NO"); - settings.add ("GCC_SYMBOLS_PRIVATE_EXTERN = YES"); + s.add ("GCC_GENERATE_DEBUGGING_SYMBOLS = NO"); + s.add ("GCC_SYMBOLS_PRIVATE_EXTERN = YES"); } { @@ -513,10 +513,10 @@ private: for (int i = defines.size(); --i >= 0;) defines.set (i, defines[i].quoted()); - settings.add ("GCC_PREPROCESSOR_DEFINITIONS = (" + indentList (defines, ",") + ")"); + s.add ("GCC_PREPROCESSOR_DEFINITIONS = (" + indentList (defines, ",") + ")"); } - return settings; + return s; } void addFrameworks() @@ -565,15 +565,15 @@ private: for (int j = 0; j < o.getNumProperties(); ++j) { - const var::identifier name (o.getPropertyName(j)); - String val (o.getProperty (name).toString()); + const var::identifier propertyName (o.getPropertyName(j)); + String val (o.getProperty (propertyName).toString()); if (val.isEmpty() || (val.containsAnyOf (" \t;<>()=,-\r\n") && ! (val.trimStart().startsWithChar ('(') || val.trimStart().startsWithChar ('{')))) val = val.quoted(); - output << name.name << " = " << val << "; "; + output << propertyName.name << " = " << val << "; "; } output << "};\n"; @@ -699,12 +699,12 @@ private: frameworkFileIDs.add (fileRefID); } - void addGroup (const String& groupID, const String& name, const StringArray& childIDs) + void addGroup (const String& groupID, const String& groupName, const StringArray& childIDs) { ValueTree* v = new ValueTree (groupID); v->setProperty ("isa", "PBXGroup", 0); v->setProperty ("children", "(" + indentList (childIDs, ",") + " )", 0); - v->setProperty ("name", name, 0); + v->setProperty ("name", groupName, 0); v->setProperty ("sourceTree", "", 0); groups.add (v); } @@ -782,21 +782,21 @@ private: pbxFileReferences.add (v); } - void addTargetConfig (const String& name, const StringArray& settings) + void addTargetConfig (const String& configName, const StringArray& buildSettings) { - ValueTree* v = new ValueTree (createID ("targetconfigid_" + name)); + ValueTree* v = new ValueTree (createID ("targetconfigid_" + configName)); v->setProperty ("isa", "XCBuildConfiguration", 0); - v->setProperty ("buildSettings", "{" + indentList (settings, ";") + " }", 0); - v->setProperty ("name", name, 0); + v->setProperty ("buildSettings", "{" + indentList (buildSettings, ";") + " }", 0); + v->setProperty ("name", configName, 0); targetConfigs.add (v); } - void addProjectConfig (const String& name, const StringArray& settings) + void addProjectConfig (const String& configName, const StringArray& buildSettings) { - ValueTree* v = new ValueTree (createID ("projectconfigid_" + name)); + ValueTree* v = new ValueTree (createID ("projectconfigid_" + configName)); v->setProperty ("isa", "XCBuildConfiguration", 0); - v->setProperty ("buildSettings", "{" + indentList (settings, ";") + " }", 0); - v->setProperty ("name", name, 0); + v->setProperty ("buildSettings", "{" + indentList (buildSettings, ";") + " }", 0); + v->setProperty ("name", configName, 0); projectConfigs.add (v); } @@ -910,11 +910,11 @@ private: return createID (path.toUnixStyle()); } - const String createID (const String& name) const + const String createID (const String& rootString) const { static const char digits[] = "0123456789ABCDEF"; char n[24]; - Random ran (projectIDSalt + hashCode64 (name)); + Random ran (projectIDSalt + hashCode64 (rootString)); for (int i = 0; i < numElementsInArray (n); ++i) n[i] = digits [ran.nextInt (16)]; diff --git a/extras/Jucer (experimental)/Source/model/Project/jucer_ProjectExporter.h b/extras/Jucer (experimental)/Source/model/Project/jucer_ProjectExporter.h index b36174067a..424b0bc270 100644 --- a/extras/Jucer (experimental)/Source/model/Project/jucer_ProjectExporter.h +++ b/extras/Jucer (experimental)/Source/model/Project/jucer_ProjectExporter.h @@ -62,7 +62,7 @@ public: const File getTargetFolder() const; const ValueTree& getSettings() const { return settings; } - Value getSetting (const var::identifier& name) const { return settings.getPropertyAsValue (name, project.getUndoManagerFor (settings)); } + Value getSetting (const var::identifier& name_) const { return settings.getPropertyAsValue (name_, project.getUndoManagerFor (settings)); } Value getJuceFolder() const { return getSetting ("juceFolder"); } Value getTargetLocation() const { return getSetting ("targetFolder"); } @@ -95,7 +95,7 @@ protected: const Array getVSTFilesRequired() const; - const String getLibbedFilename (String name) const + static const String getLibbedFilename (String name) { if (! name.startsWith ("lib")) name = "lib" + name; diff --git a/extras/Jucer (experimental)/Source/model/Project/jucer_ProjectSaver.h b/extras/Jucer (experimental)/Source/model/Project/jucer_ProjectSaver.h index 96332315e2..01e7cb29bd 100644 --- a/extras/Jucer (experimental)/Source/model/Project/jucer_ProjectSaver.h +++ b/extras/Jucer (experimental)/Source/model/Project/jucer_ProjectSaver.h @@ -494,12 +494,12 @@ private: if (numJuceSourceFiles > 0) { - for (int i = 0; i <= project.getNumSeparateAmalgamatedFiles(); ++i) + for (int j = 0; j <= project.getNumSeparateAmalgamatedFiles(); ++j) { - const File sourceWrapperCpp (getSourceWrapperCpp (i)); + const File sourceWrapperCpp (getSourceWrapperCpp (j)); const File sourceWrapperMM (sourceWrapperCpp.withFileExtension (".mm")); - if ((i == 0 && numJuceSourceFiles == 1) || (i != 0 && numJuceSourceFiles > 1)) + if ((j == 0 && numJuceSourceFiles == 1) || (j != 0 && numJuceSourceFiles > 1)) { if (exporter->usesMMFiles()) exporter->juceWrapperFiles.add (RelativePath (sourceWrapperMM, targetFolder, RelativePath::buildTargetFolder)); diff --git a/extras/Jucer (experimental)/Source/ui/Code Editor/jucer_SourceCodeEditor.cpp b/extras/Jucer (experimental)/Source/ui/Code Editor/jucer_SourceCodeEditor.cpp index 6fdf09d8cd..91cf26df0e 100644 --- a/extras/Jucer (experimental)/Source/ui/Code Editor/jucer_SourceCodeEditor.cpp +++ b/extras/Jucer (experimental)/Source/ui/Code Editor/jucer_SourceCodeEditor.cpp @@ -28,10 +28,10 @@ //============================================================================== -SourceCodeEditor::SourceCodeEditor (OpenDocumentManager::Document* document, +SourceCodeEditor::SourceCodeEditor (OpenDocumentManager::Document* document_, CodeDocument& codeDocument, CodeTokeniser* const codeTokeniser) - : DocumentEditorComponent (document) + : DocumentEditorComponent (document_) { addAndMakeVisible (editor = new CodeEditorComponent (codeDocument, codeTokeniser)); diff --git a/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditor.cpp b/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditor.cpp index 747584021e..9de0c3fe1d 100644 --- a/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditor.cpp +++ b/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditor.cpp @@ -120,9 +120,9 @@ private: //============================================================================== -ComponentEditor::ComponentEditor (OpenDocumentManager::Document* document, +ComponentEditor::ComponentEditor (OpenDocumentManager::Document* document_, Project* project_, ComponentDocument* componentDocument_) - : DocumentEditorComponent (document), + : DocumentEditorComponent (document_), project (project_), componentDocument (componentDocument_), classInfoHolder (0), diff --git a/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditorToolbar.h b/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditorToolbar.h index aaa0794907..3234f8ab80 100644 --- a/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditorToolbar.h +++ b/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditorToolbar.h @@ -89,6 +89,9 @@ public: private: ComponentEditor& editor; + + ComponentEditorToolbarFactory (const ComponentEditorToolbarFactory&); + ComponentEditorToolbarFactory& operator= (const ComponentEditorToolbarFactory&); }; diff --git a/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditorTreeView.h b/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditorTreeView.h index bba9430049..b4bc06c77a 100644 --- a/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditorTreeView.h +++ b/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditorTreeView.h @@ -164,7 +164,7 @@ namespace ComponentEditorTreeView void refreshSubItems() { - ScopedPointer openness (getOpennessState()); + ScopedPointer oldOpenness (getOpennessState()); clearSubItems(); ComponentDocument& doc = editor.getDocument(); @@ -173,8 +173,8 @@ namespace ComponentEditorTreeView for (int i = 0; i < num; ++i) addSubItem (new ComponentItem (editor, doc.getComponent (i))); - if (openness != 0) - restoreOpennessState (*openness); + if (oldOpenness != 0) + restoreOpennessState (*oldOpenness); } const String getDisplayName() const { return getRenamingName(); } @@ -193,7 +193,7 @@ namespace ComponentEditorTreeView if (editor.getSelection().getNumSelected() > 0) { TreeView* tree = getOwnerView(); - const ScopedPointer openness (tree->getOpennessState (false)); + const ScopedPointer oldOpenness (tree->getOpennessState (false)); Array selectedComps; // scan the source tree rather than look at the selection manager, because it might @@ -201,8 +201,8 @@ namespace ComponentEditorTreeView getAllSelectedNodesInTree (sourceComponent, selectedComps); insertItems (selectedComps, insertIndex); - if (openness != 0) - tree->restoreOpennessState (*openness); + if (oldOpenness != 0) + tree->restoreOpennessState (*oldOpenness); } } @@ -332,14 +332,14 @@ namespace ComponentEditorTreeView const String getItemId() const { return isX ? "markersX" : "markersY"; } bool mightContainSubItems() { return true; } - void valueTreeChildrenChanged (ValueTree& tree) + void valueTreeChildrenChanged (ValueTree&) { refreshSubItems(); } void refreshSubItems() { - ScopedPointer openness (getOpennessState()); + ScopedPointer oldOpenness (getOpennessState()); clearSubItems(); ComponentDocument::MarkerList& markers = editor.getDocument().getMarkerList (isX); @@ -348,8 +348,8 @@ namespace ComponentEditorTreeView for (int i = 0; i < num; ++i) addSubItem (new MarkerItem (editor, markers.getMarker (i))); - if (openness != 0) - restoreOpennessState (*openness); + if (oldOpenness != 0) + restoreOpennessState (*oldOpenness); } const String getDisplayName() const { return getRenamingName(); } @@ -375,15 +375,15 @@ namespace ComponentEditorTreeView void refreshSubItems() { - ScopedPointer openness (getOpennessState()); + ScopedPointer oldOpenness (getOpennessState()); clearSubItems(); addSubItem (new ComponentList (editor)); addSubItem (new MarkerList (editor, true)); addSubItem (new MarkerList (editor, false)); - if (openness != 0) - restoreOpennessState (*openness); + if (oldOpenness != 0) + restoreOpennessState (*oldOpenness); } const String getDisplayName() const { return getRenamingName(); } diff --git a/extras/Jucer (experimental)/Source/ui/Drawable Editor/jucer_DrawableEditor.cpp b/extras/Jucer (experimental)/Source/ui/Drawable Editor/jucer_DrawableEditor.cpp index b6ae0cd9f1..8f81f0ab56 100644 --- a/extras/Jucer (experimental)/Source/ui/Drawable Editor/jucer_DrawableEditor.cpp +++ b/extras/Jucer (experimental)/Source/ui/Drawable Editor/jucer_DrawableEditor.cpp @@ -72,10 +72,10 @@ private: }; //============================================================================== -DrawableEditor::DrawableEditor (OpenDocumentManager::Document* document, +DrawableEditor::DrawableEditor (OpenDocumentManager::Document* document_, Project* project_, DrawableDocument* drawableDocument_) - : DocumentEditorComponent (document), + : DocumentEditorComponent (document_), project (project_), drawableDocument (drawableDocument_) { diff --git a/extras/Jucer (experimental)/Source/ui/Drawable Editor/jucer_DrawableEditorToolbar.h b/extras/Jucer (experimental)/Source/ui/Drawable Editor/jucer_DrawableEditorToolbar.h index f52b61f7e9..0cb956c1f7 100644 --- a/extras/Jucer (experimental)/Source/ui/Drawable Editor/jucer_DrawableEditorToolbar.h +++ b/extras/Jucer (experimental)/Source/ui/Drawable Editor/jucer_DrawableEditorToolbar.h @@ -86,6 +86,9 @@ public: private: DrawableEditor& editor; + + DrawableEditorToolbarFactory (const DrawableEditorToolbarFactory&); + DrawableEditorToolbarFactory& operator= (const DrawableEditorToolbarFactory&); }; diff --git a/extras/Jucer (experimental)/Source/ui/Drawable Editor/jucer_DrawableEditorTreeView.h b/extras/Jucer (experimental)/Source/ui/Drawable Editor/jucer_DrawableEditorTreeView.h index 56260a9663..3e1ee597b8 100644 --- a/extras/Jucer (experimental)/Source/ui/Drawable Editor/jucer_DrawableEditorTreeView.h +++ b/extras/Jucer (experimental)/Source/ui/Drawable Editor/jucer_DrawableEditorTreeView.h @@ -114,7 +114,7 @@ public: void refreshSubItems() { - ScopedPointer openness (getOpennessState()); + ScopedPointer oldOpenness (getOpennessState()); clearSubItems(); @@ -127,8 +127,8 @@ public: addSubItem (item); } - if (openness != 0) - restoreOpennessState (*openness); + if (oldOpenness != 0) + restoreOpennessState (*oldOpenness); editor.getSelection().changed(); } @@ -215,10 +215,10 @@ public: } // Text editor listener for renaming.. - void textEditorTextChanged (TextEditor& editor) {} - void textEditorReturnKeyPressed (TextEditor& editor) { editor.exitModalState (1); } - void textEditorEscapeKeyPressed (TextEditor& editor) { editor.exitModalState (0); } - void textEditorFocusLost (TextEditor& editor) { editor.exitModalState (0); } + void textEditorTextChanged (TextEditor& textEditor) {} + void textEditorReturnKeyPressed (TextEditor& textEditor) { textEditor.exitModalState (1); } + void textEditorEscapeKeyPressed (TextEditor& textEditor) { textEditor.exitModalState (0); } + void textEditorFocusLost (TextEditor& textEditor) { textEditor.exitModalState (0); } //============================================================================== DrawableEditor& editor; diff --git a/extras/Jucer (experimental)/Source/ui/Project Editor/jucer_ProjectTreeViewBase.cpp b/extras/Jucer (experimental)/Source/ui/Project Editor/jucer_ProjectTreeViewBase.cpp index a1a0cdcb89..a683049dd1 100644 --- a/extras/Jucer (experimental)/Source/ui/Project Editor/jucer_ProjectTreeViewBase.cpp +++ b/extras/Jucer (experimental)/Source/ui/Project Editor/jucer_ProjectTreeViewBase.cpp @@ -242,9 +242,9 @@ void ProjectTreeViewBase::deleteAllSelectedItems() for (i = itemsToRemove.size(); --i >= 0;) { - ProjectTreeViewBase* item = treeRootItem->findTreeViewItem (*itemsToRemove.getUnchecked(i)); - if (item != 0) - item->deleteItem(); + ProjectTreeViewBase* itemToRemove = treeRootItem->findTreeViewItem (*itemsToRemove.getUnchecked(i)); + if (itemToRemove != 0) + itemToRemove->deleteItem(); } } } @@ -353,12 +353,12 @@ void ProjectTreeViewBase::itemDropped (const String& sourceDescription, Componen if (selectedNodes.size() > 0) { TreeView* tree = getOwnerView(); - ScopedPointer openness (tree->getOpennessState (false)); + ScopedPointer oldOpenness (tree->getOpennessState (false)); moveSelectedItemsTo (selectedNodes, insertIndex); - if (openness != 0) - tree->restoreOpennessState (*openness); + if (oldOpenness != 0) + tree->restoreOpennessState (*oldOpenness); } } @@ -414,13 +414,13 @@ void ProjectTreeViewBase::addSubItems() void ProjectTreeViewBase::refreshSubItems() { - ScopedPointer openness (getOpennessState()); + ScopedPointer oldOpenness (getOpennessState()); clearSubItems(); addSubItems(); - if (openness != 0) - restoreOpennessState (*openness); + if (oldOpenness != 0) + restoreOpennessState (*oldOpenness); } void ProjectTreeViewBase::showMultiSelectionPopupMenu() diff --git a/extras/Jucer (experimental)/Source/utility/jucer_Coordinate.cpp b/extras/Jucer (experimental)/Source/utility/jucer_Coordinate.cpp index 2ca76c0f0a..0ececed359 100644 --- a/extras/Jucer (experimental)/Source/utility/jucer_Coordinate.cpp +++ b/extras/Jucer (experimental)/Source/utility/jucer_Coordinate.cpp @@ -338,6 +338,15 @@ void Coordinate::changeAnchor2 (const String& newMarkerName, const MarkerResolve moveToAbsolute (oldValue, markerResolver); } +void Coordinate::renameAnchorIfUsed (const String& oldName, const String& newName) +{ + if (anchor1.upToFirstOccurrenceOf (".", false, false) == oldName) + anchor1 = newName + anchor1.fromFirstOccurrenceOf (".", true, false); + + if (anchor2.upToFirstOccurrenceOf (".", false, false) == oldName) + anchor2 = newName + anchor2.fromFirstOccurrenceOf (".", true, false); +} + //============================================================================== RectangleCoordinates::RectangleCoordinates() : left (true), right (true), top (false), bottom (false) @@ -386,3 +395,11 @@ const String RectangleCoordinates::toString() const { return left.toString() + ", " + top.toString() + ", " + right.toString() + ", " + bottom.toString(); } + +void RectangleCoordinates::renameAnchorIfUsed (const String& oldName, const String& newName) +{ + left.renameAnchorIfUsed (oldName, newName); + right.renameAnchorIfUsed (oldName, newName); + top.renameAnchorIfUsed (oldName, newName); + bottom.renameAnchorIfUsed (oldName, newName); +} diff --git a/extras/Jucer (experimental)/Source/utility/jucer_Coordinate.h b/extras/Jucer (experimental)/Source/utility/jucer_Coordinate.h index 43e8c5baa2..a2459fc947 100644 --- a/extras/Jucer (experimental)/Source/utility/jucer_Coordinate.h +++ b/extras/Jucer (experimental)/Source/utility/jucer_Coordinate.h @@ -97,6 +97,9 @@ public: const String getAnchor2() const { return checkName (anchor2); } void changeAnchor2 (const String& newMarkerName, const MarkerResolver& markerResolver); + // Tells the coord that an anchor is changing its name. + void renameAnchorIfUsed (const String& oldName, const String& newName); + //============================================================================== /* Position string formats: @@ -154,6 +157,9 @@ public: void moveToAbsolute (const Rectangle& newPos, const Coordinate::MarkerResolver& markerResolver); const String toString() const; + // Tells the coord that an anchor is changing its name. + void renameAnchorIfUsed (const String& oldName, const String& newName); + Coordinate left, right, top, bottom; }; diff --git a/extras/Jucer (experimental)/Source/utility/jucer_CoordinatePropertyComponent.h b/extras/Jucer (experimental)/Source/utility/jucer_CoordinatePropertyComponent.h index 988ed473bf..dda70f90b6 100644 --- a/extras/Jucer (experimental)/Source/utility/jucer_CoordinatePropertyComponent.h +++ b/extras/Jucer (experimental)/Source/utility/jucer_CoordinatePropertyComponent.h @@ -34,9 +34,9 @@ class CoordinatePropertyComponent : public PropertyComponent, { public: //============================================================================== - CoordinatePropertyComponent (ComponentDocument& document_, const String& name, + CoordinatePropertyComponent (Coordinate::MarkerResolver& resolver_, const String& name, const Value& coordValue_, bool isHorizontal_) - : PropertyComponent (name, 40), document (document_), + : PropertyComponent (name, 40), resolver (resolver_), coordValue (coordValue_), textValue (Value (new CoordEditableValueSource (coordValue_, isHorizontal_))), isHorizontal (isHorizontal_) @@ -98,7 +98,7 @@ public: if (button == proportionButton) { - coord.toggleProportionality (document); + coord.toggleProportionality (resolver); coordValue = coord.toString(); } else if (button == anchorButton1) @@ -107,7 +107,7 @@ public: if (marker.isNotEmpty()) { - coord.changeAnchor1 (marker, document); + coord.changeAnchor1 (marker, resolver); coordValue = coord.toString(); } } @@ -117,7 +117,7 @@ public: if (marker.isNotEmpty()) { - coord.changeAnchor2 (marker, document); + coord.changeAnchor2 (marker, resolver); coordValue = coord.toString(); } } @@ -142,7 +142,7 @@ public: virtual const String pickMarker (TextButton* button, const String& currentMarker, bool isAnchor1) = 0; protected: - ComponentDocument& document; + Coordinate::MarkerResolver& resolver; Value coordValue, textValue; Label* label; TextButton* proportionButton; diff --git a/extras/Jucer (experimental)/Source/utility/jucer_MarkerListBase.h b/extras/Jucer (experimental)/Source/utility/jucer_MarkerListBase.h index 2bcb184069..749cdc0a14 100644 --- a/extras/Jucer (experimental)/Source/utility/jucer_MarkerListBase.h +++ b/extras/Jucer (experimental)/Source/utility/jucer_MarkerListBase.h @@ -26,6 +26,8 @@ #ifndef __JUCER_MARKERLISTBASE_H_E0091A88__ #define __JUCER_MARKERLISTBASE_H_E0091A88__ +#include "jucer_CoordinatePropertyComponent.h" + //============================================================================== class MarkerListBase : public Coordinate::MarkerResolver @@ -34,6 +36,7 @@ public: MarkerListBase (const ValueTree& group_, bool isX_) : group (group_), isX (isX_) {} virtual ~MarkerListBase() {} + bool isHorizontal() const { return isX; } static const String getId (const ValueTree& markerState) { return markerState [getIdProperty()]; } ValueTree& getGroup() { return group; } int size() const { return group.getNumChildren(); } @@ -47,6 +50,17 @@ public: const Coordinate getCoordinate (const ValueTree& markerState) const { return Coordinate (markerState [getMarkerPosProperty()].toString(), isX); } void setCoordinate (ValueTree& markerState, const Coordinate& newCoord) { markerState.setProperty (getMarkerPosProperty(), newCoord.toString(), getUndoManager()); } + void renameAnchorInMarkers (const String& oldName, const String& newName) + { + for (int i = size(); --i >= 0;) + { + ValueTree v (getMarker (i)); + Coordinate coord (getCoordinate (v)); + coord.renameAnchorIfUsed (oldName, newName); + setCoordinate (v, coord); + } + } + void createMarker (const String& name, int position) { ValueTree marker (getMarkerTag()); @@ -58,7 +72,12 @@ public: void deleteMarker (ValueTree& markerState) { group.removeChild (markerState, getUndoManager()); } - bool createProperties (Array & props, const String& itemId); + //============================================================================== + virtual UndoManager* getUndoManager() const = 0; + virtual const String getNonexistentMarkerName (const String& name) = 0; + virtual void renameAnchor (const String& oldName, const String& newName) = 0; + virtual void addMarkerMenuItems (const ValueTree& markerState, const Coordinate& coord, PopupMenu& menu, bool isAnchor1) = 0; + virtual const String getChosenMarkerMenuItem (const Coordinate& coord, int itemId) const = 0; //============================================================================== static const char* getMarkerTag() { return "MARKER"; } @@ -66,12 +85,91 @@ public: static const char* getMarkerNameProperty() { return "name"; } static const char* getMarkerPosProperty() { return "position"; } -protected: - virtual UndoManager* getUndoManager() const = 0; - virtual const String getNonexistentMarkerName (const String& name) = 0; + //============================================================================== + class MarkerNameValueSource : public Value::ValueSource, + public Value::Listener + { + public: + MarkerNameValueSource (MarkerListBase* markerList_, const Value& value) + : sourceValue (value), + markerList (markerList_) + { + sourceValue.addListener (this); + } + ~MarkerNameValueSource() {} + + void valueChanged (Value&) { sendChangeMessage (true); } + const var getValue() const { return sourceValue.toString(); } + + void setValue (const var& newValue) + { + if (newValue == sourceValue) + return; + + const String name (markerList->getNonexistentMarkerName (newValue)); + + if (sourceValue != name) + { + markerList->renameAnchor (sourceValue.toString(), name); + sourceValue = name; + } + } + + private: + Value sourceValue; + MarkerListBase* markerList; + + MarkerNameValueSource (const MarkerNameValueSource&); + const MarkerNameValueSource& operator= (const MarkerNameValueSource&); + }; + + //============================================================================== + class PositionPropertyComponent : public CoordinatePropertyComponent + { + public: + //============================================================================== + PositionPropertyComponent (MarkerResolver& resolver_, MarkerListBase& markerList_, + const String& name, const ValueTree& markerState_, + const Value& coordValue_) + : CoordinatePropertyComponent (resolver_, name, coordValue_, markerList_.isHorizontal()), + markerList (markerList_), + markerState (markerState_) + { + } + + ~PositionPropertyComponent() + { + } + + const String pickMarker (TextButton* button, const String& currentMarker, bool isAnchor1) + { + Coordinate coord (getCoordinate()); + + PopupMenu m; + markerList.addMarkerMenuItems (markerState, coord, m, isAnchor1); + + const int r = m.showAt (button); + + if (r > 0) + return markerList.getChosenMarkerMenuItem (coord, r); + + return String::empty; + } + + private: + MarkerListBase& markerList; + ValueTree markerState; + }; + + //============================================================================== +protected: ValueTree group; const bool isX; + +private: + MarkerListBase (const MarkerListBase&); + MarkerListBase& operator= (const MarkerListBase&); }; diff --git a/extras/Jucer (experimental)/Source/utility/jucer_UtilityFunctions.cpp b/extras/Jucer (experimental)/Source/utility/jucer_UtilityFunctions.cpp index 88adcc28f6..63860b7bbc 100644 --- a/extras/Jucer (experimental)/Source/utility/jucer_UtilityFunctions.cpp +++ b/extras/Jucer (experimental)/Source/utility/jucer_UtilityFunctions.cpp @@ -307,6 +307,9 @@ const String makeValidCppIdentifier (String s, const bool removeColons, const bool allowTemplates) { + if (s.isEmpty()) + return "unknown"; + if (removeColons) s = s.replaceCharacters (".,;:/@", "______"); else diff --git a/extras/Jucer (experimental)/Source/utility/jucer_UtilityFunctions.h b/extras/Jucer (experimental)/Source/utility/jucer_UtilityFunctions.h index 62f4260fdd..926c70c77a 100644 --- a/extras/Jucer (experimental)/Source/utility/jucer_UtilityFunctions.h +++ b/extras/Jucer (experimental)/Source/utility/jucer_UtilityFunctions.h @@ -208,7 +208,7 @@ private: int findLevelIndexForValue (const double value) const { int i; - for (i = 0; i < sizeof (tickSizes) / sizeof (*tickSizes); ++i) + for (i = 0; i < (int) (sizeof (tickSizes) / sizeof (*tickSizes)); ++i) if (tickSizes [i] >= value) break; diff --git a/extras/Jucer (experimental)/Source/utility/jucer_ValueRemapperSource.h b/extras/Jucer (experimental)/Source/utility/jucer_ValueRemapperSource.h index b501cda735..269c1cc47d 100644 --- a/extras/Jucer (experimental)/Source/utility/jucer_ValueRemapperSource.h +++ b/extras/Jucer (experimental)/Source/utility/jucer_ValueRemapperSource.h @@ -40,10 +40,10 @@ public: sourceValue.addListener (this); } - ValueRemapperSource (const Value& sourceValue_, const char** mappings) + ValueRemapperSource (const Value& sourceValue_, const char** mappings_) : sourceValue (sourceValue_) { - addMappings (mappings); + addMappings (mappings_); sourceValue.addListener (this); } @@ -58,9 +58,9 @@ public: } } - void addMapping (const var& sourceValue, const var& remappedValue) + void addMapping (const var& sourceValue_, const var& remappedValue) { - mappings.add (sourceValue); + mappings.add (sourceValue_); mappings.add (remappedValue); } diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index 0000ed44b8..d76f3b8188 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -928,7 +928,7 @@ public: virtual HIViewRef attachView (WindowRef windowRef, HIViewRef rootView) = 0; virtual void removeView (HIViewRef embeddedView) = 0; - virtual void mouseDown (int x, int y) {} + virtual void mouseDown (int, int) {} virtual void paint() {} virtual bool getEmbeddedViewSize (int& w, int& h) @@ -1097,7 +1097,7 @@ public: recursiveHIViewRepaint (HIViewGetRoot (wrapperWindow)); } - OSStatus carbonEventHandler (EventHandlerCallRef nextHandlerRef, + OSStatus carbonEventHandler (EventHandlerCallRef /*nextHandlerRef*/, EventRef event) { switch (GetEventKind (event)) @@ -14573,9 +14573,9 @@ void XmlElement::insertChildElement (XmlElement* const newNode, } } -XmlElement* XmlElement::createNewChildElement (const String& tagName) +XmlElement* XmlElement::createNewChildElement (const String& childTagName) { - XmlElement* const newElement = new XmlElement (tagName); + XmlElement* const newElement = new XmlElement (childTagName); addChildElement (newElement); return newElement; } @@ -17941,10 +17941,10 @@ bool PropertiesFile::needsToBeSaved() const return needsWriting; } -void PropertiesFile::setNeedsToBeSaved (const bool needsToBeSaved) +void PropertiesFile::setNeedsToBeSaved (const bool needsToBeSaved_) { const ScopedLock sl (getLock()); - needsWriting = needsToBeSaved; + needsWriting = needsToBeSaved_; } bool PropertiesFile::save() @@ -40563,13 +40563,13 @@ void Component::internalMouseEnter (MouseInputSource& source, const Point& { if (p->numDeepMouseListeners > 0) { - BailOutChecker checker (this, p); + BailOutChecker checker2 (this, p); for (int i = p->numDeepMouseListeners; --i >= 0;) { p->mouseListeners_->getUnchecked(i)->mouseEnter (me); - if (checker.shouldBailOut()) + if (checker2.shouldBailOut()) return; i = jmin (i, p->numDeepMouseListeners); @@ -40635,13 +40635,13 @@ void Component::internalMouseExit (MouseInputSource& source, const Point& r { if (p->numDeepMouseListeners > 0) { - BailOutChecker checker (this, p); + BailOutChecker checker2 (this, p); for (int i = p->numDeepMouseListeners; --i >= 0;) { p->mouseListeners_->getUnchecked (i)->mouseExit (me); - if (checker.shouldBailOut()) + if (checker2.shouldBailOut()) return; i = jmin (i, p->numDeepMouseListeners); @@ -40799,13 +40799,13 @@ void Component::internalMouseDown (MouseInputSource& source, const Point& r { if (p->numDeepMouseListeners > 0) { - BailOutChecker checker (this, p); + BailOutChecker checker2 (this, p); for (int i = p->numDeepMouseListeners; --i >= 0;) { p->mouseListeners_->getUnchecked (i)->mouseDown (me); - if (checker.shouldBailOut()) + if (checker2.shouldBailOut()) return; i = jmin (i, p->numDeepMouseListeners); @@ -40867,13 +40867,13 @@ void Component::internalMouseUp (MouseInputSource& source, const Point& rel { if (p->numDeepMouseListeners > 0) { - BailOutChecker checker (this, p); + BailOutChecker checker2 (this, p); for (int i = p->numDeepMouseListeners; --i >= 0;) { p->mouseListeners_->getUnchecked (i)->mouseUp (me); - if (checker.shouldBailOut()) + if (checker2.shouldBailOut()) return; i = jmin (i, p->numDeepMouseListeners); @@ -40918,13 +40918,13 @@ void Component::internalMouseUp (MouseInputSource& source, const Point& rel { if (p->numDeepMouseListeners > 0) { - BailOutChecker checker (this, p); + BailOutChecker checker2 (this, p); for (int i = p->numDeepMouseListeners; --i >= 0;) { p->mouseListeners_->getUnchecked (i)->mouseDoubleClick (me); - if (checker.shouldBailOut()) + if (checker2.shouldBailOut()) return; i = jmin (i, p->numDeepMouseListeners); @@ -40984,13 +40984,13 @@ void Component::internalMouseDrag (MouseInputSource& source, const Point& r { if (p->numDeepMouseListeners > 0) { - BailOutChecker checker (this, p); + BailOutChecker checker2 (this, p); for (int i = p->numDeepMouseListeners; --i >= 0;) { p->mouseListeners_->getUnchecked (i)->mouseDrag (me); - if (checker.shouldBailOut()) + if (checker2.shouldBailOut()) return; i = jmin (i, p->numDeepMouseListeners); @@ -41050,13 +41050,13 @@ void Component::internalMouseMove (MouseInputSource& source, const Point& r { if (p->numDeepMouseListeners > 0) { - BailOutChecker checker (this, p); + BailOutChecker checker2 (this, p); for (int i = p->numDeepMouseListeners; --i >= 0;) { p->mouseListeners_->getUnchecked (i)->mouseMove (me); - if (checker.shouldBailOut()) + if (checker2.shouldBailOut()) return; i = jmin (i, p->numDeepMouseListeners); @@ -41116,13 +41116,13 @@ void Component::internalMouseWheel (MouseInputSource& source, const Point& { if (p->numDeepMouseListeners > 0) { - BailOutChecker checker (this, p); + BailOutChecker checker2 (this, p); for (int i = p->numDeepMouseListeners; --i >= 0;) { p->mouseListeners_->getUnchecked (i)->mouseWheelMove (me, wheelIncrementX, wheelIncrementY); - if (checker.shouldBailOut()) + if (checker2.shouldBailOut()) return; i = jmin (i, p->numDeepMouseListeners); @@ -47735,7 +47735,6 @@ int ListBox::getRowNumberOfComponent (Component* const rowComponent) const throw const Rectangle ListBox::getRowPosition (const int rowNumber, const bool relativeToComponentTopLeft) const throw() { - const int rowHeight = getRowHeight(); int y = viewport->getY() + rowHeight * rowNumber; if (relativeToComponentTopLeft) @@ -52554,10 +52553,10 @@ void TextEditor::copy() { if (passwordCharacter == 0) { - const String selection (getHighlightedText()); + const String selectedText (getHighlightedText()); - if (selection.isNotEmpty()) - SystemClipboard::copyTextToClipboard (selection); + if (selectedText.isNotEmpty()) + SystemClipboard::copyTextToClipboard (selectedText); } } @@ -54535,11 +54534,11 @@ void ToolbarItemComponent::setStyle (const Toolbar::ToolbarItemStyle& newStyle) } } -void ToolbarItemComponent::paintButton (Graphics& g, bool isMouseOver, bool isMouseDown) +void ToolbarItemComponent::paintButton (Graphics& g, const bool over, const bool down) { if (isBeingUsedAsAButton) getLookAndFeel().paintToolbarButtonBackground (g, getWidth(), getHeight(), - isMouseOver, isMouseDown, *this); + over, down, *this); if (toolbarStyle != Toolbar::iconsOnly) { @@ -54563,7 +54562,7 @@ void ToolbarItemComponent::paintButton (Graphics& g, bool isMouseOver, bool isMo g.setOrigin (contentArea.getX(), contentArea.getY()); g.reduceClipRegion (0, 0, contentArea.getWidth(), contentArea.getHeight()); - paintButtonArea (g, contentArea.getWidth(), contentArea.getHeight(), isMouseOver, isMouseDown); + paintButtonArea (g, contentArea.getWidth(), contentArea.getHeight(), over, down); g.restoreState(); } @@ -54884,37 +54883,40 @@ public: const int visibleBottom = visibleTop + getParentHeight(); BigInteger itemsToKeep; - TreeViewItem* item = owner.rootItem; - int y = (item != 0 && ! owner.rootItemVisible) ? -item->itemHeight : 0; - while (item != 0 && y < visibleBottom) { - y += item->itemHeight; + TreeViewItem* item = owner.rootItem; + int y = (item != 0 && ! owner.rootItemVisible) ? -item->itemHeight : 0; - if (y >= visibleTop) + while (item != 0 && y < visibleBottom) { - const int index = rowComponentIds.indexOf (item->uid); + y += item->itemHeight; - if (index < 0) + if (y >= visibleTop) { - Component* const comp = item->createItemComponent(); + const int index = rowComponentIds.indexOf (item->uid); - if (comp != 0) + if (index < 0) { - addAndMakeVisible (comp); - itemsToKeep.setBit (rowComponentItems.size()); - rowComponentItems.add (item); - rowComponentIds.add (item->uid); - rowComponents.add (comp); + Component* const comp = item->createItemComponent(); + + if (comp != 0) + { + addAndMakeVisible (comp); + itemsToKeep.setBit (rowComponentItems.size()); + rowComponentItems.add (item); + rowComponentIds.add (item->uid); + rowComponents.add (comp); + } + } + else + { + itemsToKeep.setBit (index); } } - else - { - itemsToKeep.setBit (index); - } - } - item = item->getNextVisibleItem (true); + item = item->getNextVisibleItem (true); + } } for (int i = rowComponentItems.size(); --i >= 0;) @@ -56381,14 +56383,14 @@ const String TreeViewItem::getItemIdentifierString() const TreeViewItem* TreeViewItem::findItemFromIdentifierString (const String& identifierString) { - const String uid (getUniqueName()); + const String thisId (getUniqueName()); - if (uid == identifierString) + if (thisId == identifierString) return this; - if (identifierString.startsWith (uid + "/")) + if (identifierString.startsWith (thisId + "/")) { - const String remainingPath (identifierString.substring (uid.length() + 1)); + const String remainingPath (identifierString.substring (thisId.length() + 1)); bool wasOpen = isOpen(); setOpen (true); @@ -57090,6 +57092,8 @@ void FileBrowserComponent::fileDoubleClicked (const File& f) bool FileBrowserComponent::keyPressed (const KeyPress& key) { + (void) key; + #if JUCE_LINUX || JUCE_WINDOWS if (key.getModifiers().isCommandDown() && (key.getKeyCode() == 'H' || key.getKeyCode() == 'h')) @@ -59126,10 +59130,9 @@ void KeyMappingEditorComponent::resized() const int buttonHeight = 20; h -= buttonHeight + 8; int x = getWidth() - 8; - const int y = h + 6; resetButton->changeWidthToFitText (buttonHeight); - resetButton->setTopRightPosition (x, y); + resetButton->setTopRightPosition (x, h + 6); } tree->setBounds (0, 0, getWidth(), h); @@ -59151,7 +59154,7 @@ void KeyMappingEditorComponent::buttonClicked (Button* button) void KeyMappingEditorComponent::changeListenerCallback (void*) { - ScopedPointer openness (tree->getOpennessState (true)); + ScopedPointer oldOpenness (tree->getOpennessState (true)); clearSubItems(); @@ -59170,8 +59173,8 @@ void KeyMappingEditorComponent::changeListenerCallback (void*) addSubItem (new KeyCategoryTreeViewItem (this, categories[i])); } - if (openness != 0) - tree->restoreOpennessState (*openness); + if (oldOpenness != 0) + tree->restoreOpennessState (*oldOpenness); } class KeyEntryWindow : public AlertWindow @@ -61481,14 +61484,14 @@ public: { } - void paintButton (Graphics& g, bool isMouseOver, bool isMouseDown) + void paintButton (Graphics& g, bool over, bool down) { getLookAndFeel() .drawScrollbarButton (g, owner, getWidth(), getHeight(), direction, owner.isVertical(), - isMouseOver, isMouseDown); + over, down); } void clicked() @@ -62887,8 +62890,8 @@ class TabCompButtonBar : public TabbedButtonBar { public: TabCompButtonBar (TabbedComponent* const owner_, - const TabbedButtonBar::Orientation orientation) - : TabbedButtonBar (orientation), + const TabbedButtonBar::Orientation orientation_) + : TabbedButtonBar (orientation_), owner (owner_) { } @@ -73010,12 +73013,12 @@ public: for (int y = 0; y < height; ++y) { - const float v = 1.0f - y / (float) height; + const float val = 1.0f - y / (float) height; for (int x = 0; x < width; ++x) { - const float s = x / (float) width; - const Colour col (h, s, v, 1.0f); + const float sat = x / (float) width; + const Colour col (h, sat, val, 1.0f); PixelRGB* const pix = (PixelRGB*) pixels.getPixelPointer (x, y); pix->set (col.getPixelARGB()); @@ -73035,10 +73038,10 @@ public: void mouseDrag (const MouseEvent& e) { - const float s = (e.x - edge) / (float) (getWidth() - edge * 2); - const float v = 1.0f - (e.y - edge) / (float) (getHeight() - edge * 2); + const float sat = (e.x - edge) / (float) (getWidth() - edge * 2); + const float val = 1.0f - (e.y - edge) / (float) (getHeight() - edge * 2); - owner->setSV (s, v); + owner->setSV (sat, val); } void updateIfNeeded() @@ -73365,16 +73368,16 @@ void ColourSelector::paint (Graphics& g) if ((flags & showColourAtTop) != 0) { - const Colour colour (getCurrentColour()); + const Colour currentColour (getCurrentColour()); g.fillCheckerBoard (edgeGap, edgeGap, getWidth() - edgeGap - edgeGap, topSpace - edgeGap - edgeGap, 10, 10, - Colour (0xffdddddd).overlaidWith (colour), - Colour (0xffffffff).overlaidWith (colour)); + Colour (0xffdddddd).overlaidWith (currentColour), + Colour (0xffffffff).overlaidWith (currentColour)); - g.setColour (Colours::white.overlaidWith (colour).contrasting()); + g.setColour (Colours::white.overlaidWith (currentColour).contrasting()); g.setFont (14.0f, true); - g.drawText (colour.toDisplayString ((flags & showAlphaChannel) != 0), + g.drawText (currentColour.toDisplayString ((flags & showAlphaChannel) != 0), 0, edgeGap, getWidth(), topSpace - edgeGap * 2, Justification::centred, false); } @@ -74303,7 +74306,7 @@ void MidiKeyboardComponent::setVelocity (const float velocity_, const bool useMo useMousePositionForVelocity = useMousePositionForVelocity_; } -void MidiKeyboardComponent::getKeyPosition (int midiNoteNumber, const float keyWidth, int& x, int& w) const +void MidiKeyboardComponent::getKeyPosition (int midiNoteNumber, const float keyWidth_, int& x, int& w) const { jassert (midiNoteNumber >= 0 && midiNoteNumber < 128); @@ -74326,8 +74329,8 @@ void MidiKeyboardComponent::getKeyPosition (int midiNoteNumber, const float keyW const int octave = midiNoteNumber / 12; const int note = midiNoteNumber % 12; - x = roundToInt (octave * 7.0f * keyWidth + notePos [note] * keyWidth); - w = roundToInt (widths [note] * keyWidth); + x = roundToInt (octave * 7.0f * keyWidth_ + notePos [note] * keyWidth_); + w = roundToInt (widths [note] * keyWidth_); } void MidiKeyboardComponent::getKeyPos (int midiNoteNumber, int& x, int& w) const @@ -74649,7 +74652,7 @@ const String MidiKeyboardComponent::getWhiteNoteText (const int midiNoteNumber) } void MidiKeyboardComponent::drawUpDownButton (Graphics& g, int w, int h, - const bool isMouseOver, + const bool isMouseOver_, const bool isButtonDown, const bool movesOctavesUp) { @@ -74672,7 +74675,7 @@ void MidiKeyboardComponent::drawUpDownButton (Graphics& g, int w, int h, path.applyTransform (AffineTransform::rotation (float_Pi * 2.0f * angle, 0.5f, 0.5f)); g.setColour (findColour (upDownButtonArrowColourId) - .withAlpha (isButtonDown ? 1.0f : (isMouseOver ? 0.6f : 0.4f))); + .withAlpha (isButtonDown ? 1.0f : (isMouseOver_ ? 0.6f : 0.4f))); g.fillPath (path, path.getTransformToScaleToFit (1.0f, 1.0f, w - 2.0f, @@ -75706,9 +75709,9 @@ private: AlertTextComp& operator= (const AlertTextComp&); }; -void AlertWindow::addTextBlock (const String& text) +void AlertWindow::addTextBlock (const String& textBlock) { - AlertTextComp* const c = new AlertTextComp (text, font); + AlertTextComp* const c = new AlertTextComp (textBlock, font); textBlocks.add (c); allComps.add (c); @@ -75925,7 +75928,7 @@ void AlertWindow::updateLayout (const bool onlyIncreaseSize) for (i = 0; i < allComps.size(); ++i) { Component* const c = (Component*) allComps[i]; - int h = 22; + h = 22; const int comboIndex = comboBoxes.indexOf (c); if (comboIndex >= 0 && comboBoxNames [comboIndex].isNotEmpty()) @@ -76006,10 +76009,10 @@ bool AlertWindow::keyPressed (const KeyPress& key) void AlertWindow::lookAndFeelChanged() { - const int flags = getLookAndFeel().getAlertBoxWindowFlags(); + const int newFlags = getLookAndFeel().getAlertBoxWindowFlags(); - setUsingNativeTitleBar ((flags & ComponentPeer::windowHasTitleBar) != 0); - setDropShadowEnabled (isOpaque() && (flags & ComponentPeer::windowHasDropShadow) != 0); + setUsingNativeTitleBar ((newFlags & ComponentPeer::windowHasTitleBar) != 0); + setDropShadowEnabled (isOpaque() && (newFlags & ComponentPeer::windowHasDropShadow) != 0); } int AlertWindow::getDesktopWindowStyleFlags() const @@ -76947,18 +76950,18 @@ Button* DocumentWindow::getMaximiseButton() const throw() int DocumentWindow::getDesktopWindowStyleFlags() const { - int flags = ResizableWindow::getDesktopWindowStyleFlags(); + int styleFlags = ResizableWindow::getDesktopWindowStyleFlags(); if ((requiredButtons & minimiseButton) != 0) - flags |= ComponentPeer::windowHasMinimiseButton; + styleFlags |= ComponentPeer::windowHasMinimiseButton; if ((requiredButtons & maximiseButton) != 0) - flags |= ComponentPeer::windowHasMaximiseButton; + styleFlags |= ComponentPeer::windowHasMaximiseButton; if ((requiredButtons & closeButton) != 0) - flags |= ComponentPeer::windowHasCloseButton; + styleFlags |= ComponentPeer::windowHasCloseButton; - return flags; + return styleFlags; } void DocumentWindow::lookAndFeelChanged() @@ -77098,12 +77101,12 @@ ResizableWindow::~ResizableWindow() int ResizableWindow::getDesktopWindowStyleFlags() const { - int flags = TopLevelWindow::getDesktopWindowStyleFlags(); + int styleFlags = TopLevelWindow::getDesktopWindowStyleFlags(); - if (isResizable() && (flags & ComponentPeer::windowHasTitleBar) != 0) - flags |= ComponentPeer::windowIsResizable; + if (isResizable() && (styleFlags & ComponentPeer::windowHasTitleBar) != 0) + styleFlags |= ComponentPeer::windowIsResizable; - return flags; + return styleFlags; } void ResizableWindow::setContentComponent (Component* const newContentComponent, @@ -78046,15 +78049,15 @@ void TopLevelWindow::visibilityChanged() int TopLevelWindow::getDesktopWindowStyleFlags() const { - int flags = ComponentPeer::windowAppearsOnTaskbar; + int styleFlags = ComponentPeer::windowAppearsOnTaskbar; if (useDropShadow) - flags |= ComponentPeer::windowHasDropShadow; + styleFlags |= ComponentPeer::windowHasDropShadow; if (useNativeTitleBar) - flags |= ComponentPeer::windowHasTitleBar; + styleFlags |= ComponentPeer::windowHasTitleBar; - return flags; + return styleFlags; } void TopLevelWindow::setDropShadowEnabled (const bool useShadow) @@ -84427,8 +84430,8 @@ private: gradient.isRadial = fillXml->hasTagName ("radialGradient"); - float width = viewBoxW; - float height = viewBoxH; + float gradientWidth = viewBoxW; + float gradientHeight = viewBoxH; float dx = 0.0f; float dy = 0.0f; @@ -84439,16 +84442,16 @@ private: const Rectangle bounds (path.getBounds()); dx = bounds.getX(); dy = bounds.getY(); - width = bounds.getWidth(); - height = bounds.getHeight(); + gradientWidth = bounds.getWidth(); + gradientHeight = bounds.getHeight(); } if (gradient.isRadial) { - gradient.x1 = dx + getCoordLength (fillXml->getStringAttribute ("cx", "50%"), width); - gradient.y1 = dy + getCoordLength (fillXml->getStringAttribute ("cy", "50%"), height); + gradient.x1 = dx + getCoordLength (fillXml->getStringAttribute ("cx", "50%"), gradientWidth); + gradient.y1 = dy + getCoordLength (fillXml->getStringAttribute ("cy", "50%"), gradientHeight); - const float radius = getCoordLength (fillXml->getStringAttribute ("r", "50%"), width); + const float radius = getCoordLength (fillXml->getStringAttribute ("r", "50%"), gradientWidth); gradient.x2 = gradient.x1 + radius; gradient.y2 = gradient.y1; @@ -84457,11 +84460,11 @@ private: } else { - gradient.x1 = dx + getCoordLength (fillXml->getStringAttribute ("x1", "0%"), width); - gradient.y1 = dy + getCoordLength (fillXml->getStringAttribute ("y1", "0%"), height); + gradient.x1 = dx + getCoordLength (fillXml->getStringAttribute ("x1", "0%"), gradientWidth); + gradient.y1 = dy + getCoordLength (fillXml->getStringAttribute ("y1", "0%"), gradientHeight); - gradient.x2 = dx + getCoordLength (fillXml->getStringAttribute ("x2", "100%"), width); - gradient.y2 = dy + getCoordLength (fillXml->getStringAttribute ("y2", "0%"), height); + gradient.x2 = dx + getCoordLength (fillXml->getStringAttribute ("x2", "100%"), gradientWidth); + gradient.y2 = dy + getCoordLength (fillXml->getStringAttribute ("y2", "0%"), gradientHeight); if (gradient.x1 == gradient.x2 && gradient.y1 == gradient.y2) return Colour (gradient.getColour (gradient.getNumColours() - 1)); @@ -84484,7 +84487,7 @@ private: const PathStrokeType getStrokeFor (const XmlElement* const xml) const { - const String width (getStyleAttribute (xml, "stroke-width")); + const String strokeWidth (getStyleAttribute (xml, "stroke-width")); const String cap (getStyleAttribute (xml, "stroke-linecap")); const String join (getStyleAttribute (xml, "stroke-linejoin")); @@ -84507,10 +84510,10 @@ private: float ox = 0.0f, oy = 0.0f; transform.transformPoint (ox, oy); - float x = getCoordLength (width, viewBoxW), y = 0.0f; + float x = getCoordLength (strokeWidth, viewBoxW), y = 0.0f; transform.transformPoint (x, y); - return PathStrokeType (width.isNotEmpty() ? juce_hypotf (x - ox, y - oy) : 1.0f, + return PathStrokeType (strokeWidth.isNotEmpty() ? juce_hypotf (x - ox, y - oy) : 1.0f, joinStyle, capStyle); } @@ -85154,6 +85157,8 @@ namespace FontValues } static const float defaultFontHeight = 14.0f; + + static String fallbackFont; } Font::SharedFontInternal::SharedFontInternal (const String& typefaceName_, const float height_, const float horizontalScale_, @@ -85271,16 +85276,14 @@ void Font::setTypefaceName (const String& faceName) throw() } } -static String fallbackFont; - const String Font::getFallbackFontName() throw() { - return fallbackFont; + return FontValues::fallbackFont; } void Font::setFallbackFontName (const String& name) throw() { - fallbackFont = name; + FontValues::fallbackFont = name; } void Font::setHeight (float newHeight) throw() @@ -88627,9 +88630,9 @@ void Path::loadPathFromStream (InputStream& source) } } -void Path::loadPathFromData (const void* const data, const int numberOfBytes) +void Path::loadPathFromData (const void* const pathData, const int numberOfBytes) { - MemoryInputStream in (data, numberOfBytes, false); + MemoryInputStream in (pathData, numberOfBytes, false); loadPathFromStream (in); } @@ -186729,7 +186732,7 @@ compress_first_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf) */ METHODDEF(boolean) -compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf) +compress_output (j_compress_ptr cinfo, JSAMPIMAGE) { my_coef_ptr coef = (my_coef_ptr) cinfo->coef; JDIMENSION MCU_col_num; /* index of current MCU within row */ @@ -187159,7 +187162,7 @@ null_convert (j_compress_ptr cinfo, */ METHODDEF(void) -null_method (j_compress_ptr cinfo) +null_method (j_compress_ptr) { /* no work needed */ } @@ -189211,7 +189214,7 @@ emit_dht (j_compress_ptr cinfo, int index, boolean is_ac) } LOCAL(void) -emit_dac (j_compress_ptr cinfo) +emit_dac (j_compress_ptr) /* Emit a DAC marker */ /* Since the useful info is so small, we want to emit all the tables in */ /* one DAC marker. Therefore this routine does its own scan of the table. */ @@ -192056,7 +192059,7 @@ typedef my_downsampler * my_downsample_ptr; */ METHODDEF(void) -start_pass_downsample (j_compress_ptr cinfo) +start_pass_downsample (j_compress_ptr) { /* no work for now */ } @@ -192751,7 +192754,7 @@ start_pass_coef2 (j_compress_ptr cinfo, J_BUF_MODE pass_mode) */ METHODDEF(boolean) -compress_output2 (j_compress_ptr cinfo, JSAMPIMAGE input_buf) +compress_output2 (j_compress_ptr cinfo, JSAMPIMAGE) { my_coef_ptr2 coef = (my_coef_ptr2) cinfo->coef; JDIMENSION MCU_col_num; /* index of current MCU within row */ @@ -193911,7 +193914,7 @@ skip_input_data (j_decompress_ptr cinfo, long num_bytes) */ METHODDEF(void) -term_source (j_decompress_ptr cinfo) +term_source (j_decompress_ptr) { /* no work necessary here */ } @@ -194162,7 +194165,7 @@ decompress_onepass (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) */ METHODDEF(int) -dummy_consume_data (j_decompress_ptr cinfo) +dummy_consume_data (j_decompress_ptr) { return JPEG_SUSPENDED; /* Always indicate nothing was done */ } @@ -194941,7 +194944,7 @@ ycck_cmyk_convert (j_decompress_ptr cinfo, */ METHODDEF(void) -start_pass_dcolor (j_decompress_ptr cinfo) +start_pass_dcolor (j_decompress_ptr) { /* no work needed */ } @@ -198843,7 +198846,7 @@ start_pass_merged_upsample (j_decompress_ptr cinfo) METHODDEF(void) merged_2v_upsample (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, - JDIMENSION in_row_groups_avail, + JDIMENSION, JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail) /* 2:1 vertical sampling case: may need a spare row. */ @@ -198891,9 +198894,9 @@ merged_2v_upsample (j_decompress_ptr cinfo, METHODDEF(void) merged_1v_upsample (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, - JDIMENSION in_row_groups_avail, + JDIMENSION, JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail) + JDIMENSION) /* 1:1 vertical sampling case: much easier, never need a spare row. */ { my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; @@ -199853,8 +199856,8 @@ METHODDEF(void) post_process_prepass (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, JDIMENSION in_row_groups_avail, - JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail) + JSAMPARRAY, JDIMENSION *out_row_ctr, + JDIMENSION) { my_post_ptr post = (my_post_ptr) cinfo->post; JDIMENSION old_next_row, num_rows; @@ -199894,8 +199897,8 @@ post_process_prepass (j_decompress_ptr cinfo, METHODDEF(void) post_process_2pass (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, - JDIMENSION in_row_groups_avail, + JSAMPIMAGE, JDIMENSION *, + JDIMENSION, JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail) { @@ -200051,7 +200054,7 @@ start_pass_upsample (j_decompress_ptr cinfo) METHODDEF(void) sep_upsample (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, - JDIMENSION in_row_groups_avail, + JDIMENSION, JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail) { @@ -200115,7 +200118,7 @@ sep_upsample (j_decompress_ptr cinfo, */ METHODDEF(void) -fullsize_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, +fullsize_upsample (j_decompress_ptr, jpeg_component_info *, JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) { *output_data_ptr = input_data; @@ -200127,8 +200130,8 @@ fullsize_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, */ METHODDEF(void) -noop_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +noop_upsample (j_decompress_ptr, jpeg_component_info *, + JSAMPARRAY, JSAMPARRAY * output_data_ptr) { *output_data_ptr = NULL; /* safety check */ } @@ -200188,7 +200191,7 @@ int_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, */ METHODDEF(void) -h2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, +h2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info *, JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) { JSAMPARRAY output_data = *output_data_ptr; @@ -200215,7 +200218,7 @@ h2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, */ METHODDEF(void) -h2v2_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, +h2v2_upsample (j_decompress_ptr cinfo, jpeg_component_info *, JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) { JSAMPARRAY output_data = *output_data_ptr; @@ -203678,13 +203681,13 @@ extern void free JPP((void *ptr)); */ GLOBAL(void *) -jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject) +jpeg_get_small (j_common_ptr , size_t sizeofobject) { return (void *) malloc(sizeofobject); } GLOBAL(void) -jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject) +jpeg_free_small (j_common_ptr , void * object, size_t) { free(object); } @@ -203697,13 +203700,13 @@ jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject) */ GLOBAL(void FAR *) -jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject) +jpeg_get_large (j_common_ptr, size_t sizeofobject) { return (void FAR *) malloc(sizeofobject); } GLOBAL(void) -jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject) +jpeg_free_large (j_common_ptr, void FAR * object, size_t) { free(object); } @@ -203714,8 +203717,8 @@ jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject) */ GLOBAL(long) -jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed, - long max_bytes_needed, long already_allocated) +jpeg_mem_available (j_common_ptr, long, + long max_bytes_needed, long) { return max_bytes_needed; } @@ -203727,8 +203730,8 @@ jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed, */ GLOBAL(void) -jpeg_open_backing_store (j_common_ptr cinfo, struct backing_store_struct *info, - long total_bytes_needed) +jpeg_open_backing_store (j_common_ptr cinfo, struct backing_store_struct *, + long ) { ERREXIT(cinfo, JERR_NO_BACKING_STORE); } @@ -203739,13 +203742,13 @@ jpeg_open_backing_store (j_common_ptr cinfo, struct backing_store_struct *info, */ GLOBAL(long) -jpeg_mem_init (j_common_ptr cinfo) +jpeg_mem_init (j_common_ptr) { return 0; /* just set max_memory_to_use to 0 */ } GLOBAL(void) -jpeg_mem_term (j_common_ptr cinfo) +jpeg_mem_term (j_common_ptr) { /* no work */ } @@ -203976,7 +203979,7 @@ select_ncolors (j_decompress_ptr cinfo, int Ncolors[]) } LOCAL(int) -output_value (j_decompress_ptr cinfo, int ci, int j, int maxj) +output_value (j_decompress_ptr, int, int j, int maxj) /* Return j'th output value, where j will range from 0 to maxj */ /* The output values must fall in 0..MAXJSAMPLE in increasing order */ { @@ -203989,7 +203992,7 @@ output_value (j_decompress_ptr cinfo, int ci, int j, int maxj) } LOCAL(int) -largest_input_value (j_decompress_ptr cinfo, int ci, int j, int maxj) +largest_input_value (j_decompress_ptr, int, int j, int maxj) /* Return largest input value that should map to j'th output value */ /* Must have largest(j=0) >= 0, and largest(j=maxj) >= MAXJSAMPLE */ { @@ -204460,7 +204463,7 @@ alloc_fs_workspace (j_decompress_ptr cinfo) */ METHODDEF(void) -start_pass_1_quant (j_decompress_ptr cinfo, boolean is_pre_scan) +start_pass_1_quant (j_decompress_ptr cinfo, boolean) { my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; size_t arraysize; @@ -204516,7 +204519,7 @@ start_pass_1_quant (j_decompress_ptr cinfo, boolean is_pre_scan) */ METHODDEF(void) -finish_pass_1_quant (j_decompress_ptr cinfo) +finish_pass_1_quant (j_decompress_ptr) { /* no work in 1-pass case */ } @@ -204774,7 +204777,7 @@ typedef my_cquantizer2 * my_cquantize_ptr2; METHODDEF(void) prescan_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf, - JSAMPARRAY output_buf, int num_rows) + JSAMPARRAY, int num_rows) { my_cquantize_ptr2 cquantize = (my_cquantize_ptr2) cinfo->cquantize; register JSAMPROW ptr; @@ -205688,7 +205691,7 @@ finish_pass1 (j_decompress_ptr cinfo) } METHODDEF(void) -finish_pass2 (j_decompress_ptr cinfo) +finish_pass2 (j_decompress_ptr) { /* no work */ } @@ -206825,7 +206828,7 @@ trim_bottom_edge (j_compress_ptr dstinfo) */ GLOBAL(jvirt_barray_ptr *) -jtransform_adjust_parameters (j_decompress_ptr srcinfo, +jtransform_adjust_parameters (j_decompress_ptr, j_compress_ptr dstinfo, jvirt_barray_ptr *src_coef_arrays, jpeg_transform_info *info) @@ -206978,7 +206981,7 @@ jcopy_markers_setup (j_decompress_ptr srcinfo, JCOPY_OPTION option) GLOBAL(void) jcopy_markers_execute (j_decompress_ptr srcinfo, j_compress_ptr dstinfo, - JCOPY_OPTION option) + JCOPY_OPTION) { jpeg_saved_marker_ptr marker; @@ -213427,7 +213430,7 @@ png_chunk_warning(png_structp png_ptr, png_const_charp warning_message) * error function pointer in png_set_error_fn(). */ static void /* PRIVATE */ -png_default_error(png_structp png_ptr, png_const_charp error_message) +png_default_error(png_structp, png_const_charp error_message) { #ifndef PNG_NO_CONSOLE_IO #ifdef PNG_ERROR_NUMBERS_SUPPORTED @@ -225305,7 +225308,7 @@ png_do_read_interlace(png_structp png_ptr) #endif /* PNG_READ_INTERLACING_SUPPORTED */ void /* PRIVATE */ -png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep row, +png_read_filter_row(png_structp, png_row_infop row_info, png_bytep row, png_bytep prev_row, int filter) { png_debug(1, "in png_read_filter_row\n"); @@ -226948,7 +226951,7 @@ png_set_invalid(png_structp png_ptr, png_infop info_ptr, int mask) #ifdef PNG_ASSEMBLER_CODE_SUPPORTED /* function was added to libpng 1.2.0 and should always exist by default */ void PNGAPI -png_set_asm_flags (png_structp png_ptr, png_uint_32 asm_flags) +png_set_asm_flags (png_structp png_ptr, png_uint_32) { /* Obsolete as of libpng-1.2.20 and will be removed from libpng-1.4.0 */ if (png_ptr != NULL) @@ -226958,8 +226961,8 @@ png_set_asm_flags (png_structp png_ptr, png_uint_32 asm_flags) /* this function was added to libpng 1.2.0 */ void PNGAPI png_set_mmx_thresholds (png_structp png_ptr, - png_byte mmx_bitdepth_threshold, - png_uint_32 mmx_rowbytes_threshold) + png_byte, + png_uint_32) { /* Obsolete as of libpng-1.2.20 and will be removed from libpng-1.4.0 */ if (png_ptr == NULL) @@ -249487,7 +249490,7 @@ void File::getFileTimesInternal (int64& modificationTime, int64& accessTime, int } } -bool File::setFileTimesInternal (int64 modificationTime, int64 accessTime, int64 creationTime) const +bool File::setFileTimesInternal (int64 modificationTime, int64 accessTime, int64 /*creationTime*/) const { struct utimbuf times; times.actime = (time_t) (accessTime / 1000); @@ -258751,8 +258754,9 @@ public: runLoopThread->signalThreadShouldExit(); } -- (void) connection: (NSURLConnection*) connection didReceiveResponse: (NSURLResponse*) response +- (void) connection: (NSURLConnection*) conn didReceiveResponse: (NSURLResponse*) response { + (void) conn; [dataLock lock]; [data setLength: 0]; [dataLock unlock]; @@ -258760,8 +258764,9 @@ public: contentLength = [response expectedContentLength]; } -- (void) connection: (NSURLConnection*) connection didFailWithError: (NSError*) error +- (void) connection: (NSURLConnection*) conn didFailWithError: (NSError*) error { + (void) conn; DBG (nsStringToJuce ([error description])); hasFailed = true; initialised = true; @@ -258770,16 +258775,18 @@ public: runLoopThread->signalThreadShouldExit(); } -- (void) connection: (NSURLConnection*) connection didReceiveData: (NSData*) newData +- (void) connection: (NSURLConnection*) conn didReceiveData: (NSData*) newData { + (void) conn; [dataLock lock]; [data appendData: newData]; [dataLock unlock]; initialised = true; } -- (void) connectionDidFinishLoading: (NSURLConnection*) connection +- (void) connectionDidFinishLoading: (NSURLConnection*) conn { + (void) conn; hasFinished = true; initialised = true; @@ -258926,7 +258933,7 @@ int64 juce_getInternetFileContentLength (void* handle) return -1; } -int juce_seekInInternetFile (void* handle, int newPosition) +int juce_seekInInternetFile (void* handle, int /*newPosition*/) { JuceURLConnection* const s = (JuceURLConnection*) handle; @@ -259195,7 +259202,7 @@ void Thread::yield() sched_yield(); } -void Thread::setCurrentThreadAffinityMask (const uint32 affinityMask) +void Thread::setCurrentThreadAffinityMask (const uint32 /*affinityMask*/) { // xxx jassertfalse @@ -259225,7 +259232,7 @@ void Process::terminate() exit (0); } -void Process::setPriority (ProcessPriority p) +void Process::setPriority (ProcessPriority) { // xxx } @@ -259494,7 +259501,7 @@ void File::getFileTimesInternal (int64& modificationTime, int64& accessTime, int } } -bool File::setFileTimesInternal (int64 modificationTime, int64 accessTime, int64 creationTime) const +bool File::setFileTimesInternal (int64 modificationTime, int64 accessTime, int64 /*creationTime*/) const { struct utimbuf times; times.actime = (time_t) (accessTime / 1000); @@ -260487,7 +260494,7 @@ bool AlertWindow::showNativeDialogBox (const String& title, nil) == NSAlertDefaultReturn; } -bool DragAndDropContainer::performExternalDragDropOfFiles (const StringArray& files, const bool canMoveFiles) +bool DragAndDropContainer::performExternalDragDropOfFiles (const StringArray& files, const bool /*canMoveFiles*/) { if (files.size() == 0) return false; @@ -260542,7 +260549,7 @@ bool DragAndDropContainer::performExternalDragDropOfFiles (const StringArray& fi return true; } -bool DragAndDropContainer::performExternalDragDropOfText (const String& text) +bool DragAndDropContainer::performExternalDragDropOfText (const String& /*text*/) { jassertfalse // not implemented! return false; @@ -261412,7 +261419,7 @@ public: AffineTransform t (AffineTransform::scale (1.0f, -1.0f).translated (0, sourceImage.getHeight()).followedBy (transform)); applyTransform (t); - CGRect r = CGRectMake (0, 0, sourceImage.getWidth(), sourceImage.getHeight()); + CGRect r = CGRectMake (srcClip.getX(), srcClip.getY(), srcClip.getWidth(), srcClip.getHeight()); CGContextClipToMask (context, r, image); applyTransform (t.inverted()); @@ -263128,6 +263135,7 @@ using namespace JUCE_NAMESPACE; - (BOOL) panel: (id) sender shouldShowFilename: (NSString*) filename { + (void) sender; const File f (nsStringToJuce (filename)); for (int i = filters->size(); --i >= 0;) @@ -263819,7 +263827,7 @@ void* MouseCursor::createStandardMouseCursor (MouseCursor::StandardCursorType ty return c; } -void MouseCursor::deleteMouseCursor (void* const cursorHandle, const bool isStandard) +void MouseCursor::deleteMouseCursor (void* const cursorHandle, const bool /*isStandard*/) { [((NSCursor*) cursorHandle) release]; } @@ -263886,6 +263894,10 @@ END_JUCE_NAMESPACE frame: (WebFrame*) frame decisionListener: (id ) listener { + (void) sender; + (void) request; + (void) frame; + NSURL* url = [actionInformation valueForKey: @"WebActionOriginalURLKey"]; if (ownerComponent->pageAboutToLoad (nsStringToJuce ([url absoluteString]))) @@ -264033,7 +264045,7 @@ void WebBrowserComponent::refresh() browser->refresh(); } -void WebBrowserComponent::paint (Graphics& g) +void WebBrowserComponent::paint (Graphics&) { } @@ -264082,7 +264094,7 @@ void WebBrowserComponent::visibilityChanged() checkWindowAssociation(); } -bool WebBrowserComponent::pageAboutToLoad (const String& url) +bool WebBrowserComponent::pageAboutToLoad (const String&) { return true; } @@ -265001,12 +265013,12 @@ void MidiOutput::reset() { } -bool MidiOutput::getVolume (float& leftVol, float& rightVol) +bool MidiOutput::getVolume (float& /*leftVol*/, float& /*rightVol*/) { return false; } -void MidiOutput::setVolume (float leftVol, float rightVol) +void MidiOutput::setVolume (float /*leftVol*/, float /*rightVol*/) { } @@ -265160,7 +265172,7 @@ namespace CoreMidiCallbacks static void midiInputProc (const MIDIPacketList* pktlist, void* readProcRefCon, - void* srcConnRefCon) + void* /*srcConnRefCon*/) { double time = Time::getMillisecondCounterHiRes() * 0.001; const double originalTime = time; @@ -265342,12 +265354,12 @@ void MidiOutput::reset() { } -bool MidiOutput::getVolume (float& leftVol, float& rightVol) +bool MidiOutput::getVolume (float& /*leftVol*/, float& /*rightVol*/) { return false; } -void MidiOutput::setVolume (float leftVol, float rightVol) +void MidiOutput::setVolume (float /*leftVol*/, float /*rightVol*/) { } @@ -266081,7 +266093,7 @@ public: AffineTransform t (AffineTransform::scale (1.0f, -1.0f).translated (0, sourceImage.getHeight()).followedBy (transform)); applyTransform (t); - CGRect r = CGRectMake (0, 0, sourceImage.getWidth(), sourceImage.getHeight()); + CGRect r = CGRectMake (srcClip.getX(), srcClip.getY(), srcClip.getWidth(), srcClip.getHeight()); CGContextClipToMask (context, r, image); applyTransform (t.inverted()); @@ -266976,11 +266988,13 @@ END_JUCE_NAMESPACE - (BOOL) acceptsFirstMouse: (NSEvent*) ev { + (void) ev; return YES; } - (void) frameChanged: (NSNotification*) n { + (void) n; if (owner != 0) owner->redirectMovedOrResized(); } @@ -267036,10 +267050,13 @@ END_JUCE_NAMESPACE - (void) doCommandBySelector: (SEL) aSelector { + (void) aSelector; } - (void) setMarkedText: (id) aString selectedRange: (NSRange) selectionRange { + (void) selectionRange; + if (stringBeingComposed == 0) stringBeingComposed = new String(); @@ -267120,6 +267137,7 @@ END_JUCE_NAMESPACE - (NSRect) firstRectForCharacterRange: (NSRange) theRange { + (void) theRange; JUCE_NAMESPACE::Component* const comp = dynamic_cast (owner->findCurrentTextInputTarget()); if (comp == 0) @@ -267135,6 +267153,7 @@ END_JUCE_NAMESPACE - (unsigned int) characterIndexForPoint: (NSPoint) thePoint { + (void) thePoint; return NSNotFound; } @@ -267218,6 +267237,7 @@ END_JUCE_NAMESPACE - (BOOL) prepareForDragOperation: (id ) sender { + (void) sender; return YES; } @@ -267228,6 +267248,7 @@ END_JUCE_NAMESPACE - (void) concludeDragOperation: (id ) sender { + (void) sender; } @end @@ -267255,11 +267276,13 @@ END_JUCE_NAMESPACE - (BOOL) windowShouldClose: (id) window { + (void) window; return owner == 0 || owner->windowShouldClose(); } - (NSRect) constrainFrameRect: (NSRect) frameRect toScreen: (NSScreen*) screen { + (void) screen; if (owner != 0) frameRect = owner->constrainRect (frameRect); @@ -267268,6 +267291,7 @@ END_JUCE_NAMESPACE - (NSSize) windowWillResize: (NSWindow*) window toSize: (NSSize) proposedFrameSize { + (void) window; if (isZooming) return proposedFrameSize; @@ -267290,6 +267314,8 @@ END_JUCE_NAMESPACE - (void) windowWillMove: (NSNotification*) notification { + (void) notification; + if (JUCE_NAMESPACE::Component::getCurrentlyModalComponent() != 0 && owner->getComponent()->isCurrentlyBlockedByAnotherModalComponent() && (owner->getStyleFlags() & JUCE_NAMESPACE::ComponentPeer::windowHasTitleBar) != 0) @@ -268341,7 +268367,7 @@ void* MouseCursor::createStandardMouseCursor (MouseCursor::StandardCursorType ty return c; } -void MouseCursor::deleteMouseCursor (void* const cursorHandle, const bool isStandard) +void MouseCursor::deleteMouseCursor (void* const cursorHandle, const bool /*isStandard*/) { [((NSCursor*) cursorHandle) release]; } @@ -268489,7 +268515,7 @@ void* NSViewComponent::getView() const return info == 0 ? 0 : info->view; } -void NSViewComponent::paint (Graphics& g) +void NSViewComponent::paint (Graphics&) { } @@ -269627,6 +269653,8 @@ END_JUCE_NAMESPACE - (void) menuNeedsUpdate: (NSMenu*) menu; { + (void) menu; + if (JuceMainMenuHandler::instance != 0) JuceMainMenuHandler::instance->updateMenus(); } @@ -269808,6 +269836,7 @@ using namespace JUCE_NAMESPACE; - (BOOL) panel: (id) sender shouldShowFilename: (NSString*) filename { + (void) sender; const File f (nsStringToJuce (filename)); for (int i = filters->size(); --i >= 0;) @@ -271002,31 +271031,37 @@ using namespace JUCE_NAMESPACE; - (NSApplicationTerminateReply) applicationShouldTerminate: (NSApplication*) app { + (void) app; return redirector->shouldTerminate(); } - (BOOL) application: (NSApplication*) app openFile: (NSString*) filename { + (void) app; return redirector->openFile (filename); } - (void) application: (NSApplication*) sender openFiles: (NSArray*) filenames { + (void) sender; return redirector->openFiles (filenames); } -- (void) applicationDidBecomeActive: (NSNotification*) aNotification +- (void) applicationDidBecomeActive: (NSNotification*) notification { + (void) notification; redirector->focusChanged(); } -- (void) applicationDidResignActive: (NSNotification*) aNotification +- (void) applicationDidResignActive: (NSNotification*) notification { + (void) notification; redirector->focusChanged(); } -- (void) applicationWillUnhide: (NSNotification*) aNotification +- (void) applicationWillUnhide: (NSNotification*) notification { + (void) notification; redirector->focusChanged(); } @@ -271310,6 +271345,10 @@ END_JUCE_NAMESPACE frame: (WebFrame*) frame decisionListener: (id ) listener { + (void) sender; + (void) request; + (void) frame; + NSURL* url = [actionInformation valueForKey: @"WebActionOriginalURLKey"]; if (ownerComponent->pageAboutToLoad (nsStringToJuce ([url absoluteString]))) @@ -271457,7 +271496,7 @@ void WebBrowserComponent::refresh() browser->refresh(); } -void WebBrowserComponent::paint (Graphics& g) +void WebBrowserComponent::paint (Graphics&) { } @@ -271506,7 +271545,7 @@ void WebBrowserComponent::visibilityChanged() checkWindowAssociation(); } -bool WebBrowserComponent::pageAboutToLoad (const String& url) +bool WebBrowserComponent::pageAboutToLoad (const String&) { return true; } @@ -271888,7 +271927,7 @@ public: { StringArray s; HeapBlock types; - const int num = getAllDataSourcesForDevice (deviceID, input, types); + const int num = getAllDataSourcesForDevice (deviceID, types); for (int i = 0; i < num; ++i) { @@ -271933,7 +271972,7 @@ public: if (OK (AudioObjectGetPropertyData (deviceID, &pa, 0, 0, &size, ¤tSourceID))) { HeapBlock types; - const int num = getAllDataSourcesForDevice (deviceID, input, types); + const int num = getAllDataSourcesForDevice (deviceID, types); for (int i = 0; i < num; ++i) { @@ -271954,7 +271993,7 @@ public: if (deviceID != 0) { HeapBlock types; - const int num = getAllDataSourcesForDevice (deviceID, input, types); + const int num = getAllDataSourcesForDevice (deviceID, types); if (((unsigned int) index) < (unsigned int) num) { @@ -272345,12 +272384,12 @@ private: CoreAudioInternal (const CoreAudioInternal&); CoreAudioInternal& operator= (const CoreAudioInternal&); - static OSStatus audioIOProc (AudioDeviceID inDevice, - const AudioTimeStamp* inNow, + static OSStatus audioIOProc (AudioDeviceID /*inDevice*/, + const AudioTimeStamp* /*inNow*/, const AudioBufferList* inInputData, - const AudioTimeStamp* inInputTime, + const AudioTimeStamp* /*inInputTime*/, AudioBufferList* outOutputData, - const AudioTimeStamp* inOutputTime, + const AudioTimeStamp* /*inOutputTime*/, void* device) { static_cast (device)->audioCallback (inInputData, outOutputData); @@ -272383,7 +272422,7 @@ private: return noErr; } - static int getAllDataSourcesForDevice (AudioDeviceID deviceID, const bool input, HeapBlock & types) + static int getAllDataSourcesForDevice (AudioDeviceID deviceID, HeapBlock & types) { AudioObjectPropertyAddress pa; pa.mSelector = kAudioDevicePropertyDataSources; @@ -273154,12 +273193,12 @@ void MidiOutput::reset() { } -bool MidiOutput::getVolume (float& leftVol, float& rightVol) +bool MidiOutput::getVolume (float& /*leftVol*/, float& /*rightVol*/) { return false; } -void MidiOutput::setVolume (float leftVol, float rightVol) +void MidiOutput::setVolume (float /*leftVol*/, float /*rightVol*/) { } @@ -273313,7 +273352,7 @@ namespace CoreMidiCallbacks static void midiInputProc (const MIDIPacketList* pktlist, void* readProcRefCon, - void* srcConnRefCon) + void* /*srcConnRefCon*/) { double time = Time::getMillisecondCounterHiRes() * 0.001; const double originalTime = time; @@ -273495,12 +273534,12 @@ void MidiOutput::reset() { } -bool MidiOutput::getVolume (float& leftVol, float& rightVol) +bool MidiOutput::getVolume (float& /*leftVol*/, float& /*rightVol*/) { return false; } -void MidiOutput::setVolume (float leftVol, float rightVol) +void MidiOutput::setVolume (float /*leftVol*/, float /*rightVol*/) { } diff --git a/juce_amalgamated.h b/juce_amalgamated.h index 6fc7aa9367..8bf0545e70 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -5740,10 +5740,10 @@ public: #define juce_InterlockedDecrement64(a) _InterlockedDecrement64(a) #else // None of these atomics are available in a 32-bit Windows build!! - static __int64 juce_InterlockedExchangeAdd64 (volatile __int64* a, __int64 b) throw() { jassertfalse; __int64 old = *a; *a += b; return old; } - static __int64 juce_InterlockedExchange64 (volatile __int64* a, __int64 b) throw() { jassertfalse; __int64 old = *a; *a = b; return old; } - static __int64 juce_InterlockedIncrement64 (volatile __int64* a) throw() { jassertfalse; return ++*a; } - static __int64 juce_InterlockedDecrement64 (volatile __int64* a) throw() { jassertfalse; return --*a; } + template static Type juce_InterlockedExchangeAdd64 (volatile Type* a, Type b) throw() { jassertfalse; Type old = *a; *a += b; return old; } + template static Type juce_InterlockedExchange64 (volatile Type* a, Type b) throw() { jassertfalse; Type old = *a; *a = b; return old; } + template static Type juce_InterlockedIncrement64 (volatile Type* a) throw() { jassertfalse; return ++*a; } + template static Type juce_InterlockedDecrement64 (volatile Type* a) throw() { jassertfalse; return --*a; } #endif #endif @@ -20390,12 +20390,12 @@ public: transform.transformPoint (x3, y3); transform.transformPoint (x4, y4); - const float x = jmin (x1, x2, x3, x4); - const float y = jmin (y1, y2, y3, y4); + const float rx = jmin (x1, x2, x3, x4); + const float ry = jmin (y1, y2, y3, y4); - return Rectangle (x, y, - jmax (x1, x2, x3, x4) - x, - jmax (y1, y2, y3, y4) - y); + return Rectangle (rx, ry, + jmax (x1, x2, x3, x4) - rx, + jmax (y1, y2, y3, y4) - ry); } /** Returns the smallest integer-aligned rectangle that completely contains this one. @@ -26352,13 +26352,8 @@ private: // hierarchies. You might need to give your subclasses a private dummy constructor like // this one to avoid compiler warnings. Component (const Component&); - Component& operator= (const Component&); - // (dummy method to cause a deliberate compile error - if you hit this, you need to update your - // subclass to use the new parameters to keyStateChanged) - virtual void keyStateChanged() {}; - protected: /** @internal */ virtual void internalRepaint (int x, int y, int w, int h); @@ -44798,14 +44793,6 @@ public: */ virtual void valueChanged(); - /** Callback to indicate that the user has just moved the slider. - Note - the valueChanged() method has changed its format and now no longer has - any parameters. Update your code to use the new version. - This version has been left here with an int as its return value to cause - a syntax error if you've got existing code that uses the old version. - */ - virtual int valueChanged (double) { jassertfalse; return 0; } - /** Subclasses can override this to convert a text string to a value. When the user enters something into the text-entry box, this method is @@ -53360,14 +53347,14 @@ public: For example, if the item is an object, you might want to call it and tell it that it's being selected. */ - virtual void itemSelected (SelectableItemType item) {} + virtual void itemSelected (SelectableItemType item) { (void) item; } /** Can be overridden to do special handling when an item is deselected. For example, if the item is an object, you might want to call it and tell it that it's being deselected. */ - virtual void itemDeselected (SelectableItemType item) {} + virtual void itemDeselected (SelectableItemType item) { (void) item; } /** Used internally, but can be called to force a change message to be sent to the ChangeListeners. */ @@ -53580,7 +53567,7 @@ public: } /** @internal */ - bool hitTest (int x, int y) { return false; } + bool hitTest (int, int) { return false; } juce_UseDebuggingNewOperator diff --git a/src/core/juce_Atomic.h b/src/core/juce_Atomic.h index 7824a199a7..ec05ad0298 100644 --- a/src/core/juce_Atomic.h +++ b/src/core/juce_Atomic.h @@ -191,10 +191,10 @@ public: #define juce_InterlockedDecrement64(a) _InterlockedDecrement64(a) #else // None of these atomics are available in a 32-bit Windows build!! - static __int64 juce_InterlockedExchangeAdd64 (volatile __int64* a, __int64 b) throw() { jassertfalse; __int64 old = *a; *a += b; return old; } - static __int64 juce_InterlockedExchange64 (volatile __int64* a, __int64 b) throw() { jassertfalse; __int64 old = *a; *a = b; return old; } - static __int64 juce_InterlockedIncrement64 (volatile __int64* a) throw() { jassertfalse; return ++*a; } - static __int64 juce_InterlockedDecrement64 (volatile __int64* a) throw() { jassertfalse; return --*a; } + template static Type juce_InterlockedExchangeAdd64 (volatile Type* a, Type b) throw() { jassertfalse; Type old = *a; *a += b; return old; } + template static Type juce_InterlockedExchange64 (volatile Type* a, Type b) throw() { jassertfalse; Type old = *a; *a = b; return old; } + template static Type juce_InterlockedIncrement64 (volatile Type* a) throw() { jassertfalse; return ++*a; } + template static Type juce_InterlockedDecrement64 (volatile Type* a) throw() { jassertfalse; return --*a; } #endif #endif diff --git a/src/gui/components/controls/juce_ListBox.cpp b/src/gui/components/controls/juce_ListBox.cpp index 05a01bca33..db8830c1e8 100644 --- a/src/gui/components/controls/juce_ListBox.cpp +++ b/src/gui/components/controls/juce_ListBox.cpp @@ -657,7 +657,6 @@ int ListBox::getRowNumberOfComponent (Component* const rowComponent) const throw const Rectangle ListBox::getRowPosition (const int rowNumber, const bool relativeToComponentTopLeft) const throw() { - const int rowHeight = getRowHeight(); int y = viewport->getY() + rowHeight * rowNumber; if (relativeToComponentTopLeft) diff --git a/src/gui/components/controls/juce_Slider.h b/src/gui/components/controls/juce_Slider.h index f0d3c03fd0..0f37757d48 100644 --- a/src/gui/components/controls/juce_Slider.h +++ b/src/gui/components/controls/juce_Slider.h @@ -579,14 +579,6 @@ public: */ virtual void valueChanged(); - /** Callback to indicate that the user has just moved the slider. - Note - the valueChanged() method has changed its format and now no longer has - any parameters. Update your code to use the new version. - This version has been left here with an int as its return value to cause - a syntax error if you've got existing code that uses the old version. - */ - virtual int valueChanged (double) { jassertfalse; return 0; } - //============================================================================== /** Subclasses can override this to convert a text string to a value. diff --git a/src/gui/components/controls/juce_TextEditor.cpp b/src/gui/components/controls/juce_TextEditor.cpp index 28b5fb986a..d482a8e574 100644 --- a/src/gui/components/controls/juce_TextEditor.cpp +++ b/src/gui/components/controls/juce_TextEditor.cpp @@ -1631,10 +1631,10 @@ void TextEditor::copy() { if (passwordCharacter == 0) { - const String selection (getHighlightedText()); + const String selectedText (getHighlightedText()); - if (selection.isNotEmpty()) - SystemClipboard::copyTextToClipboard (selection); + if (selectedText.isNotEmpty()) + SystemClipboard::copyTextToClipboard (selectedText); } } diff --git a/src/gui/components/controls/juce_ToolbarItemComponent.cpp b/src/gui/components/controls/juce_ToolbarItemComponent.cpp index 7fe849d95c..e01b8a53e8 100644 --- a/src/gui/components/controls/juce_ToolbarItemComponent.cpp +++ b/src/gui/components/controls/juce_ToolbarItemComponent.cpp @@ -190,11 +190,11 @@ void ToolbarItemComponent::setStyle (const Toolbar::ToolbarItemStyle& newStyle) } } -void ToolbarItemComponent::paintButton (Graphics& g, bool isMouseOver, bool isMouseDown) +void ToolbarItemComponent::paintButton (Graphics& g, const bool over, const bool down) { if (isBeingUsedAsAButton) getLookAndFeel().paintToolbarButtonBackground (g, getWidth(), getHeight(), - isMouseOver, isMouseDown, *this); + over, down, *this); if (toolbarStyle != Toolbar::iconsOnly) { @@ -218,7 +218,7 @@ void ToolbarItemComponent::paintButton (Graphics& g, bool isMouseOver, bool isMo g.setOrigin (contentArea.getX(), contentArea.getY()); g.reduceClipRegion (0, 0, contentArea.getWidth(), contentArea.getHeight()); - paintButtonArea (g, contentArea.getWidth(), contentArea.getHeight(), isMouseOver, isMouseDown); + paintButtonArea (g, contentArea.getWidth(), contentArea.getHeight(), over, down); g.restoreState(); } diff --git a/src/gui/components/controls/juce_TreeView.cpp b/src/gui/components/controls/juce_TreeView.cpp index 5c1b1df568..0805a6cfab 100644 --- a/src/gui/components/controls/juce_TreeView.cpp +++ b/src/gui/components/controls/juce_TreeView.cpp @@ -205,37 +205,40 @@ public: const int visibleBottom = visibleTop + getParentHeight(); BigInteger itemsToKeep; - TreeViewItem* item = owner.rootItem; - int y = (item != 0 && ! owner.rootItemVisible) ? -item->itemHeight : 0; - while (item != 0 && y < visibleBottom) { - y += item->itemHeight; + TreeViewItem* item = owner.rootItem; + int y = (item != 0 && ! owner.rootItemVisible) ? -item->itemHeight : 0; - if (y >= visibleTop) + while (item != 0 && y < visibleBottom) { - const int index = rowComponentIds.indexOf (item->uid); + y += item->itemHeight; - if (index < 0) + if (y >= visibleTop) { - Component* const comp = item->createItemComponent(); + const int index = rowComponentIds.indexOf (item->uid); - if (comp != 0) + if (index < 0) { - addAndMakeVisible (comp); - itemsToKeep.setBit (rowComponentItems.size()); - rowComponentItems.add (item); - rowComponentIds.add (item->uid); - rowComponents.add (comp); + Component* const comp = item->createItemComponent(); + + if (comp != 0) + { + addAndMakeVisible (comp); + itemsToKeep.setBit (rowComponentItems.size()); + rowComponentItems.add (item); + rowComponentIds.add (item->uid); + rowComponents.add (comp); + } + } + else + { + itemsToKeep.setBit (index); } } - else - { - itemsToKeep.setBit (index); - } - } - item = item->getNextVisibleItem (true); + item = item->getNextVisibleItem (true); + } } for (int i = rowComponentItems.size(); --i >= 0;) @@ -1716,14 +1719,14 @@ const String TreeViewItem::getItemIdentifierString() const TreeViewItem* TreeViewItem::findItemFromIdentifierString (const String& identifierString) { - const String uid (getUniqueName()); + const String thisId (getUniqueName()); - if (uid == identifierString) + if (thisId == identifierString) return this; - if (identifierString.startsWith (uid + "/")) + if (identifierString.startsWith (thisId + "/")) { - const String remainingPath (identifierString.substring (uid.length() + 1)); + const String remainingPath (identifierString.substring (thisId.length() + 1)); bool wasOpen = isOpen(); setOpen (true); diff --git a/src/gui/components/filebrowser/juce_FileBrowserComponent.cpp b/src/gui/components/filebrowser/juce_FileBrowserComponent.cpp index 623a97401a..7ac5960477 100644 --- a/src/gui/components/filebrowser/juce_FileBrowserComponent.cpp +++ b/src/gui/components/filebrowser/juce_FileBrowserComponent.cpp @@ -370,6 +370,8 @@ void FileBrowserComponent::fileDoubleClicked (const File& f) bool FileBrowserComponent::keyPressed (const KeyPress& key) { + (void) key; + #if JUCE_LINUX || JUCE_WINDOWS if (key.getModifiers().isCommandDown() && (key.getKeyCode() == 'H' || key.getKeyCode() == 'h')) diff --git a/src/gui/components/juce_Component.cpp b/src/gui/components/juce_Component.cpp index ed30b1ce2f..4f6f777938 100644 --- a/src/gui/components/juce_Component.cpp +++ b/src/gui/components/juce_Component.cpp @@ -2186,13 +2186,13 @@ void Component::internalMouseEnter (MouseInputSource& source, const Point& { if (p->numDeepMouseListeners > 0) { - BailOutChecker checker (this, p); + BailOutChecker checker2 (this, p); for (int i = p->numDeepMouseListeners; --i >= 0;) { p->mouseListeners_->getUnchecked(i)->mouseEnter (me); - if (checker.shouldBailOut()) + if (checker2.shouldBailOut()) return; i = jmin (i, p->numDeepMouseListeners); @@ -2258,13 +2258,13 @@ void Component::internalMouseExit (MouseInputSource& source, const Point& r { if (p->numDeepMouseListeners > 0) { - BailOutChecker checker (this, p); + BailOutChecker checker2 (this, p); for (int i = p->numDeepMouseListeners; --i >= 0;) { p->mouseListeners_->getUnchecked (i)->mouseExit (me); - if (checker.shouldBailOut()) + if (checker2.shouldBailOut()) return; i = jmin (i, p->numDeepMouseListeners); @@ -2425,13 +2425,13 @@ void Component::internalMouseDown (MouseInputSource& source, const Point& r { if (p->numDeepMouseListeners > 0) { - BailOutChecker checker (this, p); + BailOutChecker checker2 (this, p); for (int i = p->numDeepMouseListeners; --i >= 0;) { p->mouseListeners_->getUnchecked (i)->mouseDown (me); - if (checker.shouldBailOut()) + if (checker2.shouldBailOut()) return; i = jmin (i, p->numDeepMouseListeners); @@ -2494,13 +2494,13 @@ void Component::internalMouseUp (MouseInputSource& source, const Point& rel { if (p->numDeepMouseListeners > 0) { - BailOutChecker checker (this, p); + BailOutChecker checker2 (this, p); for (int i = p->numDeepMouseListeners; --i >= 0;) { p->mouseListeners_->getUnchecked (i)->mouseUp (me); - if (checker.shouldBailOut()) + if (checker2.shouldBailOut()) return; i = jmin (i, p->numDeepMouseListeners); @@ -2545,13 +2545,13 @@ void Component::internalMouseUp (MouseInputSource& source, const Point& rel { if (p->numDeepMouseListeners > 0) { - BailOutChecker checker (this, p); + BailOutChecker checker2 (this, p); for (int i = p->numDeepMouseListeners; --i >= 0;) { p->mouseListeners_->getUnchecked (i)->mouseDoubleClick (me); - if (checker.shouldBailOut()) + if (checker2.shouldBailOut()) return; i = jmin (i, p->numDeepMouseListeners); @@ -2611,13 +2611,13 @@ void Component::internalMouseDrag (MouseInputSource& source, const Point& r { if (p->numDeepMouseListeners > 0) { - BailOutChecker checker (this, p); + BailOutChecker checker2 (this, p); for (int i = p->numDeepMouseListeners; --i >= 0;) { p->mouseListeners_->getUnchecked (i)->mouseDrag (me); - if (checker.shouldBailOut()) + if (checker2.shouldBailOut()) return; i = jmin (i, p->numDeepMouseListeners); @@ -2677,13 +2677,13 @@ void Component::internalMouseMove (MouseInputSource& source, const Point& r { if (p->numDeepMouseListeners > 0) { - BailOutChecker checker (this, p); + BailOutChecker checker2 (this, p); for (int i = p->numDeepMouseListeners; --i >= 0;) { p->mouseListeners_->getUnchecked (i)->mouseMove (me); - if (checker.shouldBailOut()) + if (checker2.shouldBailOut()) return; i = jmin (i, p->numDeepMouseListeners); @@ -2743,13 +2743,13 @@ void Component::internalMouseWheel (MouseInputSource& source, const Point& { if (p->numDeepMouseListeners > 0) { - BailOutChecker checker (this, p); + BailOutChecker checker2 (this, p); for (int i = p->numDeepMouseListeners; --i >= 0;) { p->mouseListeners_->getUnchecked (i)->mouseWheelMove (me, wheelIncrementX, wheelIncrementY); - if (checker.shouldBailOut()) + if (checker2.shouldBailOut()) return; i = jmin (i, p->numDeepMouseListeners); diff --git a/src/gui/components/juce_Component.h b/src/gui/components/juce_Component.h index 1f8520b288..c2d612ee0e 100644 --- a/src/gui/components/juce_Component.h +++ b/src/gui/components/juce_Component.h @@ -2084,13 +2084,8 @@ private: // hierarchies. You might need to give your subclasses a private dummy constructor like // this one to avoid compiler warnings. Component (const Component&); - Component& operator= (const Component&); - // (dummy method to cause a deliberate compile error - if you hit this, you need to update your - // subclass to use the new parameters to keyStateChanged) - virtual void keyStateChanged() {}; - protected: /** @internal */ virtual void internalRepaint (int x, int y, int w, int h); diff --git a/src/gui/components/keyboard/juce_KeyMappingEditorComponent.cpp b/src/gui/components/keyboard/juce_KeyMappingEditorComponent.cpp index b3c067fee5..063eb6c038 100644 --- a/src/gui/components/keyboard/juce_KeyMappingEditorComponent.cpp +++ b/src/gui/components/keyboard/juce_KeyMappingEditorComponent.cpp @@ -356,10 +356,9 @@ void KeyMappingEditorComponent::resized() const int buttonHeight = 20; h -= buttonHeight + 8; int x = getWidth() - 8; - const int y = h + 6; resetButton->changeWidthToFitText (buttonHeight); - resetButton->setTopRightPosition (x, y); + resetButton->setTopRightPosition (x, h + 6); } tree->setBounds (0, 0, getWidth(), h); @@ -381,7 +380,7 @@ void KeyMappingEditorComponent::buttonClicked (Button* button) void KeyMappingEditorComponent::changeListenerCallback (void*) { - ScopedPointer openness (tree->getOpennessState (true)); + ScopedPointer oldOpenness (tree->getOpennessState (true)); clearSubItems(); @@ -400,8 +399,8 @@ void KeyMappingEditorComponent::changeListenerCallback (void*) addSubItem (new KeyCategoryTreeViewItem (this, categories[i])); } - if (openness != 0) - tree->restoreOpennessState (*openness); + if (oldOpenness != 0) + tree->restoreOpennessState (*oldOpenness); } //============================================================================== diff --git a/src/gui/components/layout/juce_ScrollBar.cpp b/src/gui/components/layout/juce_ScrollBar.cpp index 394079dda7..401c6a4b43 100644 --- a/src/gui/components/layout/juce_ScrollBar.cpp +++ b/src/gui/components/layout/juce_ScrollBar.cpp @@ -50,14 +50,14 @@ public: { } - void paintButton (Graphics& g, bool isMouseOver, bool isMouseDown) + void paintButton (Graphics& g, bool over, bool down) { getLookAndFeel() .drawScrollbarButton (g, owner, getWidth(), getHeight(), direction, owner.isVertical(), - isMouseOver, isMouseDown); + over, down); } void clicked() diff --git a/src/gui/components/layout/juce_TabbedComponent.cpp b/src/gui/components/layout/juce_TabbedComponent.cpp index 359edc3359..a233bb2ecd 100644 --- a/src/gui/components/layout/juce_TabbedComponent.cpp +++ b/src/gui/components/layout/juce_TabbedComponent.cpp @@ -36,8 +36,8 @@ class TabCompButtonBar : public TabbedButtonBar { public: TabCompButtonBar (TabbedComponent* const owner_, - const TabbedButtonBar::Orientation orientation) - : TabbedButtonBar (orientation), + const TabbedButtonBar::Orientation orientation_) + : TabbedButtonBar (orientation_), owner (owner_) { } diff --git a/src/gui/components/mouse/juce_LassoComponent.h b/src/gui/components/mouse/juce_LassoComponent.h index 0c40410547..4061e5e0b1 100644 --- a/src/gui/components/mouse/juce_LassoComponent.h +++ b/src/gui/components/mouse/juce_LassoComponent.h @@ -228,7 +228,7 @@ public: } /** @internal */ - bool hitTest (int x, int y) { return false; } + bool hitTest (int, int) { return false; } //============================================================================== juce_UseDebuggingNewOperator diff --git a/src/gui/components/special/juce_ColourSelector.cpp b/src/gui/components/special/juce_ColourSelector.cpp index c19a960542..161ae75b4a 100644 --- a/src/gui/components/special/juce_ColourSelector.cpp +++ b/src/gui/components/special/juce_ColourSelector.cpp @@ -124,12 +124,12 @@ public: for (int y = 0; y < height; ++y) { - const float v = 1.0f - y / (float) height; + const float val = 1.0f - y / (float) height; for (int x = 0; x < width; ++x) { - const float s = x / (float) width; - const Colour col (h, s, v, 1.0f); + const float sat = x / (float) width; + const Colour col (h, sat, val, 1.0f); PixelRGB* const pix = (PixelRGB*) pixels.getPixelPointer (x, y); pix->set (col.getPixelARGB()); @@ -149,10 +149,10 @@ public: void mouseDrag (const MouseEvent& e) { - const float s = (e.x - edge) / (float) (getWidth() - edge * 2); - const float v = 1.0f - (e.y - edge) / (float) (getHeight() - edge * 2); + const float sat = (e.x - edge) / (float) (getWidth() - edge * 2); + const float val = 1.0f - (e.y - edge) / (float) (getHeight() - edge * 2); - owner->setSV (s, v); + owner->setSV (sat, val); } void updateIfNeeded() @@ -486,16 +486,16 @@ void ColourSelector::paint (Graphics& g) if ((flags & showColourAtTop) != 0) { - const Colour colour (getCurrentColour()); + const Colour currentColour (getCurrentColour()); g.fillCheckerBoard (edgeGap, edgeGap, getWidth() - edgeGap - edgeGap, topSpace - edgeGap - edgeGap, 10, 10, - Colour (0xffdddddd).overlaidWith (colour), - Colour (0xffffffff).overlaidWith (colour)); + Colour (0xffdddddd).overlaidWith (currentColour), + Colour (0xffffffff).overlaidWith (currentColour)); - g.setColour (Colours::white.overlaidWith (colour).contrasting()); + g.setColour (Colours::white.overlaidWith (currentColour).contrasting()); g.setFont (14.0f, true); - g.drawText (colour.toDisplayString ((flags & showAlphaChannel) != 0), + g.drawText (currentColour.toDisplayString ((flags & showAlphaChannel) != 0), 0, edgeGap, getWidth(), topSpace - edgeGap * 2, Justification::centred, false); } diff --git a/src/gui/components/special/juce_MidiKeyboardComponent.cpp b/src/gui/components/special/juce_MidiKeyboardComponent.cpp index 6cdf6fff2e..d459b0003c 100644 --- a/src/gui/components/special/juce_MidiKeyboardComponent.cpp +++ b/src/gui/components/special/juce_MidiKeyboardComponent.cpp @@ -204,7 +204,7 @@ void MidiKeyboardComponent::setVelocity (const float velocity_, const bool useMo } //============================================================================== -void MidiKeyboardComponent::getKeyPosition (int midiNoteNumber, const float keyWidth, int& x, int& w) const +void MidiKeyboardComponent::getKeyPosition (int midiNoteNumber, const float keyWidth_, int& x, int& w) const { jassert (midiNoteNumber >= 0 && midiNoteNumber < 128); @@ -227,8 +227,8 @@ void MidiKeyboardComponent::getKeyPosition (int midiNoteNumber, const float keyW const int octave = midiNoteNumber / 12; const int note = midiNoteNumber % 12; - x = roundToInt (octave * 7.0f * keyWidth + notePos [note] * keyWidth); - w = roundToInt (widths [note] * keyWidth); + x = roundToInt (octave * 7.0f * keyWidth_ + notePos [note] * keyWidth_); + w = roundToInt (widths [note] * keyWidth_); } void MidiKeyboardComponent::getKeyPos (int midiNoteNumber, int& x, int& w) const @@ -551,7 +551,7 @@ const String MidiKeyboardComponent::getWhiteNoteText (const int midiNoteNumber) } void MidiKeyboardComponent::drawUpDownButton (Graphics& g, int w, int h, - const bool isMouseOver, + const bool isMouseOver_, const bool isButtonDown, const bool movesOctavesUp) { @@ -574,7 +574,7 @@ void MidiKeyboardComponent::drawUpDownButton (Graphics& g, int w, int h, path.applyTransform (AffineTransform::rotation (float_Pi * 2.0f * angle, 0.5f, 0.5f)); g.setColour (findColour (upDownButtonArrowColourId) - .withAlpha (isButtonDown ? 1.0f : (isMouseOver ? 0.6f : 0.4f))); + .withAlpha (isButtonDown ? 1.0f : (isMouseOver_ ? 0.6f : 0.4f))); g.fillPath (path, path.getTransformToScaleToFit (1.0f, 1.0f, w - 2.0f, diff --git a/src/gui/components/windows/juce_AlertWindow.cpp b/src/gui/components/windows/juce_AlertWindow.cpp index 5fe6c3fe02..199a09333a 100644 --- a/src/gui/components/windows/juce_AlertWindow.cpp +++ b/src/gui/components/windows/juce_AlertWindow.cpp @@ -297,9 +297,9 @@ private: AlertTextComp& operator= (const AlertTextComp&); }; -void AlertWindow::addTextBlock (const String& text) +void AlertWindow::addTextBlock (const String& textBlock) { - AlertTextComp* const c = new AlertTextComp (text, font); + AlertTextComp* const c = new AlertTextComp (textBlock, font); textBlocks.add (c); allComps.add (c); @@ -519,7 +519,7 @@ void AlertWindow::updateLayout (const bool onlyIncreaseSize) for (i = 0; i < allComps.size(); ++i) { Component* const c = (Component*) allComps[i]; - int h = 22; + h = 22; const int comboIndex = comboBoxes.indexOf (c); if (comboIndex >= 0 && comboBoxNames [comboIndex].isNotEmpty()) @@ -601,10 +601,10 @@ bool AlertWindow::keyPressed (const KeyPress& key) void AlertWindow::lookAndFeelChanged() { - const int flags = getLookAndFeel().getAlertBoxWindowFlags(); + const int newFlags = getLookAndFeel().getAlertBoxWindowFlags(); - setUsingNativeTitleBar ((flags & ComponentPeer::windowHasTitleBar) != 0); - setDropShadowEnabled (isOpaque() && (flags & ComponentPeer::windowHasDropShadow) != 0); + setUsingNativeTitleBar ((newFlags & ComponentPeer::windowHasTitleBar) != 0); + setDropShadowEnabled (isOpaque() && (newFlags & ComponentPeer::windowHasDropShadow) != 0); } int AlertWindow::getDesktopWindowStyleFlags() const diff --git a/src/gui/components/windows/juce_DocumentWindow.cpp b/src/gui/components/windows/juce_DocumentWindow.cpp index 29231aca84..5626ecce67 100644 --- a/src/gui/components/windows/juce_DocumentWindow.cpp +++ b/src/gui/components/windows/juce_DocumentWindow.cpp @@ -304,18 +304,18 @@ Button* DocumentWindow::getMaximiseButton() const throw() int DocumentWindow::getDesktopWindowStyleFlags() const { - int flags = ResizableWindow::getDesktopWindowStyleFlags(); + int styleFlags = ResizableWindow::getDesktopWindowStyleFlags(); if ((requiredButtons & minimiseButton) != 0) - flags |= ComponentPeer::windowHasMinimiseButton; + styleFlags |= ComponentPeer::windowHasMinimiseButton; if ((requiredButtons & maximiseButton) != 0) - flags |= ComponentPeer::windowHasMaximiseButton; + styleFlags |= ComponentPeer::windowHasMaximiseButton; if ((requiredButtons & closeButton) != 0) - flags |= ComponentPeer::windowHasCloseButton; + styleFlags |= ComponentPeer::windowHasCloseButton; - return flags; + return styleFlags; } void DocumentWindow::lookAndFeelChanged() diff --git a/src/gui/components/windows/juce_ResizableWindow.cpp b/src/gui/components/windows/juce_ResizableWindow.cpp index c2238a049b..9847754d9b 100644 --- a/src/gui/components/windows/juce_ResizableWindow.cpp +++ b/src/gui/components/windows/juce_ResizableWindow.cpp @@ -88,12 +88,12 @@ ResizableWindow::~ResizableWindow() int ResizableWindow::getDesktopWindowStyleFlags() const { - int flags = TopLevelWindow::getDesktopWindowStyleFlags(); + int styleFlags = TopLevelWindow::getDesktopWindowStyleFlags(); - if (isResizable() && (flags & ComponentPeer::windowHasTitleBar) != 0) - flags |= ComponentPeer::windowIsResizable; + if (isResizable() && (styleFlags & ComponentPeer::windowHasTitleBar) != 0) + styleFlags |= ComponentPeer::windowIsResizable; - return flags; + return styleFlags; } //============================================================================== diff --git a/src/gui/components/windows/juce_TopLevelWindow.cpp b/src/gui/components/windows/juce_TopLevelWindow.cpp index d14614d10a..8260a2388d 100644 --- a/src/gui/components/windows/juce_TopLevelWindow.cpp +++ b/src/gui/components/windows/juce_TopLevelWindow.cpp @@ -202,15 +202,15 @@ void TopLevelWindow::visibilityChanged() int TopLevelWindow::getDesktopWindowStyleFlags() const { - int flags = ComponentPeer::windowAppearsOnTaskbar; + int styleFlags = ComponentPeer::windowAppearsOnTaskbar; if (useDropShadow) - flags |= ComponentPeer::windowHasDropShadow; + styleFlags |= ComponentPeer::windowHasDropShadow; if (useNativeTitleBar) - flags |= ComponentPeer::windowHasTitleBar; + styleFlags |= ComponentPeer::windowHasTitleBar; - return flags; + return styleFlags; } void TopLevelWindow::setDropShadowEnabled (const bool useShadow) diff --git a/src/gui/graphics/drawables/juce_SVGParser.cpp b/src/gui/graphics/drawables/juce_SVGParser.cpp index abf57d5242..1678c83b06 100644 --- a/src/gui/graphics/drawables/juce_SVGParser.cpp +++ b/src/gui/graphics/drawables/juce_SVGParser.cpp @@ -734,8 +734,8 @@ private: gradient.isRadial = fillXml->hasTagName ("radialGradient"); - float width = viewBoxW; - float height = viewBoxH; + float gradientWidth = viewBoxW; + float gradientHeight = viewBoxH; float dx = 0.0f; float dy = 0.0f; @@ -746,16 +746,16 @@ private: const Rectangle bounds (path.getBounds()); dx = bounds.getX(); dy = bounds.getY(); - width = bounds.getWidth(); - height = bounds.getHeight(); + gradientWidth = bounds.getWidth(); + gradientHeight = bounds.getHeight(); } if (gradient.isRadial) { - gradient.x1 = dx + getCoordLength (fillXml->getStringAttribute ("cx", "50%"), width); - gradient.y1 = dy + getCoordLength (fillXml->getStringAttribute ("cy", "50%"), height); + gradient.x1 = dx + getCoordLength (fillXml->getStringAttribute ("cx", "50%"), gradientWidth); + gradient.y1 = dy + getCoordLength (fillXml->getStringAttribute ("cy", "50%"), gradientHeight); - const float radius = getCoordLength (fillXml->getStringAttribute ("r", "50%"), width); + const float radius = getCoordLength (fillXml->getStringAttribute ("r", "50%"), gradientWidth); gradient.x2 = gradient.x1 + radius; gradient.y2 = gradient.y1; @@ -764,11 +764,11 @@ private: } else { - gradient.x1 = dx + getCoordLength (fillXml->getStringAttribute ("x1", "0%"), width); - gradient.y1 = dy + getCoordLength (fillXml->getStringAttribute ("y1", "0%"), height); + gradient.x1 = dx + getCoordLength (fillXml->getStringAttribute ("x1", "0%"), gradientWidth); + gradient.y1 = dy + getCoordLength (fillXml->getStringAttribute ("y1", "0%"), gradientHeight); - gradient.x2 = dx + getCoordLength (fillXml->getStringAttribute ("x2", "100%"), width); - gradient.y2 = dy + getCoordLength (fillXml->getStringAttribute ("y2", "0%"), height); + gradient.x2 = dx + getCoordLength (fillXml->getStringAttribute ("x2", "100%"), gradientWidth); + gradient.y2 = dy + getCoordLength (fillXml->getStringAttribute ("y2", "0%"), gradientHeight); if (gradient.x1 == gradient.x2 && gradient.y1 == gradient.y2) return Colour (gradient.getColour (gradient.getNumColours() - 1)); @@ -791,7 +791,7 @@ private: const PathStrokeType getStrokeFor (const XmlElement* const xml) const { - const String width (getStyleAttribute (xml, "stroke-width")); + const String strokeWidth (getStyleAttribute (xml, "stroke-width")); const String cap (getStyleAttribute (xml, "stroke-linecap")); const String join (getStyleAttribute (xml, "stroke-linejoin")); @@ -814,10 +814,10 @@ private: float ox = 0.0f, oy = 0.0f; transform.transformPoint (ox, oy); - float x = getCoordLength (width, viewBoxW), y = 0.0f; + float x = getCoordLength (strokeWidth, viewBoxW), y = 0.0f; transform.transformPoint (x, y); - return PathStrokeType (width.isNotEmpty() ? juce_hypotf (x - ox, y - oy) : 1.0f, + return PathStrokeType (strokeWidth.isNotEmpty() ? juce_hypotf (x - ox, y - oy) : 1.0f, joinStyle, capStyle); } diff --git a/src/gui/graphics/fonts/juce_Font.cpp b/src/gui/graphics/fonts/juce_Font.cpp index 3fa1cc3136..606f98eccd 100644 --- a/src/gui/graphics/fonts/juce_Font.cpp +++ b/src/gui/graphics/fonts/juce_Font.cpp @@ -44,6 +44,8 @@ namespace FontValues } static const float defaultFontHeight = 14.0f; + + static String fallbackFont; } //============================================================================== @@ -166,16 +168,14 @@ void Font::setTypefaceName (const String& faceName) throw() } //============================================================================== -static String fallbackFont; - const String Font::getFallbackFontName() throw() { - return fallbackFont; + return FontValues::fallbackFont; } void Font::setFallbackFontName (const String& name) throw() { - fallbackFont = name; + FontValues::fallbackFont = name; } //============================================================================== diff --git a/src/gui/graphics/geometry/juce_Path.cpp b/src/gui/graphics/geometry/juce_Path.cpp index 339151e8c8..22072a3137 100644 --- a/src/gui/graphics/geometry/juce_Path.cpp +++ b/src/gui/graphics/geometry/juce_Path.cpp @@ -1329,9 +1329,9 @@ void Path::loadPathFromStream (InputStream& source) } } -void Path::loadPathFromData (const void* const data, const int numberOfBytes) +void Path::loadPathFromData (const void* const pathData, const int numberOfBytes) { - MemoryInputStream in (data, numberOfBytes, false); + MemoryInputStream in (pathData, numberOfBytes, false); loadPathFromStream (in); } diff --git a/src/gui/graphics/geometry/juce_Rectangle.h b/src/gui/graphics/geometry/juce_Rectangle.h index 4dce382fe9..50fb25cdc1 100644 --- a/src/gui/graphics/geometry/juce_Rectangle.h +++ b/src/gui/graphics/geometry/juce_Rectangle.h @@ -482,12 +482,12 @@ public: transform.transformPoint (x3, y3); transform.transformPoint (x4, y4); - const float x = jmin (x1, x2, x3, x4); - const float y = jmin (y1, y2, y3, y4); + const float rx = jmin (x1, x2, x3, x4); + const float ry = jmin (y1, y2, y3, y4); - return Rectangle (x, y, - jmax (x1, x2, x3, x4) - x, - jmax (y1, y2, y3, y4) - y); + return Rectangle (rx, ry, + jmax (x1, x2, x3, x4) - rx, + jmax (y1, y2, y3, y4) - ry); } /** Returns the smallest integer-aligned rectangle that completely contains this one. diff --git a/src/gui/graphics/imaging/image_file_formats/jpglib/jccoefct.c b/src/gui/graphics/imaging/image_file_formats/jpglib/jccoefct.c index c713b858aa..554a21e3b1 100644 --- a/src/gui/graphics/imaging/image_file_formats/jpglib/jccoefct.c +++ b/src/gui/graphics/imaging/image_file_formats/jpglib/jccoefct.c @@ -338,7 +338,7 @@ compress_first_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf) */ METHODDEF(boolean) -compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf) +compress_output (j_compress_ptr cinfo, JSAMPIMAGE) { my_coef_ptr coef = (my_coef_ptr) cinfo->coef; JDIMENSION MCU_col_num; /* index of current MCU within row */ diff --git a/src/gui/graphics/imaging/image_file_formats/jpglib/jccolor.c b/src/gui/graphics/imaging/image_file_formats/jpglib/jccolor.c index 2663724540..fa239c1372 100644 --- a/src/gui/graphics/imaging/image_file_formats/jpglib/jccolor.c +++ b/src/gui/graphics/imaging/image_file_formats/jpglib/jccolor.c @@ -338,7 +338,7 @@ null_convert (j_compress_ptr cinfo, */ METHODDEF(void) -null_method (j_compress_ptr cinfo) +null_method (j_compress_ptr) { /* no work needed */ } diff --git a/src/gui/graphics/imaging/image_file_formats/jpglib/jcmarker.c b/src/gui/graphics/imaging/image_file_formats/jpglib/jcmarker.c index f0d81dfc69..be90314b01 100644 --- a/src/gui/graphics/imaging/image_file_formats/jpglib/jcmarker.c +++ b/src/gui/graphics/imaging/image_file_formats/jpglib/jcmarker.c @@ -152,7 +152,7 @@ emit_dht (j_compress_ptr cinfo, int index, boolean is_ac) LOCAL(void) -emit_dac (j_compress_ptr cinfo) +emit_dac (j_compress_ptr) /* Emit a DAC marker */ /* Since the useful info is so small, we want to emit all the tables in */ /* one DAC marker. Therefore this routine does its own scan of the table. */ diff --git a/src/gui/graphics/imaging/image_file_formats/jpglib/jcsample.c b/src/gui/graphics/imaging/image_file_formats/jpglib/jcsample.c index fe29fcab0a..37c658f544 100644 --- a/src/gui/graphics/imaging/image_file_formats/jpglib/jcsample.c +++ b/src/gui/graphics/imaging/image_file_formats/jpglib/jcsample.c @@ -72,7 +72,7 @@ typedef my_downsampler * my_downsample_ptr; */ METHODDEF(void) -start_pass_downsample (j_compress_ptr cinfo) +start_pass_downsample (j_compress_ptr) { /* no work for now */ } diff --git a/src/gui/graphics/imaging/image_file_formats/jpglib/jctrans.c b/src/gui/graphics/imaging/image_file_formats/jpglib/jctrans.c index bfb85119ca..7e209f9558 100644 --- a/src/gui/graphics/imaging/image_file_formats/jpglib/jctrans.c +++ b/src/gui/graphics/imaging/image_file_formats/jpglib/jctrans.c @@ -275,7 +275,7 @@ start_pass_coef2 (j_compress_ptr cinfo, J_BUF_MODE pass_mode) */ METHODDEF(boolean) -compress_output2 (j_compress_ptr cinfo, JSAMPIMAGE input_buf) +compress_output2 (j_compress_ptr cinfo, JSAMPIMAGE) { my_coef_ptr2 coef = (my_coef_ptr2) cinfo->coef; JDIMENSION MCU_col_num; /* index of current MCU within row */ diff --git a/src/gui/graphics/imaging/image_file_formats/jpglib/jdatasrc.c b/src/gui/graphics/imaging/image_file_formats/jpglib/jdatasrc.c index 29b6983286..bd4770e0ab 100644 --- a/src/gui/graphics/imaging/image_file_formats/jpglib/jdatasrc.c +++ b/src/gui/graphics/imaging/image_file_formats/jpglib/jdatasrc.c @@ -166,7 +166,7 @@ skip_input_data (j_decompress_ptr cinfo, long num_bytes) */ METHODDEF(void) -term_source (j_decompress_ptr cinfo) +term_source (j_decompress_ptr) { /* no work necessary here */ } diff --git a/src/gui/graphics/imaging/image_file_formats/jpglib/jdcoefct.c b/src/gui/graphics/imaging/image_file_formats/jpglib/jdcoefct.c index 660aa039c9..4f15e631c7 100644 --- a/src/gui/graphics/imaging/image_file_formats/jpglib/jdcoefct.c +++ b/src/gui/graphics/imaging/image_file_formats/jpglib/jdcoefct.c @@ -225,7 +225,7 @@ decompress_onepass (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) */ METHODDEF(int) -dummy_consume_data (j_decompress_ptr cinfo) +dummy_consume_data (j_decompress_ptr) { return JPEG_SUSPENDED; /* Always indicate nothing was done */ } diff --git a/src/gui/graphics/imaging/image_file_formats/jpglib/jdcolor.c b/src/gui/graphics/imaging/image_file_formats/jpglib/jdcolor.c index b76b51a629..a4ca256881 100644 --- a/src/gui/graphics/imaging/image_file_formats/jpglib/jdcolor.c +++ b/src/gui/graphics/imaging/image_file_formats/jpglib/jdcolor.c @@ -290,7 +290,7 @@ ycck_cmyk_convert (j_decompress_ptr cinfo, */ METHODDEF(void) -start_pass_dcolor (j_decompress_ptr cinfo) +start_pass_dcolor (j_decompress_ptr) { /* no work needed */ } diff --git a/src/gui/graphics/imaging/image_file_formats/jpglib/jdmerge.c b/src/gui/graphics/imaging/image_file_formats/jpglib/jdmerge.c index ed0f80a419..faee6ce5c4 100644 --- a/src/gui/graphics/imaging/image_file_formats/jpglib/jdmerge.c +++ b/src/gui/graphics/imaging/image_file_formats/jpglib/jdmerge.c @@ -143,7 +143,7 @@ start_pass_merged_upsample (j_decompress_ptr cinfo) METHODDEF(void) merged_2v_upsample (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, - JDIMENSION in_row_groups_avail, + JDIMENSION, JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail) /* 2:1 vertical sampling case: may need a spare row. */ @@ -192,9 +192,9 @@ merged_2v_upsample (j_decompress_ptr cinfo, METHODDEF(void) merged_1v_upsample (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, - JDIMENSION in_row_groups_avail, + JDIMENSION, JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail) + JDIMENSION) /* 1:1 vertical sampling case: much easier, never need a spare row. */ { my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; diff --git a/src/gui/graphics/imaging/image_file_formats/jpglib/jdpostct.c b/src/gui/graphics/imaging/image_file_formats/jpglib/jdpostct.c index 7ba9eed52e..2d93839edc 100644 --- a/src/gui/graphics/imaging/image_file_formats/jpglib/jdpostct.c +++ b/src/gui/graphics/imaging/image_file_formats/jpglib/jdpostct.c @@ -158,8 +158,8 @@ METHODDEF(void) post_process_prepass (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, JDIMENSION in_row_groups_avail, - JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail) + JSAMPARRAY, JDIMENSION *out_row_ctr, + JDIMENSION) { my_post_ptr post = (my_post_ptr) cinfo->post; JDIMENSION old_next_row, num_rows; @@ -200,8 +200,8 @@ post_process_prepass (j_decompress_ptr cinfo, METHODDEF(void) post_process_2pass (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, - JDIMENSION in_row_groups_avail, + JSAMPIMAGE, JDIMENSION *, + JDIMENSION, JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail) { diff --git a/src/gui/graphics/imaging/image_file_formats/jpglib/jdsample.c b/src/gui/graphics/imaging/image_file_formats/jpglib/jdsample.c index 938e63825d..c0a142a74c 100644 --- a/src/gui/graphics/imaging/image_file_formats/jpglib/jdsample.c +++ b/src/gui/graphics/imaging/image_file_formats/jpglib/jdsample.c @@ -88,7 +88,7 @@ start_pass_upsample (j_decompress_ptr cinfo) METHODDEF(void) sep_upsample (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, - JDIMENSION in_row_groups_avail, + JDIMENSION, JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail) { @@ -154,7 +154,7 @@ sep_upsample (j_decompress_ptr cinfo, */ METHODDEF(void) -fullsize_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, +fullsize_upsample (j_decompress_ptr, jpeg_component_info *, JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) { *output_data_ptr = input_data; @@ -167,8 +167,8 @@ fullsize_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, */ METHODDEF(void) -noop_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +noop_upsample (j_decompress_ptr, jpeg_component_info *, + JSAMPARRAY, JSAMPARRAY * output_data_ptr) { *output_data_ptr = NULL; /* safety check */ } @@ -230,7 +230,7 @@ int_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, */ METHODDEF(void) -h2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, +h2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info *, JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) { JSAMPARRAY output_data = *output_data_ptr; @@ -258,7 +258,7 @@ h2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, */ METHODDEF(void) -h2v2_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, +h2v2_upsample (j_decompress_ptr cinfo, jpeg_component_info *, JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) { JSAMPARRAY output_data = *output_data_ptr; diff --git a/src/gui/graphics/imaging/image_file_formats/jpglib/jmemnobs.c b/src/gui/graphics/imaging/image_file_formats/jpglib/jmemnobs.c index 1a4a5b4543..e74edbcbf6 100644 --- a/src/gui/graphics/imaging/image_file_formats/jpglib/jmemnobs.c +++ b/src/gui/graphics/imaging/image_file_formats/jpglib/jmemnobs.c @@ -32,13 +32,13 @@ extern void free JPP((void *ptr)); */ GLOBAL(void *) -jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject) +jpeg_get_small (j_common_ptr , size_t sizeofobject) { return (void *) malloc(sizeofobject); } GLOBAL(void) -jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject) +jpeg_free_small (j_common_ptr , void * object, size_t) { free(object); } @@ -52,13 +52,13 @@ jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject) */ GLOBAL(void FAR *) -jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject) +jpeg_get_large (j_common_ptr, size_t sizeofobject) { return (void FAR *) malloc(sizeofobject); } GLOBAL(void) -jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject) +jpeg_free_large (j_common_ptr, void FAR * object, size_t) { free(object); } @@ -70,8 +70,8 @@ jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject) */ GLOBAL(long) -jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed, - long max_bytes_needed, long already_allocated) +jpeg_mem_available (j_common_ptr, long, + long max_bytes_needed, long) { return max_bytes_needed; } @@ -84,8 +84,8 @@ jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed, */ GLOBAL(void) -jpeg_open_backing_store (j_common_ptr cinfo, struct backing_store_struct *info, - long total_bytes_needed) +jpeg_open_backing_store (j_common_ptr cinfo, struct backing_store_struct *, + long ) { ERREXIT(cinfo, JERR_NO_BACKING_STORE); } @@ -97,13 +97,13 @@ jpeg_open_backing_store (j_common_ptr cinfo, struct backing_store_struct *info, */ GLOBAL(long) -jpeg_mem_init (j_common_ptr cinfo) +jpeg_mem_init (j_common_ptr) { return 0; /* just set max_memory_to_use to 0 */ } GLOBAL(void) -jpeg_mem_term (j_common_ptr cinfo) +jpeg_mem_term (j_common_ptr) { /* no work */ } diff --git a/src/gui/graphics/imaging/image_file_formats/jpglib/jquant1.c b/src/gui/graphics/imaging/image_file_formats/jpglib/jquant1.c index a64baacbcc..7153f467b5 100644 --- a/src/gui/graphics/imaging/image_file_formats/jpglib/jquant1.c +++ b/src/gui/graphics/imaging/image_file_formats/jpglib/jquant1.c @@ -242,7 +242,7 @@ select_ncolors (j_decompress_ptr cinfo, int Ncolors[]) LOCAL(int) -output_value (j_decompress_ptr cinfo, int ci, int j, int maxj) +output_value (j_decompress_ptr, int, int j, int maxj) /* Return j'th output value, where j will range from 0 to maxj */ /* The output values must fall in 0..MAXJSAMPLE in increasing order */ { @@ -256,7 +256,7 @@ output_value (j_decompress_ptr cinfo, int ci, int j, int maxj) LOCAL(int) -largest_input_value (j_decompress_ptr cinfo, int ci, int j, int maxj) +largest_input_value (j_decompress_ptr, int, int j, int maxj) /* Return largest input value that should map to j'th output value */ /* Must have largest(j=0) >= 0, and largest(j=maxj) >= MAXJSAMPLE */ { @@ -738,7 +738,7 @@ alloc_fs_workspace (j_decompress_ptr cinfo) */ METHODDEF(void) -start_pass_1_quant (j_decompress_ptr cinfo, boolean is_pre_scan) +start_pass_1_quant (j_decompress_ptr cinfo, boolean) { my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; size_t arraysize; @@ -795,7 +795,7 @@ start_pass_1_quant (j_decompress_ptr cinfo, boolean is_pre_scan) */ METHODDEF(void) -finish_pass_1_quant (j_decompress_ptr cinfo) +finish_pass_1_quant (j_decompress_ptr) { /* no work in 1-pass case */ } diff --git a/src/gui/graphics/imaging/image_file_formats/jpglib/jquant2.c b/src/gui/graphics/imaging/image_file_formats/jpglib/jquant2.c index 0d81bb9b33..6c2524e1dc 100644 --- a/src/gui/graphics/imaging/image_file_formats/jpglib/jquant2.c +++ b/src/gui/graphics/imaging/image_file_formats/jpglib/jquant2.c @@ -222,7 +222,7 @@ typedef my_cquantizer2 * my_cquantize_ptr2; METHODDEF(void) prescan_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf, - JSAMPARRAY output_buf, int num_rows) + JSAMPARRAY, int num_rows) { my_cquantize_ptr2 cquantize = (my_cquantize_ptr2) cinfo->cquantize; register JSAMPROW ptr; @@ -1153,7 +1153,7 @@ finish_pass1 (j_decompress_ptr cinfo) METHODDEF(void) -finish_pass2 (j_decompress_ptr cinfo) +finish_pass2 (j_decompress_ptr) { /* no work */ } diff --git a/src/gui/graphics/imaging/image_file_formats/jpglib/transupp.c b/src/gui/graphics/imaging/image_file_formats/jpglib/transupp.c index 53a99400d5..35e293e302 100644 --- a/src/gui/graphics/imaging/image_file_formats/jpglib/transupp.c +++ b/src/gui/graphics/imaging/image_file_formats/jpglib/transupp.c @@ -729,7 +729,7 @@ trim_bottom_edge (j_compress_ptr dstinfo) */ GLOBAL(jvirt_barray_ptr *) -jtransform_adjust_parameters (j_decompress_ptr srcinfo, +jtransform_adjust_parameters (j_decompress_ptr, j_compress_ptr dstinfo, jvirt_barray_ptr *src_coef_arrays, jpeg_transform_info *info) @@ -884,7 +884,7 @@ jcopy_markers_setup (j_decompress_ptr srcinfo, JCOPY_OPTION option) GLOBAL(void) jcopy_markers_execute (j_decompress_ptr srcinfo, j_compress_ptr dstinfo, - JCOPY_OPTION option) + JCOPY_OPTION) { jpeg_saved_marker_ptr marker; diff --git a/src/gui/graphics/imaging/image_file_formats/pnglib/pngerror.c b/src/gui/graphics/imaging/image_file_formats/pnglib/pngerror.c index 1d96762d57..70336bd85b 100644 --- a/src/gui/graphics/imaging/image_file_formats/pnglib/pngerror.c +++ b/src/gui/graphics/imaging/image_file_formats/pnglib/pngerror.c @@ -208,7 +208,7 @@ png_chunk_warning(png_structp png_ptr, png_const_charp warning_message) * error function pointer in png_set_error_fn(). */ static void /* PRIVATE */ -png_default_error(png_structp png_ptr, png_const_charp error_message) +png_default_error(png_structp, png_const_charp error_message) { #ifndef PNG_NO_CONSOLE_IO #ifdef PNG_ERROR_NUMBERS_SUPPORTED diff --git a/src/gui/graphics/imaging/image_file_formats/pnglib/pngrutil.c b/src/gui/graphics/imaging/image_file_formats/pnglib/pngrutil.c index e966a27c56..f6973659ae 100644 --- a/src/gui/graphics/imaging/image_file_formats/pnglib/pngrutil.c +++ b/src/gui/graphics/imaging/image_file_formats/pnglib/pngrutil.c @@ -2723,7 +2723,7 @@ png_do_read_interlace(png_structp png_ptr) #endif /* PNG_READ_INTERLACING_SUPPORTED */ void /* PRIVATE */ -png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep row, +png_read_filter_row(png_structp, png_row_infop row_info, png_bytep row, png_bytep prev_row, int filter) { png_debug(1, "in png_read_filter_row\n"); diff --git a/src/gui/graphics/imaging/image_file_formats/pnglib/pngset.c b/src/gui/graphics/imaging/image_file_formats/pnglib/pngset.c index 2437d8bca7..2480a16180 100644 --- a/src/gui/graphics/imaging/image_file_formats/pnglib/pngset.c +++ b/src/gui/graphics/imaging/image_file_formats/pnglib/pngset.c @@ -1204,7 +1204,7 @@ png_set_invalid(png_structp png_ptr, png_infop info_ptr, int mask) #ifdef PNG_ASSEMBLER_CODE_SUPPORTED /* function was added to libpng 1.2.0 and should always exist by default */ void PNGAPI -png_set_asm_flags (png_structp png_ptr, png_uint_32 asm_flags) +png_set_asm_flags (png_structp png_ptr, png_uint_32) { /* Obsolete as of libpng-1.2.20 and will be removed from libpng-1.4.0 */ if (png_ptr != NULL) @@ -1214,8 +1214,8 @@ png_set_asm_flags (png_structp png_ptr, png_uint_32 asm_flags) /* this function was added to libpng 1.2.0 */ void PNGAPI png_set_mmx_thresholds (png_structp png_ptr, - png_byte mmx_bitdepth_threshold, - png_uint_32 mmx_rowbytes_threshold) + png_byte, + png_uint_32) { /* Obsolete as of libpng-1.2.20 and will be removed from libpng-1.4.0 */ if (png_ptr == NULL) diff --git a/src/native/common/juce_posix_SharedCode.h b/src/native/common/juce_posix_SharedCode.h index 9427c60b7d..f6a678afa3 100644 --- a/src/native/common/juce_posix_SharedCode.h +++ b/src/native/common/juce_posix_SharedCode.h @@ -292,7 +292,7 @@ void File::getFileTimesInternal (int64& modificationTime, int64& accessTime, int } } -bool File::setFileTimesInternal (int64 modificationTime, int64 accessTime, int64 creationTime) const +bool File::setFileTimesInternal (int64 modificationTime, int64 accessTime, int64 /*creationTime*/) const { struct utimbuf times; times.actime = (time_t) (accessTime / 1000); diff --git a/src/native/mac/juce_mac_CarbonViewWrapperComponent.h b/src/native/mac/juce_mac_CarbonViewWrapperComponent.h index 779e85569b..2564024e76 100644 --- a/src/native/mac/juce_mac_CarbonViewWrapperComponent.h +++ b/src/native/mac/juce_mac_CarbonViewWrapperComponent.h @@ -54,7 +54,7 @@ public: virtual HIViewRef attachView (WindowRef windowRef, HIViewRef rootView) = 0; virtual void removeView (HIViewRef embeddedView) = 0; - virtual void mouseDown (int x, int y) {} + virtual void mouseDown (int, int) {} virtual void paint() {} virtual bool getEmbeddedViewSize (int& w, int& h) @@ -224,7 +224,7 @@ public: recursiveHIViewRepaint (HIViewGetRoot (wrapperWindow)); } - OSStatus carbonEventHandler (EventHandlerCallRef nextHandlerRef, + OSStatus carbonEventHandler (EventHandlerCallRef /*nextHandlerRef*/, EventRef event) { switch (GetEventKind (event)) diff --git a/src/native/mac/juce_mac_CoreAudio.cpp b/src/native/mac/juce_mac_CoreAudio.cpp index 9daeeb8f84..6073d04fd3 100644 --- a/src/native/mac/juce_mac_CoreAudio.cpp +++ b/src/native/mac/juce_mac_CoreAudio.cpp @@ -338,7 +338,7 @@ public: { StringArray s; HeapBlock types; - const int num = getAllDataSourcesForDevice (deviceID, input, types); + const int num = getAllDataSourcesForDevice (deviceID, types); for (int i = 0; i < num; ++i) { @@ -383,7 +383,7 @@ public: if (OK (AudioObjectGetPropertyData (deviceID, &pa, 0, 0, &size, ¤tSourceID))) { HeapBlock types; - const int num = getAllDataSourcesForDevice (deviceID, input, types); + const int num = getAllDataSourcesForDevice (deviceID, types); for (int i = 0; i < num; ++i) { @@ -404,7 +404,7 @@ public: if (deviceID != 0) { HeapBlock types; - const int num = getAllDataSourcesForDevice (deviceID, input, types); + const int num = getAllDataSourcesForDevice (deviceID, types); if (((unsigned int) index) < (unsigned int) num) { @@ -798,12 +798,12 @@ private: CoreAudioInternal& operator= (const CoreAudioInternal&); //============================================================================== - static OSStatus audioIOProc (AudioDeviceID inDevice, - const AudioTimeStamp* inNow, + static OSStatus audioIOProc (AudioDeviceID /*inDevice*/, + const AudioTimeStamp* /*inNow*/, const AudioBufferList* inInputData, - const AudioTimeStamp* inInputTime, + const AudioTimeStamp* /*inInputTime*/, AudioBufferList* outOutputData, - const AudioTimeStamp* inOutputTime, + const AudioTimeStamp* /*inOutputTime*/, void* device) { static_cast (device)->audioCallback (inInputData, outOutputData); @@ -837,7 +837,7 @@ private: } //============================================================================== - static int getAllDataSourcesForDevice (AudioDeviceID deviceID, const bool input, HeapBlock & types) + static int getAllDataSourcesForDevice (AudioDeviceID deviceID, HeapBlock & types) { AudioObjectPropertyAddress pa; pa.mSelector = kAudioDevicePropertyDataSources; diff --git a/src/native/mac/juce_mac_CoreGraphicsContext.mm b/src/native/mac/juce_mac_CoreGraphicsContext.mm index 8c5ab8cf8e..bc74021ba9 100644 --- a/src/native/mac/juce_mac_CoreGraphicsContext.mm +++ b/src/native/mac/juce_mac_CoreGraphicsContext.mm @@ -225,7 +225,7 @@ public: AffineTransform t (AffineTransform::scale (1.0f, -1.0f).translated (0, sourceImage.getHeight()).followedBy (transform)); applyTransform (t); - CGRect r = CGRectMake (0, 0, sourceImage.getWidth(), sourceImage.getHeight()); + CGRect r = CGRectMake (srcClip.getX(), srcClip.getY(), srcClip.getWidth(), srcClip.getHeight()); CGContextClipToMask (context, r, image); applyTransform (t.inverted()); diff --git a/src/native/mac/juce_mac_CoreMidi.cpp b/src/native/mac/juce_mac_CoreMidi.cpp index 257f807a68..d924ab6f69 100644 --- a/src/native/mac/juce_mac_CoreMidi.cpp +++ b/src/native/mac/juce_mac_CoreMidi.cpp @@ -315,12 +315,12 @@ void MidiOutput::reset() { } -bool MidiOutput::getVolume (float& leftVol, float& rightVol) +bool MidiOutput::getVolume (float& /*leftVol*/, float& /*rightVol*/) { return false; } -void MidiOutput::setVolume (float leftVol, float rightVol) +void MidiOutput::setVolume (float /*leftVol*/, float /*rightVol*/) { } @@ -476,7 +476,7 @@ namespace CoreMidiCallbacks static void midiInputProc (const MIDIPacketList* pktlist, void* readProcRefCon, - void* srcConnRefCon) + void* /*srcConnRefCon*/) { double time = Time::getMillisecondCounterHiRes() * 0.001; const double originalTime = time; @@ -658,12 +658,12 @@ void MidiOutput::reset() { } -bool MidiOutput::getVolume (float& leftVol, float& rightVol) +bool MidiOutput::getVolume (float& /*leftVol*/, float& /*rightVol*/) { return false; } -void MidiOutput::setVolume (float leftVol, float rightVol) +void MidiOutput::setVolume (float /*leftVol*/, float /*rightVol*/) { } diff --git a/src/native/mac/juce_mac_FileChooser.mm b/src/native/mac/juce_mac_FileChooser.mm index 31b215faf8..f4d9df8e06 100644 --- a/src/native/mac/juce_mac_FileChooser.mm +++ b/src/native/mac/juce_mac_FileChooser.mm @@ -66,6 +66,7 @@ using namespace JUCE_NAMESPACE; - (BOOL) panel: (id) sender shouldShowFilename: (NSString*) filename { + (void) sender; const File f (nsStringToJuce (filename)); for (int i = filters->size(); --i >= 0;) diff --git a/src/native/mac/juce_mac_MainMenu.mm b/src/native/mac/juce_mac_MainMenu.mm index cb6b5d2eeb..8e1c905dcf 100644 --- a/src/native/mac/juce_mac_MainMenu.mm +++ b/src/native/mac/juce_mac_MainMenu.mm @@ -412,6 +412,8 @@ END_JUCE_NAMESPACE - (void) menuNeedsUpdate: (NSMenu*) menu; { + (void) menu; + if (JuceMainMenuHandler::instance != 0) JuceMainMenuHandler::instance->updateMenus(); } diff --git a/src/native/mac/juce_mac_MessageManager.mm b/src/native/mac/juce_mac_MessageManager.mm index c8d15b85f2..40993500ac 100644 --- a/src/native/mac/juce_mac_MessageManager.mm +++ b/src/native/mac/juce_mac_MessageManager.mm @@ -236,31 +236,37 @@ using namespace JUCE_NAMESPACE; - (NSApplicationTerminateReply) applicationShouldTerminate: (NSApplication*) app { + (void) app; return redirector->shouldTerminate(); } - (BOOL) application: (NSApplication*) app openFile: (NSString*) filename { + (void) app; return redirector->openFile (filename); } - (void) application: (NSApplication*) sender openFiles: (NSArray*) filenames { + (void) sender; return redirector->openFiles (filenames); } -- (void) applicationDidBecomeActive: (NSNotification*) aNotification +- (void) applicationDidBecomeActive: (NSNotification*) notification { + (void) notification; redirector->focusChanged(); } -- (void) applicationDidResignActive: (NSNotification*) aNotification +- (void) applicationDidResignActive: (NSNotification*) notification { + (void) notification; redirector->focusChanged(); } -- (void) applicationWillUnhide: (NSNotification*) aNotification +- (void) applicationWillUnhide: (NSNotification*) notification { + (void) notification; redirector->focusChanged(); } diff --git a/src/native/mac/juce_mac_MiscUtilities.mm b/src/native/mac/juce_mac_MiscUtilities.mm index 524629c438..50a98e7918 100644 --- a/src/native/mac/juce_mac_MiscUtilities.mm +++ b/src/native/mac/juce_mac_MiscUtilities.mm @@ -85,7 +85,7 @@ bool AlertWindow::showNativeDialogBox (const String& title, } //============================================================================== -bool DragAndDropContainer::performExternalDragDropOfFiles (const StringArray& files, const bool canMoveFiles) +bool DragAndDropContainer::performExternalDragDropOfFiles (const StringArray& files, const bool /*canMoveFiles*/) { if (files.size() == 0) return false; @@ -140,7 +140,7 @@ bool DragAndDropContainer::performExternalDragDropOfFiles (const StringArray& fi return true; } -bool DragAndDropContainer::performExternalDragDropOfText (const String& text) +bool DragAndDropContainer::performExternalDragDropOfText (const String& /*text*/) { jassertfalse // not implemented! return false; diff --git a/src/native/mac/juce_mac_MouseCursor.mm b/src/native/mac/juce_mac_MouseCursor.mm index a8100ea15e..7fe70539df 100644 --- a/src/native/mac/juce_mac_MouseCursor.mm +++ b/src/native/mac/juce_mac_MouseCursor.mm @@ -106,7 +106,7 @@ void* MouseCursor::createStandardMouseCursor (MouseCursor::StandardCursorType ty return c; } -void MouseCursor::deleteMouseCursor (void* const cursorHandle, const bool isStandard) +void MouseCursor::deleteMouseCursor (void* const cursorHandle, const bool /*isStandard*/) { [((NSCursor*) cursorHandle) release]; } diff --git a/src/native/mac/juce_mac_NSViewComponent.mm b/src/native/mac/juce_mac_NSViewComponent.mm index d432da9c16..61e43f64ba 100644 --- a/src/native/mac/juce_mac_NSViewComponent.mm +++ b/src/native/mac/juce_mac_NSViewComponent.mm @@ -145,7 +145,7 @@ void* NSViewComponent::getView() const return info == 0 ? 0 : info->view; } -void NSViewComponent::paint (Graphics& g) +void NSViewComponent::paint (Graphics&) { } diff --git a/src/native/mac/juce_mac_NSViewComponentPeer.mm b/src/native/mac/juce_mac_NSViewComponentPeer.mm index 0930d8c27c..f2ead064e5 100644 --- a/src/native/mac/juce_mac_NSViewComponentPeer.mm +++ b/src/native/mac/juce_mac_NSViewComponentPeer.mm @@ -421,11 +421,13 @@ END_JUCE_NAMESPACE - (BOOL) acceptsFirstMouse: (NSEvent*) ev { + (void) ev; return YES; } - (void) frameChanged: (NSNotification*) n { + (void) n; if (owner != 0) owner->redirectMovedOrResized(); } @@ -483,10 +485,13 @@ END_JUCE_NAMESPACE - (void) doCommandBySelector: (SEL) aSelector { + (void) aSelector; } - (void) setMarkedText: (id) aString selectedRange: (NSRange) selectionRange { + (void) selectionRange; + if (stringBeingComposed == 0) stringBeingComposed = new String(); @@ -567,6 +572,7 @@ END_JUCE_NAMESPACE - (NSRect) firstRectForCharacterRange: (NSRange) theRange { + (void) theRange; JUCE_NAMESPACE::Component* const comp = dynamic_cast (owner->findCurrentTextInputTarget()); if (comp == 0) @@ -582,6 +588,7 @@ END_JUCE_NAMESPACE - (unsigned int) characterIndexForPoint: (NSPoint) thePoint { + (void) thePoint; return NSNotFound; } @@ -667,6 +674,7 @@ END_JUCE_NAMESPACE - (BOOL) prepareForDragOperation: (id ) sender { + (void) sender; return YES; } @@ -677,6 +685,7 @@ END_JUCE_NAMESPACE - (void) concludeDragOperation: (id ) sender { + (void) sender; } @end @@ -705,11 +714,13 @@ END_JUCE_NAMESPACE - (BOOL) windowShouldClose: (id) window { + (void) window; return owner == 0 || owner->windowShouldClose(); } - (NSRect) constrainFrameRect: (NSRect) frameRect toScreen: (NSScreen*) screen { + (void) screen; if (owner != 0) frameRect = owner->constrainRect (frameRect); @@ -718,6 +729,7 @@ END_JUCE_NAMESPACE - (NSSize) windowWillResize: (NSWindow*) window toSize: (NSSize) proposedFrameSize { + (void) window; if (isZooming) return proposedFrameSize; @@ -740,6 +752,8 @@ END_JUCE_NAMESPACE - (void) windowWillMove: (NSNotification*) notification { + (void) notification; + if (JUCE_NAMESPACE::Component::getCurrentlyModalComponent() != 0 && owner->getComponent()->isCurrentlyBlockedByAnotherModalComponent() && (owner->getStyleFlags() & JUCE_NAMESPACE::ComponentPeer::windowHasTitleBar) != 0) diff --git a/src/native/mac/juce_mac_Network.mm b/src/native/mac/juce_mac_Network.mm index 018486d209..a7d017075a 100644 --- a/src/native/mac/juce_mac_Network.mm +++ b/src/native/mac/juce_mac_Network.mm @@ -236,8 +236,9 @@ public: runLoopThread->signalThreadShouldExit(); } -- (void) connection: (NSURLConnection*) connection didReceiveResponse: (NSURLResponse*) response +- (void) connection: (NSURLConnection*) conn didReceiveResponse: (NSURLResponse*) response { + (void) conn; [dataLock lock]; [data setLength: 0]; [dataLock unlock]; @@ -245,8 +246,9 @@ public: contentLength = [response expectedContentLength]; } -- (void) connection: (NSURLConnection*) connection didFailWithError: (NSError*) error +- (void) connection: (NSURLConnection*) conn didFailWithError: (NSError*) error { + (void) conn; DBG (nsStringToJuce ([error description])); hasFailed = true; initialised = true; @@ -255,16 +257,18 @@ public: runLoopThread->signalThreadShouldExit(); } -- (void) connection: (NSURLConnection*) connection didReceiveData: (NSData*) newData +- (void) connection: (NSURLConnection*) conn didReceiveData: (NSData*) newData { + (void) conn; [dataLock lock]; [data appendData: newData]; [dataLock unlock]; initialised = true; } -- (void) connectionDidFinishLoading: (NSURLConnection*) connection +- (void) connectionDidFinishLoading: (NSURLConnection*) conn { + (void) conn; hasFinished = true; initialised = true; @@ -412,7 +416,7 @@ int64 juce_getInternetFileContentLength (void* handle) return -1; } -int juce_seekInInternetFile (void* handle, int newPosition) +int juce_seekInInternetFile (void* handle, int /*newPosition*/) { JuceURLConnection* const s = (JuceURLConnection*) handle; diff --git a/src/native/mac/juce_mac_Threads.mm b/src/native/mac/juce_mac_Threads.mm index 9910d17761..81e27d892c 100644 --- a/src/native/mac/juce_mac_Threads.mm +++ b/src/native/mac/juce_mac_Threads.mm @@ -88,7 +88,7 @@ void Thread::yield() sched_yield(); } -void Thread::setCurrentThreadAffinityMask (const uint32 affinityMask) +void Thread::setCurrentThreadAffinityMask (const uint32 /*affinityMask*/) { // xxx jassertfalse @@ -119,7 +119,7 @@ void Process::terminate() exit (0); } -void Process::setPriority (ProcessPriority p) +void Process::setPriority (ProcessPriority) { // xxx } diff --git a/src/native/mac/juce_mac_WebBrowserComponent.mm b/src/native/mac/juce_mac_WebBrowserComponent.mm index 3f372ccab8..0993953b44 100644 --- a/src/native/mac/juce_mac_WebBrowserComponent.mm +++ b/src/native/mac/juce_mac_WebBrowserComponent.mm @@ -63,6 +63,10 @@ END_JUCE_NAMESPACE frame: (WebFrame*) frame decisionListener: (id ) listener { + (void) sender; + (void) request; + (void) frame; + NSURL* url = [actionInformation valueForKey: @"WebActionOriginalURLKey"]; if (ownerComponent->pageAboutToLoad (nsStringToJuce ([url absoluteString]))) @@ -214,7 +218,7 @@ void WebBrowserComponent::refresh() } //============================================================================== -void WebBrowserComponent::paint (Graphics& g) +void WebBrowserComponent::paint (Graphics&) { } @@ -263,7 +267,7 @@ void WebBrowserComponent::visibilityChanged() checkWindowAssociation(); } -bool WebBrowserComponent::pageAboutToLoad (const String& url) +bool WebBrowserComponent::pageAboutToLoad (const String&) { return true; } diff --git a/src/text/juce_XmlElement.cpp b/src/text/juce_XmlElement.cpp index 4e07bdc134..56f1db1ccf 100644 --- a/src/text/juce_XmlElement.cpp +++ b/src/text/juce_XmlElement.cpp @@ -824,9 +824,9 @@ void XmlElement::insertChildElement (XmlElement* const newNode, } } -XmlElement* XmlElement::createNewChildElement (const String& tagName) +XmlElement* XmlElement::createNewChildElement (const String& childTagName) { - XmlElement* const newElement = new XmlElement (tagName); + XmlElement* const newElement = new XmlElement (childTagName); addChildElement (newElement); return newElement; } diff --git a/src/utilities/juce_PropertiesFile.cpp b/src/utilities/juce_PropertiesFile.cpp index 6e844c4fd5..ac79e0f57a 100644 --- a/src/utilities/juce_PropertiesFile.cpp +++ b/src/utilities/juce_PropertiesFile.cpp @@ -171,10 +171,10 @@ bool PropertiesFile::needsToBeSaved() const return needsWriting; } -void PropertiesFile::setNeedsToBeSaved (const bool needsToBeSaved) +void PropertiesFile::setNeedsToBeSaved (const bool needsToBeSaved_) { const ScopedLock sl (getLock()); - needsWriting = needsToBeSaved; + needsWriting = needsToBeSaved_; } bool PropertiesFile::save() diff --git a/src/utilities/juce_SelectedItemSet.h b/src/utilities/juce_SelectedItemSet.h index 3884db7587..5226f5bae1 100644 --- a/src/utilities/juce_SelectedItemSet.h +++ b/src/utilities/juce_SelectedItemSet.h @@ -291,14 +291,14 @@ public: For example, if the item is an object, you might want to call it and tell it that it's being selected. */ - virtual void itemSelected (SelectableItemType item) {} + virtual void itemSelected (SelectableItemType item) { (void) item; } /** Can be overridden to do special handling when an item is deselected. For example, if the item is an object, you might want to call it and tell it that it's being deselected. */ - virtual void itemDeselected (SelectableItemType item) {} + virtual void itemDeselected (SelectableItemType item) { (void) item; } /** Used internally, but can be called to force a change message to be sent to the ChangeListeners. */