From 6a4e8f235c48d2a403ec1baf5e8885d3b5d4b0fc Mon Sep 17 00:00:00 2001 From: Julian Storer Date: Sun, 17 Jan 2010 22:44:16 +0000 Subject: [PATCH] Minor fixes and warning removals for VC7. --- juce.h | 4 +- juce_amalgamated.cpp | 147 ++++++++++++------ juce_amalgamated.h | 34 ++-- .../juce_GenericAudioProcessorEditor.cpp | 6 + .../juce_GenericAudioProcessorEditor.h | 3 + src/containers/juce_ValueTree.cpp | 6 +- src/core/juce_StandardHeader.h | 4 + .../code_editor/juce_CodeEditorComponent.cpp | 6 +- src/gui/components/controls/juce_Label.cpp | 4 +- src/gui/components/controls/juce_ListBox.cpp | 2 +- src/gui/components/controls/juce_TreeView.cpp | 16 +- .../juce_KeyMappingEditorComponent.cpp | 2 +- .../mouse/juce_MouseHoverDetector.h | 3 + .../properties/juce_ButtonPropertyComponent.h | 3 + .../juce_SliderPropertyComponent.cpp | 2 +- .../components/windows/juce_TooltipWindow.cpp | 6 +- .../components/windows/juce_TooltipWindow.h | 2 +- ...uce_LowLevelGraphicsPostScriptRenderer.cpp | 8 +- src/gui/graphics/fonts/juce_Typeface.cpp | 2 +- src/io/files/juce_TemporaryFile.cpp | 3 +- .../mac/juce_mac_CoreGraphicsContext.mm | 12 ++ src/native/windows/juce_win32_FileChooser.cpp | 2 +- 22 files changed, 186 insertions(+), 91 deletions(-) diff --git a/juce.h b/juce.h index 6876868daa..9b06d5c915 100644 --- a/juce.h +++ b/juce.h @@ -33,6 +33,8 @@ */ //============================================================================== +#define JUCE_PUBLIC_INCLUDES 1 + // (this includes things that need defining outside of the JUCE namespace) #include "src/core/juce_StandardHeader.h" @@ -49,8 +51,6 @@ BEGIN_JUCE_NAMESPACE #pragma align=natural #endif -#define JUCE_PUBLIC_INCLUDES - // this is where all the class header files get brought in.. #include "src/juce_core_includes.h" diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index 25ccf9527b..933fd484ee 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -7232,8 +7232,7 @@ void TemporaryFile::createTempFile (const File& parentDirectory, String name, if ((optionFlags & useHiddenFile) != 0) name = T(".") + name; - temporaryFile = parentDirectory.getNonexistentChildFile (name, targetFile.getFileExtension(), - (optionFlags & putNumbersInBrackets) != 0); + temporaryFile = parentDirectory.getNonexistentChildFile (name, suffix, (optionFlags & putNumbersInBrackets) != 0); } TemporaryFile::~TemporaryFile() @@ -16160,7 +16159,7 @@ public: int getSizeInUnits() { - return 32; //xxx should be more accurate + return (int) sizeof (*this); //xxx should be more accurate } private: @@ -16211,7 +16210,7 @@ public: int getSizeInUnits() { - return 32; //xxx should be more accurate + return (int) sizeof (*this); //xxx should be more accurate } private: @@ -16260,64 +16259,84 @@ ValueTree::SharedObject::Property::Property (const var::identifier& name_, const { } -void ValueTree::deliverPropertyChangeMessage (const var::identifier& property) +void ValueTree::deliverPropertyChangeMessage (ValueTree& tree, const var::identifier& property) { - ValueTree v (object); - for (int i = listeners.size(); --i >= 0;) { ValueTree::Listener* const l = listeners[i]; if (l != 0) - l->valueTreePropertyChanged (v, property); + l->valueTreePropertyChanged (tree, property); } } -void ValueTree::SharedObject::sendPropertyChangeMessage (const var::identifier& property) +void ValueTree::SharedObject::sendPropertyChangeMessage (ValueTree& tree, const var::identifier& property) { for (int i = valueTreesWithListeners.size(); --i >= 0;) { ValueTree* const v = valueTreesWithListeners[i]; if (v != 0) - v->deliverPropertyChangeMessage (property); + v->deliverPropertyChangeMessage (tree, property); } } -void ValueTree::deliverChildChangeMessage() +void ValueTree::SharedObject::sendPropertyChangeMessage (const var::identifier& property) { - ValueTree v (object); + ValueTree tree (this); + ValueTree::SharedObject* t = this; + + while (t != 0) + { + t->sendPropertyChangeMessage (tree, property); + t = t->parent; + } +} +void ValueTree::deliverChildChangeMessage (ValueTree& tree) +{ for (int i = listeners.size(); --i >= 0;) { ValueTree::Listener* const l = listeners[i]; if (l != 0) - l->valueTreeChildrenChanged (v); + l->valueTreeChildrenChanged (tree); } } -void ValueTree::SharedObject::sendChildChangeMessage() +void ValueTree::SharedObject::sendChildChangeMessage (ValueTree& tree) { for (int i = valueTreesWithListeners.size(); --i >= 0;) { ValueTree* const v = valueTreesWithListeners[i]; if (v != 0) - v->deliverChildChangeMessage(); + v->deliverChildChangeMessage (tree); } } -void ValueTree::deliverParentChangeMessage() +void ValueTree::SharedObject::sendChildChangeMessage() { - ValueTree v (object); + ValueTree tree (this); + ValueTree::SharedObject* t = this; + + while (t != 0) + { + t->sendChildChangeMessage (tree); + t = t->parent; + } +} +void ValueTree::deliverParentChangeMessage (ValueTree& tree) +{ for (int i = listeners.size(); --i >= 0;) { ValueTree::Listener* const l = listeners[i]; if (l != 0) - l->valueTreeParentChanged (v); + l->valueTreeParentChanged (tree); } } void ValueTree::SharedObject::sendParentChangeMessage() { + ValueTree tree (this); + int i; for (i = children.size(); --i >= 0;) { @@ -16330,7 +16349,7 @@ void ValueTree::SharedObject::sendParentChangeMessage() { ValueTree* const v = valueTreesWithListeners[i]; if (v != 0) - v->deliverParentChangeMessage(); + v->deliverParentChangeMessage (tree); } } @@ -16526,7 +16545,7 @@ void ValueTree::SharedObject::removeChild (const int childIndex, UndoManager* co void ValueTree::SharedObject::removeAllChildren (UndoManager* const undoManager) { while (children.size() > 0) - removeChild (children.size() - 1, 0); + removeChild (children.size() - 1, undoManager); } ValueTree::ValueTree (const String& type_) @@ -16672,14 +16691,14 @@ public: tree.setProperty (property, newValue, undoManager); } - void valueTreePropertyChanged (ValueTree& tree, const var::identifier& changedProperty) + void valueTreePropertyChanged (ValueTree& treeWhosePropertyHasChanged, const var::identifier& changedProperty) { - if (property == changedProperty) + if (tree == treeWhosePropertyHasChanged && property == changedProperty) sendChangeMessage (false); } - void valueTreeChildrenChanged (ValueTree& tree) {} - void valueTreeParentChanged (ValueTree& tree) {} + void valueTreeChildrenChanged (ValueTree&) {} + void valueTreeParentChanged (ValueTree&) {} private: ValueTree tree; @@ -36355,7 +36374,13 @@ private: private: AudioProcessor* const owner; const int index; + + ParamSlider (const ParamSlider&); + const ParamSlider& operator= (const ParamSlider&); }; + + ProcessorParameterPropertyComp (const ProcessorParameterPropertyComp&); + const ProcessorParameterPropertyComp& operator= (const ProcessorParameterPropertyComp&); }; GenericAudioProcessorEditor::GenericAudioProcessorEditor (AudioProcessor* const owner_) @@ -44856,7 +44881,7 @@ public: else if (lineNum < document.getNumLines()) { const CodeDocument::Position pos (&document, lineNum, 0); - createTokens (document, pos.getPosition(), pos.getLineText(), + createTokens (pos.getPosition(), pos.getLineText(), source, analyser, newTokens); } @@ -44961,7 +44986,7 @@ private: OwnedArray tokens; int highlightColumnStart, highlightColumnEnd; - static void createTokens (CodeDocument& document, int startPosition, const String& lineText, + static void createTokens (int startPosition, const String& lineText, CodeDocument::Iterator& source, CodeTokeniser* analyser, OwnedArray & newTokens) @@ -45741,7 +45766,7 @@ void CodeEditorComponent::mouseDrag (const MouseEvent& e) moveCaretTo (getPositionAt (e.x, e.y), true); } -void CodeEditorComponent::mouseUp (const MouseEvent& e) +void CodeEditorComponent::mouseUp (const MouseEvent&) { newTransaction(); beginDragAutoRepeat (0); @@ -47289,11 +47314,11 @@ void Label::showEditor() } } -void Label::editorShown (TextEditor* editorComponent) +void Label::editorShown (TextEditor* /*editorComponent*/) { } -void Label::editorAboutToBeHidden (TextEditor* editorComponent) +void Label::editorAboutToBeHidden (TextEditor* /*editorComponent*/) { } @@ -48488,7 +48513,7 @@ const String ListBoxModel::getDragSourceDescription (const SparseSet&) return String::empty; } -const String ListBoxModel::getTooltipForRow (int row) +const String ListBoxModel::getTooltipForRow (int) { return String::empty; } @@ -56122,7 +56147,7 @@ void TreeView::handleDrop (const StringArray& files, const String& sourceDescrip } } -bool TreeView::isInterestedInFileDrag (const StringArray& files) +bool TreeView::isInterestedInFileDrag (const StringArray&) { return true; } @@ -56137,7 +56162,7 @@ void TreeView::fileDragMove (const StringArray& files, int x, int y) handleDrag (files, String::empty, 0, x, y); } -void TreeView::fileDragExit (const StringArray& files) +void TreeView::fileDragExit (const StringArray&) { hideDragHighlight(); } @@ -56147,7 +56172,7 @@ void TreeView::filesDropped (const StringArray& files, int x, int y) handleDrop (files, String::empty, 0, x, y); } -bool TreeView::isInterestedInDragSource (const String& sourceDescription, Component* sourceComponent) +bool TreeView::isInterestedInDragSource (const String& /*sourceDescription*/, Component* /*sourceComponent*/) { return true; } @@ -56162,7 +56187,7 @@ void TreeView::itemDragMove (const String& sourceDescription, Component* sourceC handleDrag (StringArray(), sourceDescription, sourceComponent, x, y); } -void TreeView::itemDragExit (const String& sourceDescription, Component* sourceComponent) +void TreeView::itemDragExit (const String& /*sourceDescription*/, Component* /*sourceComponent*/) { hideDragHighlight(); } @@ -56401,21 +56426,21 @@ const String TreeViewItem::getDragSourceDescription() return String::empty; } -bool TreeViewItem::isInterestedInFileDrag (const StringArray& files) +bool TreeViewItem::isInterestedInFileDrag (const StringArray&) { return false; } -void TreeViewItem::filesDropped (const StringArray& files, int insertIndex) +void TreeViewItem::filesDropped (const StringArray& /*files*/, int /*insertIndex*/) { } -bool TreeViewItem::isInterestedInDragSource (const String& sourceDescription, Component* sourceComponent) +bool TreeViewItem::isInterestedInDragSource (const String& /*sourceDescription*/, Component* /*sourceComponent*/) { return false; } -void TreeViewItem::itemDropped (const String& sourceDescription, Component* sourceComponent, int insertIndex) +void TreeViewItem::itemDropped (const String& /*sourceDescription*/, Component* /*sourceComponent*/, int /*insertIndex*/) { } @@ -59376,7 +59401,7 @@ public: { } - void paintButton (Graphics& g, bool isOver, bool isDown) + void paintButton (Graphics& g, bool /*isOver*/, bool /*isDown*/) { getLookAndFeel().drawKeymapChangeButton (g, getWidth(), getHeight(), *this, keyNum >= 0 ? getName() : String::empty); @@ -71516,7 +71541,7 @@ SliderPropertyComponent::~SliderPropertyComponent() deleteAllChildren(); } -void SliderPropertyComponent::setValue (const double newValue) +void SliderPropertyComponent::setValue (const double /*newValue*/) { } @@ -78129,7 +78154,7 @@ void TooltipWindow::mouseEnter (const MouseEvent&) hide(); } -void TooltipWindow::showFor (Component* const c, const String& tip) +void TooltipWindow::showFor (const String& tip) { jassert (tip.isNotEmpty()); tipShowing = tip; @@ -78225,7 +78250,7 @@ void TooltipWindow::timerCallback() } else if (tipChanged) { - showFor (newComp, newTip); + showFor (newTip); } } else @@ -78236,7 +78261,7 @@ void TooltipWindow::timerCallback() && newTip != tipShowing && now > lastCompChangeTime + millisecondsBeforeTipAppears) { - showFor (newComp, newTip); + showFor (newTip); } } } @@ -81207,7 +81232,7 @@ void LowLevelGraphicsPostScriptRenderer::clipToPath (const Path& path, const Aff out << "clip\n"; } -void LowLevelGraphicsPostScriptRenderer::clipToImageAlpha (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform) +void LowLevelGraphicsPostScriptRenderer::clipToImageAlpha (const Image& /*sourceImage*/, const Rectangle& /*srcClip*/, const AffineTransform& /*transform*/) { needToClip = true; jassertfalse // xxx @@ -81388,11 +81413,11 @@ void LowLevelGraphicsPostScriptRenderer::setFill (const FillType& fillType) stateStack.getLast()->fillType = fillType; } -void LowLevelGraphicsPostScriptRenderer::setOpacity (float opacity) +void LowLevelGraphicsPostScriptRenderer::setOpacity (float /*opacity*/) { } -void LowLevelGraphicsPostScriptRenderer::setInterpolationQuality (Graphics::ResamplingQuality quality) +void LowLevelGraphicsPostScriptRenderer::setInterpolationQuality (Graphics::ResamplingQuality /*quality*/) { } @@ -81516,7 +81541,7 @@ void LowLevelGraphicsPostScriptRenderer::writeImage (const Image& im, } void LowLevelGraphicsPostScriptRenderer::drawImage (const Image& sourceImage, const Rectangle& srcClip, - const AffineTransform& transform, const bool fillEntireClipAsTiles) + const AffineTransform& transform, const bool /*fillEntireClipAsTiles*/) { const int w = jmin (sourceImage.getWidth(), srcClip.getRight()); const int h = jmin (sourceImage.getHeight(), srcClip.getBottom()); @@ -87265,7 +87290,7 @@ CustomTypefaceGlyphInfo* CustomTypeface::findGlyphSubstituting (const juce_wchar return glyph; } -bool CustomTypeface::loadGlyphIfPossible (const juce_wchar characterNeeded) +bool CustomTypeface::loadGlyphIfPossible (const juce_wchar /*characterNeeded*/) { return false; } @@ -218040,7 +218065,7 @@ void FileChooser::showPlatformDialog (OwnedArray& results, const File& currentFileOrDirectory, const String& filter, bool selectsDirectory, - bool selectsFiles, + bool /*selectsFiles*/, bool isSaveDialogue, bool warnAboutOverwritingExistingFiles, bool selectMultipleFiles, @@ -240428,12 +240453,24 @@ public: void drawVerticalLine (const int x, double top, double bottom) { +#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5 CGContextFillRect (context, CGRectMake (x, flipHeight - (float) bottom, 1.0f, (float) (bottom - top))); +#else + // On Leopard, unless both co-ordinates are non-integer, it disables anti-aliasing, so nudge + // the x co-ord slightly to trick it.. + CGContextFillRect (context, CGRectMake (x + 1.0f / 256.0f, flipHeight - (float) bottom, 1.0f + 1.0f / 256.0f, (float) (bottom - top))); +#endif } void drawHorizontalLine (const int y, double left, double right) { +#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5 CGContextFillRect (context, CGRectMake ((float) left, flipHeight - (y + 1.0f), (float) (right - left), 1.0f)); +#else + // On Leopard, unless both co-ordinates are non-integer, it disables anti-aliasing, so nudge + // the x co-ord slightly to trick it.. + CGContextFillRect (context, CGRectMake ((float) left, flipHeight - (y + (1.0f + 1.0f / 256.0f)), (float) (right - left), 1.0f + 1.0f / 256.0f)); +#endif } void setFont (const Font& newFont) @@ -244840,12 +244877,24 @@ public: void drawVerticalLine (const int x, double top, double bottom) { +#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5 CGContextFillRect (context, CGRectMake (x, flipHeight - (float) bottom, 1.0f, (float) (bottom - top))); +#else + // On Leopard, unless both co-ordinates are non-integer, it disables anti-aliasing, so nudge + // the x co-ord slightly to trick it.. + CGContextFillRect (context, CGRectMake (x + 1.0f / 256.0f, flipHeight - (float) bottom, 1.0f + 1.0f / 256.0f, (float) (bottom - top))); +#endif } void drawHorizontalLine (const int y, double left, double right) { +#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5 CGContextFillRect (context, CGRectMake ((float) left, flipHeight - (y + 1.0f), (float) (right - left), 1.0f)); +#else + // On Leopard, unless both co-ordinates are non-integer, it disables anti-aliasing, so nudge + // the x co-ord slightly to trick it.. + CGContextFillRect (context, CGRectMake ((float) left, flipHeight - (y + (1.0f + 1.0f / 256.0f)), (float) (right - left), 1.0f + 1.0f / 256.0f)); +#endif } void setFont (const Font& newFont) diff --git a/juce_amalgamated.h b/juce_amalgamated.h index 2d82dc925c..60372997ff 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -8,6 +8,8 @@ #ifndef __JUCE_JUCEHEADER__ #define __JUCE_JUCEHEADER__ +#define JUCE_PUBLIC_INCLUDES 1 + // (this includes things that need defining outside of the JUCE namespace) /********* Start of inlined file: juce_StandardHeader.h *********/ @@ -495,6 +497,10 @@ #if JUCE_MSVC #include #pragma warning (pop) + + #if ! JUCE_PUBLIC_INCLUDES + #pragma warning (4: 4511 4512 4100) // (enable some warnings that are turned off in VC8) + #endif #endif // DLL building settings on Win32 @@ -1440,8 +1446,6 @@ BEGIN_JUCE_NAMESPACE #pragma align=natural #endif -#define JUCE_PUBLIC_INCLUDES - // this is where all the class header files get brought in.. /********* Start of inlined file: juce_core_includes.h *********/ @@ -6517,11 +6521,12 @@ public: public: virtual ~Listener() {} - virtual void valueTreePropertyChanged (ValueTree& tree, const var::identifier& property) = 0; + virtual void valueTreePropertyChanged (ValueTree& treeWhosePropertyHasChanged, + const var::identifier& property) = 0; - virtual void valueTreeChildrenChanged (ValueTree& tree) = 0; + virtual void valueTreeChildrenChanged (ValueTree& treeWhoseChildHasChanged) = 0; - virtual void valueTreeParentChanged (ValueTree& tree) = 0; + virtual void valueTreeParentChanged (ValueTree& treeWhoseParentHasChanged) = 0; }; void addListener (Listener* listener); @@ -6556,7 +6561,9 @@ private: SharedObject* parent; void sendPropertyChangeMessage (const var::identifier& property); + void sendPropertyChangeMessage (ValueTree& tree, const var::identifier& property); void sendChildChangeMessage(); + void sendChildChangeMessage (ValueTree& tree); void sendParentChangeMessage(); const var getProperty (const var::identifier& name) const; void setProperty (const var::identifier& name, const var& newValue, UndoManager* const undoManager); @@ -6584,9 +6591,9 @@ private: ReferenceCountedObjectPtr object; SortedSet listeners; - void deliverPropertyChangeMessage (const var::identifier& property); - void deliverChildChangeMessage(); - void deliverParentChangeMessage(); + void deliverPropertyChangeMessage (ValueTree& tree, const var::identifier& property); + void deliverChildChangeMessage (ValueTree& tree); + void deliverParentChangeMessage (ValueTree& tree); ValueTree (SharedObject* const object_); }; @@ -15329,7 +15336,7 @@ private: void timerCallback(); static const String getTipFor (Component* const c); - void showFor (Component* const c, const String& tip); + void showFor (const String& tip); void hide(); TooltipWindow (const TooltipWindow&); @@ -18585,6 +18592,9 @@ public: private: PropertyPanel* panel; + + GenericAudioProcessorEditor (const GenericAudioProcessorEditor&); + const GenericAudioProcessorEditor& operator= (const GenericAudioProcessorEditor&); }; #endif // __JUCE_GENERICAUDIOPROCESSOREDITOR_JUCEHEADER__ @@ -25100,6 +25110,9 @@ private: void hoverTimerCallback(); void checkJustHoveredCallback(); + + MouseHoverDetector (const MouseHoverDetector&); + const MouseHoverDetector& operator= (const MouseHoverDetector&); }; #endif // __JUCE_MOUSEHOVERDETECTOR_JUCEHEADER__ @@ -25185,6 +25198,9 @@ public: private: TextButton* button; + + ButtonPropertyComponent (const ButtonPropertyComponent&); + const ButtonPropertyComponent& operator= (const ButtonPropertyComponent&); }; #endif // __JUCE_BUTTONPROPERTYCOMPONENT_JUCEHEADER__ diff --git a/src/audio/processors/juce_GenericAudioProcessorEditor.cpp b/src/audio/processors/juce_GenericAudioProcessorEditor.cpp index 3bc5230918..db1e715279 100644 --- a/src/audio/processors/juce_GenericAudioProcessorEditor.cpp +++ b/src/audio/processors/juce_GenericAudioProcessorEditor.cpp @@ -119,7 +119,13 @@ private: private: AudioProcessor* const owner; const int index; + + ParamSlider (const ParamSlider&); + const ParamSlider& operator= (const ParamSlider&); }; + + ProcessorParameterPropertyComp (const ProcessorParameterPropertyComp&); + const ProcessorParameterPropertyComp& operator= (const ProcessorParameterPropertyComp&); }; diff --git a/src/audio/processors/juce_GenericAudioProcessorEditor.h b/src/audio/processors/juce_GenericAudioProcessorEditor.h index f45c1e64f1..125d6aac06 100644 --- a/src/audio/processors/juce_GenericAudioProcessorEditor.h +++ b/src/audio/processors/juce_GenericAudioProcessorEditor.h @@ -57,6 +57,9 @@ public: private: PropertyPanel* panel; + + GenericAudioProcessorEditor (const GenericAudioProcessorEditor&); + const GenericAudioProcessorEditor& operator= (const GenericAudioProcessorEditor&); }; diff --git a/src/containers/juce_ValueTree.cpp b/src/containers/juce_ValueTree.cpp index 13ca7d806c..825ac751db 100644 --- a/src/containers/juce_ValueTree.cpp +++ b/src/containers/juce_ValueTree.cpp @@ -461,7 +461,7 @@ void ValueTree::SharedObject::removeChild (const int childIndex, UndoManager* co void ValueTree::SharedObject::removeAllChildren (UndoManager* const undoManager) { while (children.size() > 0) - removeChild (children.size() - 1, 0); + removeChild (children.size() - 1, undoManager); } @@ -616,8 +616,8 @@ public: sendChangeMessage (false); } - void valueTreeChildrenChanged (ValueTree& tree) {} - void valueTreeParentChanged (ValueTree& tree) {} + void valueTreeChildrenChanged (ValueTree&) {} + void valueTreeParentChanged (ValueTree&) {} private: ValueTree tree; diff --git a/src/core/juce_StandardHeader.h b/src/core/juce_StandardHeader.h index cdfee0bf1d..750bde77b9 100644 --- a/src/core/juce_StandardHeader.h +++ b/src/core/juce_StandardHeader.h @@ -97,6 +97,10 @@ #if JUCE_MSVC #include #pragma warning (pop) + + #if ! JUCE_PUBLIC_INCLUDES + #pragma warning (4: 4511 4512 4100) // (enable some warnings that are turned off in VC8) + #endif #endif //============================================================================== diff --git a/src/gui/components/code_editor/juce_CodeEditorComponent.cpp b/src/gui/components/code_editor/juce_CodeEditorComponent.cpp index 371e7a41ae..9f583f31cd 100644 --- a/src/gui/components/code_editor/juce_CodeEditorComponent.cpp +++ b/src/gui/components/code_editor/juce_CodeEditorComponent.cpp @@ -95,7 +95,7 @@ public: else if (lineNum < document.getNumLines()) { const CodeDocument::Position pos (&document, lineNum, 0); - createTokens (document, pos.getPosition(), pos.getLineText(), + createTokens (pos.getPosition(), pos.getLineText(), source, analyser, newTokens); } @@ -200,7 +200,7 @@ private: OwnedArray tokens; int highlightColumnStart, highlightColumnEnd; - static void createTokens (CodeDocument& document, int startPosition, const String& lineText, + static void createTokens (int startPosition, const String& lineText, CodeDocument::Iterator& source, CodeTokeniser* analyser, OwnedArray & newTokens) @@ -994,7 +994,7 @@ void CodeEditorComponent::mouseDrag (const MouseEvent& e) moveCaretTo (getPositionAt (e.x, e.y), true); } -void CodeEditorComponent::mouseUp (const MouseEvent& e) +void CodeEditorComponent::mouseUp (const MouseEvent&) { newTransaction(); beginDragAutoRepeat (0); diff --git a/src/gui/components/controls/juce_Label.cpp b/src/gui/components/controls/juce_Label.cpp index 9edd7264ff..c7974cf726 100644 --- a/src/gui/components/controls/juce_Label.cpp +++ b/src/gui/components/controls/juce_Label.cpp @@ -220,11 +220,11 @@ void Label::showEditor() } } -void Label::editorShown (TextEditor* editorComponent) +void Label::editorShown (TextEditor* /*editorComponent*/) { } -void Label::editorAboutToBeHidden (TextEditor* editorComponent) +void Label::editorAboutToBeHidden (TextEditor* /*editorComponent*/) { } diff --git a/src/gui/components/controls/juce_ListBox.cpp b/src/gui/components/controls/juce_ListBox.cpp index ecb705f30a..ffb9dde90f 100644 --- a/src/gui/components/controls/juce_ListBox.cpp +++ b/src/gui/components/controls/juce_ListBox.cpp @@ -998,7 +998,7 @@ const String ListBoxModel::getDragSourceDescription (const SparseSet&) return String::empty; } -const String ListBoxModel::getTooltipForRow (int row) +const String ListBoxModel::getTooltipForRow (int) { return String::empty; } diff --git a/src/gui/components/controls/juce_TreeView.cpp b/src/gui/components/controls/juce_TreeView.cpp index e02547aea3..cf9e0aa024 100644 --- a/src/gui/components/controls/juce_TreeView.cpp +++ b/src/gui/components/controls/juce_TreeView.cpp @@ -991,7 +991,7 @@ void TreeView::handleDrop (const StringArray& files, const String& sourceDescrip } //============================================================================== -bool TreeView::isInterestedInFileDrag (const StringArray& files) +bool TreeView::isInterestedInFileDrag (const StringArray&) { return true; } @@ -1006,7 +1006,7 @@ void TreeView::fileDragMove (const StringArray& files, int x, int y) handleDrag (files, String::empty, 0, x, y); } -void TreeView::fileDragExit (const StringArray& files) +void TreeView::fileDragExit (const StringArray&) { hideDragHighlight(); } @@ -1016,7 +1016,7 @@ void TreeView::filesDropped (const StringArray& files, int x, int y) handleDrop (files, String::empty, 0, x, y); } -bool TreeView::isInterestedInDragSource (const String& sourceDescription, Component* sourceComponent) +bool TreeView::isInterestedInDragSource (const String& /*sourceDescription*/, Component* /*sourceComponent*/) { return true; } @@ -1031,7 +1031,7 @@ void TreeView::itemDragMove (const String& sourceDescription, Component* sourceC handleDrag (StringArray(), sourceDescription, sourceComponent, x, y); } -void TreeView::itemDragExit (const String& sourceDescription, Component* sourceComponent) +void TreeView::itemDragExit (const String& /*sourceDescription*/, Component* /*sourceComponent*/) { hideDragHighlight(); } @@ -1272,21 +1272,21 @@ const String TreeViewItem::getDragSourceDescription() return String::empty; } -bool TreeViewItem::isInterestedInFileDrag (const StringArray& files) +bool TreeViewItem::isInterestedInFileDrag (const StringArray&) { return false; } -void TreeViewItem::filesDropped (const StringArray& files, int insertIndex) +void TreeViewItem::filesDropped (const StringArray& /*files*/, int /*insertIndex*/) { } -bool TreeViewItem::isInterestedInDragSource (const String& sourceDescription, Component* sourceComponent) +bool TreeViewItem::isInterestedInDragSource (const String& /*sourceDescription*/, Component* /*sourceComponent*/) { return false; } -void TreeViewItem::itemDropped (const String& sourceDescription, Component* sourceComponent, int insertIndex) +void TreeViewItem::itemDropped (const String& /*sourceDescription*/, Component* /*sourceComponent*/, int /*insertIndex*/) { } diff --git a/src/gui/components/keyboard/juce_KeyMappingEditorComponent.cpp b/src/gui/components/keyboard/juce_KeyMappingEditorComponent.cpp index 5245ec69ec..059dfad1aa 100644 --- a/src/gui/components/keyboard/juce_KeyMappingEditorComponent.cpp +++ b/src/gui/components/keyboard/juce_KeyMappingEditorComponent.cpp @@ -66,7 +66,7 @@ public: { } - void paintButton (Graphics& g, bool isOver, bool isDown) + void paintButton (Graphics& g, bool /*isOver*/, bool /*isDown*/) { getLookAndFeel().drawKeymapChangeButton (g, getWidth(), getHeight(), *this, keyNum >= 0 ? getName() : String::empty); diff --git a/src/gui/components/mouse/juce_MouseHoverDetector.h b/src/gui/components/mouse/juce_MouseHoverDetector.h index 34c01ade6e..976c410224 100644 --- a/src/gui/components/mouse/juce_MouseHoverDetector.h +++ b/src/gui/components/mouse/juce_MouseHoverDetector.h @@ -123,6 +123,9 @@ private: void hoverTimerCallback(); void checkJustHoveredCallback(); + + MouseHoverDetector (const MouseHoverDetector&); + const MouseHoverDetector& operator= (const MouseHoverDetector&); }; #endif // __JUCE_MOUSEHOVERDETECTOR_JUCEHEADER__ diff --git a/src/gui/components/properties/juce_ButtonPropertyComponent.h b/src/gui/components/properties/juce_ButtonPropertyComponent.h index 61c4bcda08..eab59293b6 100644 --- a/src/gui/components/properties/juce_ButtonPropertyComponent.h +++ b/src/gui/components/properties/juce_ButtonPropertyComponent.h @@ -76,6 +76,9 @@ public: private: TextButton* button; + + ButtonPropertyComponent (const ButtonPropertyComponent&); + const ButtonPropertyComponent& operator= (const ButtonPropertyComponent&); }; diff --git a/src/gui/components/properties/juce_SliderPropertyComponent.cpp b/src/gui/components/properties/juce_SliderPropertyComponent.cpp index 626a968c30..efd01e9152 100644 --- a/src/gui/components/properties/juce_SliderPropertyComponent.cpp +++ b/src/gui/components/properties/juce_SliderPropertyComponent.cpp @@ -69,7 +69,7 @@ SliderPropertyComponent::~SliderPropertyComponent() deleteAllChildren(); } -void SliderPropertyComponent::setValue (const double newValue) +void SliderPropertyComponent::setValue (const double /*newValue*/) { } diff --git a/src/gui/components/windows/juce_TooltipWindow.cpp b/src/gui/components/windows/juce_TooltipWindow.cpp index 495c012ec5..2d3ecc3cc4 100644 --- a/src/gui/components/windows/juce_TooltipWindow.cpp +++ b/src/gui/components/windows/juce_TooltipWindow.cpp @@ -75,7 +75,7 @@ void TooltipWindow::mouseEnter (const MouseEvent&) hide(); } -void TooltipWindow::showFor (Component* const c, const String& tip) +void TooltipWindow::showFor (const String& tip) { jassert (tip.isNotEmpty()); tipShowing = tip; @@ -171,7 +171,7 @@ void TooltipWindow::timerCallback() } else if (tipChanged) { - showFor (newComp, newTip); + showFor (newTip); } } else @@ -182,7 +182,7 @@ void TooltipWindow::timerCallback() && newTip != tipShowing && now > lastCompChangeTime + millisecondsBeforeTipAppears) { - showFor (newComp, newTip); + showFor (newTip); } } } diff --git a/src/gui/components/windows/juce_TooltipWindow.h b/src/gui/components/windows/juce_TooltipWindow.h index 4b732dd858..64ff63c89b 100644 --- a/src/gui/components/windows/juce_TooltipWindow.h +++ b/src/gui/components/windows/juce_TooltipWindow.h @@ -111,7 +111,7 @@ private: void timerCallback(); static const String getTipFor (Component* const c); - void showFor (Component* const c, const String& tip); + void showFor (const String& tip); void hide(); TooltipWindow (const TooltipWindow&); diff --git a/src/gui/graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp b/src/gui/graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp index 7201b7872c..ecadf708db 100644 --- a/src/gui/graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp +++ b/src/gui/graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp @@ -140,7 +140,7 @@ void LowLevelGraphicsPostScriptRenderer::clipToPath (const Path& path, const Aff out << "clip\n"; } -void LowLevelGraphicsPostScriptRenderer::clipToImageAlpha (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform) +void LowLevelGraphicsPostScriptRenderer::clipToImageAlpha (const Image& /*sourceImage*/, const Rectangle& /*srcClip*/, const AffineTransform& /*transform*/) { needToClip = true; jassertfalse // xxx @@ -324,11 +324,11 @@ void LowLevelGraphicsPostScriptRenderer::setFill (const FillType& fillType) stateStack.getLast()->fillType = fillType; } -void LowLevelGraphicsPostScriptRenderer::setOpacity (float opacity) +void LowLevelGraphicsPostScriptRenderer::setOpacity (float /*opacity*/) { } -void LowLevelGraphicsPostScriptRenderer::setInterpolationQuality (Graphics::ResamplingQuality quality) +void LowLevelGraphicsPostScriptRenderer::setInterpolationQuality (Graphics::ResamplingQuality /*quality*/) { } @@ -455,7 +455,7 @@ void LowLevelGraphicsPostScriptRenderer::writeImage (const Image& im, } void LowLevelGraphicsPostScriptRenderer::drawImage (const Image& sourceImage, const Rectangle& srcClip, - const AffineTransform& transform, const bool fillEntireClipAsTiles) + const AffineTransform& transform, const bool /*fillEntireClipAsTiles*/) { const int w = jmin (sourceImage.getWidth(), srcClip.getRight()); const int h = jmin (sourceImage.getHeight(), srcClip.getBottom()); diff --git a/src/gui/graphics/fonts/juce_Typeface.cpp b/src/gui/graphics/fonts/juce_Typeface.cpp index 280952bd83..7c834a2d5c 100644 --- a/src/gui/graphics/fonts/juce_Typeface.cpp +++ b/src/gui/graphics/fonts/juce_Typeface.cpp @@ -231,7 +231,7 @@ CustomTypefaceGlyphInfo* CustomTypeface::findGlyphSubstituting (const juce_wchar return glyph; } -bool CustomTypeface::loadGlyphIfPossible (const juce_wchar characterNeeded) +bool CustomTypeface::loadGlyphIfPossible (const juce_wchar /*characterNeeded*/) { return false; } diff --git a/src/io/files/juce_TemporaryFile.cpp b/src/io/files/juce_TemporaryFile.cpp index bac9c75edf..e59cb3ad0a 100644 --- a/src/io/files/juce_TemporaryFile.cpp +++ b/src/io/files/juce_TemporaryFile.cpp @@ -59,8 +59,7 @@ void TemporaryFile::createTempFile (const File& parentDirectory, String name, if ((optionFlags & useHiddenFile) != 0) name = T(".") + name; - temporaryFile = parentDirectory.getNonexistentChildFile (name, targetFile.getFileExtension(), - (optionFlags & putNumbersInBrackets) != 0); + temporaryFile = parentDirectory.getNonexistentChildFile (name, suffix, (optionFlags & putNumbersInBrackets) != 0); } TemporaryFile::~TemporaryFile() diff --git a/src/native/mac/juce_mac_CoreGraphicsContext.mm b/src/native/mac/juce_mac_CoreGraphicsContext.mm index 73aaebc9c8..a1dde5eb3c 100644 --- a/src/native/mac/juce_mac_CoreGraphicsContext.mm +++ b/src/native/mac/juce_mac_CoreGraphicsContext.mm @@ -455,12 +455,24 @@ public: void drawVerticalLine (const int x, double top, double bottom) { +#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5 CGContextFillRect (context, CGRectMake (x, flipHeight - (float) bottom, 1.0f, (float) (bottom - top))); +#else + // On Leopard, unless both co-ordinates are non-integer, it disables anti-aliasing, so nudge + // the x co-ord slightly to trick it.. + CGContextFillRect (context, CGRectMake (x + 1.0f / 256.0f, flipHeight - (float) bottom, 1.0f + 1.0f / 256.0f, (float) (bottom - top))); +#endif } void drawHorizontalLine (const int y, double left, double right) { +#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5 CGContextFillRect (context, CGRectMake ((float) left, flipHeight - (y + 1.0f), (float) (right - left), 1.0f)); +#else + // On Leopard, unless both co-ordinates are non-integer, it disables anti-aliasing, so nudge + // the x co-ord slightly to trick it.. + CGContextFillRect (context, CGRectMake ((float) left, flipHeight - (y + (1.0f + 1.0f / 256.0f)), (float) (right - left), 1.0f + 1.0f / 256.0f)); +#endif } void setFont (const Font& newFont) diff --git a/src/native/windows/juce_win32_FileChooser.cpp b/src/native/windows/juce_win32_FileChooser.cpp index 6453d271f2..1f247f138b 100644 --- a/src/native/windows/juce_win32_FileChooser.cpp +++ b/src/native/windows/juce_win32_FileChooser.cpp @@ -148,7 +148,7 @@ void FileChooser::showPlatformDialog (OwnedArray& results, const File& currentFileOrDirectory, const String& filter, bool selectsDirectory, - bool selectsFiles, + bool /*selectsFiles*/, bool isSaveDialogue, bool warnAboutOverwritingExistingFiles, bool selectMultipleFiles,