From 22139761dc96fd3bcfdfbbe2c158b18816934c57 Mon Sep 17 00:00:00 2001 From: jules Date: Wed, 4 Sep 2013 16:50:50 +0100 Subject: [PATCH] Couple of MSVC warning clean-ups. --- modules/juce_core/memory/juce_ReferenceCountedObject.h | 8 ++++---- modules/juce_graphics/contexts/juce_GraphicsContext.cpp | 6 +++--- .../contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/modules/juce_core/memory/juce_ReferenceCountedObject.h b/modules/juce_core/memory/juce_ReferenceCountedObject.h index 8dfb20198b..160b79f42f 100644 --- a/modules/juce_core/memory/juce_ReferenceCountedObject.h +++ b/modules/juce_core/memory/juce_ReferenceCountedObject.h @@ -258,8 +258,8 @@ public: /** Copies another pointer. This will increment the object's reference-count (if it is non-null). */ - template - ReferenceCountedObjectPtr (const ReferenceCountedObjectPtr& other) noexcept + template + ReferenceCountedObjectPtr (const ReferenceCountedObjectPtr& other) noexcept : referencedObject (static_cast (other.get())) { incIfNotNull (referencedObject); @@ -278,8 +278,8 @@ public: The reference count of the old object is decremented, and it might be deleted if it hits zero. The new object's count is incremented. */ - template - ReferenceCountedObjectPtr& operator= (const ReferenceCountedObjectPtr& other) + template + ReferenceCountedObjectPtr& operator= (const ReferenceCountedObjectPtr& other) { return operator= (static_cast (other.get())); } diff --git a/modules/juce_graphics/contexts/juce_GraphicsContext.cpp b/modules/juce_graphics/contexts/juce_GraphicsContext.cpp index cc64cf1bf6..7c530e701a 100644 --- a/modules/juce_graphics/contexts/juce_GraphicsContext.cpp +++ b/modules/juce_graphics/contexts/juce_GraphicsContext.cpp @@ -396,17 +396,17 @@ void Graphics::strokePath (const Path& path, //============================================================================== void Graphics::drawRect (float x, float y, float width, float height, float lineThickness) const { - drawRect (coordsToRectangle (x, y, width, height).toFloat()); + drawRect (coordsToRectangle (x, y, width, height), lineThickness); } void Graphics::drawRect (int x, int y, int width, int height, int lineThickness) const { - drawRect (coordsToRectangle (x, y, width, height).toFloat()); + drawRect (coordsToRectangle (x, y, width, height), lineThickness); } void Graphics::drawRect (const Rectangle& r, int lineThickness) const { - drawRect (r.toFloat(), lineThickness); + drawRect (r.toFloat(), (float) lineThickness); } void Graphics::drawRect (Rectangle r, const float lineThickness) const diff --git a/modules/juce_graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp b/modules/juce_graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp index 6f9e69d4ec..e6a8765813 100644 --- a/modules/juce_graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp +++ b/modules/juce_graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp @@ -346,7 +346,8 @@ void LowLevelGraphicsPostScriptRenderer::fillRect (const Rectangle& r) writeClip(); writeColour (stateStack.getLast()->fillType.colour); - Rectangle r2 (r.translated (stateStack.getLast()->xOffset, stateStack.getLast()->yOffset)); + Rectangle r2 (r.translated ((float) stateStack.getLast()->xOffset, + (float) stateStack.getLast()->yOffset)); out << r2.getX() << ' ' << -r2.getBottom() << ' ' << r2.getWidth() << ' ' << r2.getHeight() << " rectfill\n"; }