From f612f1e4751a1be72fc69f9d9e954c009ed35283 Mon Sep 17 00:00:00 2001 From: Kimmo Hoikka Date: Fri, 7 Nov 2014 17:18:03 +0000 Subject: [PATCH] removing use of using namespace std; [Problem] [Cause] [Solution] Change-Id: Ic1e4cafe06369ff5ed8da0a3d066021caa44e537 --- .../src/dali/utc-Dali-GestureDetector.cpp | 1 - .../src/dali/utc-Dali-RenderableActor.cpp | 1 - automated-tests/src/dali/utc-Dali-Stage.cpp | 1 - .../actor-attachments/camera-attachment-impl.cpp | 2 - .../actor-attachments/image-attachment-impl.cpp | 9 +---- .../actor-attachments/mesh-attachment-impl.cpp | 2 - dali/internal/event/actors/actor-impl.cpp | 2 - dali/internal/event/animation/animation-impl.cpp | 4 +- .../event/common/property-notification-impl.cpp | 2 - dali/internal/event/common/stage-impl.cpp | 3 -- dali/internal/event/modeling/cloth-impl.cpp | 2 - dali/internal/event/modeling/mesh-impl.cpp | 2 - dali/internal/event/modeling/model-logger.cpp | 4 +- dali/internal/event/resources/image-ticket.cpp | 2 - dali/internal/event/resources/resource-ticket.cpp | 2 - dali/internal/render/gl-resources/context.cpp | 2 - .../render/renderers/scene-graph-mesh-renderer.cpp | 2 - .../render/renderers/scene-graph-text-renderer.cpp | 6 +-- .../update/animation/scene-graph-animation.cpp | 2 - .../common/scene-graph-property-notification.cpp | 2 - dali/internal/update/modeling/scene-graph-mesh.cpp | 2 - .../update/node-attachments/node-attachment.cpp | 2 - .../scene-graph-camera-attachment.cpp | 6 +-- .../scene-graph-image-attachment.cpp | 2 - .../scene-graph-light-attachment.cpp | 2 - .../scene-graph-mesh-attachment.cpp | 3 -- .../scene-graph-renderable-attachment.cpp | 2 - dali/internal/update/nodes/scene-graph-layer.cpp | 3 -- .../internal/update/resources/resource-manager.cpp | 43 +++++++++++----------- dali/public-api/actors/actor.cpp | 2 - dali/public-api/actors/custom-actor-impl.cpp | 2 - dali/public-api/common/stage.cpp | 2 - dali/public-api/geometry/mesh-data.cpp | 4 +- dali/public-api/object/base-object.cpp | 2 - docs/templates/example-class-internal.cpp | 2 - 35 files changed, 31 insertions(+), 101 deletions(-) diff --git a/automated-tests/src/dali/utc-Dali-GestureDetector.cpp b/automated-tests/src/dali/utc-Dali-GestureDetector.cpp index 42fad1e..10000bc 100644 --- a/automated-tests/src/dali/utc-Dali-GestureDetector.cpp +++ b/automated-tests/src/dali/utc-Dali-GestureDetector.cpp @@ -23,7 +23,6 @@ #include using namespace Dali; -using namespace std; void utc_dali_gesture_detector_startup(void) { diff --git a/automated-tests/src/dali/utc-Dali-RenderableActor.cpp b/automated-tests/src/dali/utc-Dali-RenderableActor.cpp index 5361c55..63830e8 100644 --- a/automated-tests/src/dali/utc-Dali-RenderableActor.cpp +++ b/automated-tests/src/dali/utc-Dali-RenderableActor.cpp @@ -24,7 +24,6 @@ #include using namespace Dali; -using namespace std; void renderable_actor_startup(void) { diff --git a/automated-tests/src/dali/utc-Dali-Stage.cpp b/automated-tests/src/dali/utc-Dali-Stage.cpp index 57c730f..0f850e3 100644 --- a/automated-tests/src/dali/utc-Dali-Stage.cpp +++ b/automated-tests/src/dali/utc-Dali-Stage.cpp @@ -27,7 +27,6 @@ #include using namespace Dali; -using namespace std; void stage_test_startup(void) { diff --git a/dali/internal/event/actor-attachments/camera-attachment-impl.cpp b/dali/internal/event/actor-attachments/camera-attachment-impl.cpp index 767f848..8721fba 100644 --- a/dali/internal/event/actor-attachments/camera-attachment-impl.cpp +++ b/dali/internal/event/actor-attachments/camera-attachment-impl.cpp @@ -23,8 +23,6 @@ #include #include -using namespace std; - namespace Dali { diff --git a/dali/internal/event/actor-attachments/image-attachment-impl.cpp b/dali/internal/event/actor-attachments/image-attachment-impl.cpp index 8bde322..6962bdb 100644 --- a/dali/internal/event/actor-attachments/image-attachment-impl.cpp +++ b/dali/internal/event/actor-attachments/image-attachment-impl.cpp @@ -23,13 +23,6 @@ #include #include -using namespace std; - -namespace -{ -static Dali::Internal::SceneGraph::ImageAttachment::PixelArea EMPTY_PIXEL_AREA(0,0,0,0); -} - namespace Dali { @@ -55,7 +48,7 @@ ImageAttachmentPtr ImageAttachment::New( const SceneGraph::Node& parentNode ) ImageAttachment::ImageAttachment( Stage& stage ) : RenderableAttachment(stage), mSceneObject(NULL), - mPixelArea(EMPTY_PIXEL_AREA), + mPixelArea(0,0,0,0), mStyle(Dali::ImageActor::STYLE_QUAD), mBorder(0.45,0.45,0.1,0.1), mIsPixelAreaSet(false), diff --git a/dali/internal/event/actor-attachments/mesh-attachment-impl.cpp b/dali/internal/event/actor-attachments/mesh-attachment-impl.cpp index 90ac633..45ba5e1 100644 --- a/dali/internal/event/actor-attachments/mesh-attachment-impl.cpp +++ b/dali/internal/event/actor-attachments/mesh-attachment-impl.cpp @@ -25,8 +25,6 @@ #include #include -using namespace std; - using Dali::Internal::MeshIPtr; using Dali::Internal::MaterialIPtr; diff --git a/dali/internal/event/actors/actor-impl.cpp b/dali/internal/event/actors/actor-impl.cpp index 1ff9f47..203cc45 100644 --- a/dali/internal/event/actors/actor-impl.cpp +++ b/dali/internal/event/actors/actor-impl.cpp @@ -61,8 +61,6 @@ using Dali::Internal::SceneGraph::Node; using Dali::Internal::SceneGraph::AnimatableProperty; using Dali::Internal::SceneGraph::PropertyBase; -using namespace std; - namespace Dali { diff --git a/dali/internal/event/animation/animation-impl.cpp b/dali/internal/event/animation/animation-impl.cpp index f3b9702..2af1a77 100644 --- a/dali/internal/event/animation/animation-impl.cpp +++ b/dali/internal/event/animation/animation-impl.cpp @@ -34,8 +34,6 @@ #include #include -using namespace std; - using Dali::Internal::SceneGraph::UpdateManager; using Dali::Internal::SceneGraph::AnimatorBase; using Dali::Internal::SceneGraph::Shader; @@ -986,7 +984,7 @@ void Animation::Resize(Actor& actor, float width, float height, AlphaFunction al void Animation::Resize(Actor& actor, float width, float height, AlphaFunction alpha, float delaySeconds, float durationSeconds) { - Vector3 targetSize( width, height, min(width, height) ); + Vector3 targetSize( width, height, std::min(width, height) ); ExtendDuration( TimePeriod(delaySeconds, durationSeconds) ); diff --git a/dali/internal/event/common/property-notification-impl.cpp b/dali/internal/event/common/property-notification-impl.cpp index 713bc7e..834cfb4 100644 --- a/dali/internal/event/common/property-notification-impl.cpp +++ b/dali/internal/event/common/property-notification-impl.cpp @@ -30,8 +30,6 @@ #include #include -using namespace std; - using Dali::Internal::SceneGraph::UpdateManager; namespace Dali diff --git a/dali/internal/event/common/stage-impl.cpp b/dali/internal/event/common/stage-impl.cpp index de0c281..d26f950 100644 --- a/dali/internal/event/common/stage-impl.cpp +++ b/dali/internal/event/common/stage-impl.cpp @@ -45,9 +45,6 @@ #include #endif -using namespace std; -using namespace boost; - using Dali::Internal::SceneGraph::Node; namespace Dali diff --git a/dali/internal/event/modeling/cloth-impl.cpp b/dali/internal/event/modeling/cloth-impl.cpp index 125ada5..303d161 100644 --- a/dali/internal/event/modeling/cloth-impl.cpp +++ b/dali/internal/event/modeling/cloth-impl.cpp @@ -24,8 +24,6 @@ // INTERNAL INCLUDES #include -using namespace std; - namespace Dali { namespace Internal diff --git a/dali/internal/event/modeling/mesh-impl.cpp b/dali/internal/event/modeling/mesh-impl.cpp index 1b5d69c..ac2a6f0 100644 --- a/dali/internal/event/modeling/mesh-impl.cpp +++ b/dali/internal/event/modeling/mesh-impl.cpp @@ -31,8 +31,6 @@ #include #include -using namespace std; - namespace Dali { namespace Internal diff --git a/dali/internal/event/modeling/model-logger.cpp b/dali/internal/event/modeling/model-logger.cpp index 4914752..c77aa4b 100644 --- a/dali/internal/event/modeling/model-logger.cpp +++ b/dali/internal/event/modeling/model-logger.cpp @@ -37,7 +37,9 @@ #include #include -using namespace std; +using std::cout; +using std::endl; +using std::string; namespace Dali { diff --git a/dali/internal/event/resources/image-ticket.cpp b/dali/internal/event/resources/image-ticket.cpp index 2e65f10..fb3efc4 100644 --- a/dali/internal/event/resources/image-ticket.cpp +++ b/dali/internal/event/resources/image-ticket.cpp @@ -19,8 +19,6 @@ #include #include -using namespace std; - namespace Dali { diff --git a/dali/internal/event/resources/resource-ticket.cpp b/dali/internal/event/resources/resource-ticket.cpp index 60348f5..259d742 100644 --- a/dali/internal/event/resources/resource-ticket.cpp +++ b/dali/internal/event/resources/resource-ticket.cpp @@ -28,8 +28,6 @@ #include #include -using namespace std; - namespace // unnamed namespace { diff --git a/dali/internal/render/gl-resources/context.cpp b/dali/internal/render/gl-resources/context.cpp index 963eb15..eff48a5 100644 --- a/dali/internal/render/gl-resources/context.cpp +++ b/dali/internal/render/gl-resources/context.cpp @@ -29,8 +29,6 @@ #include #include -using namespace std; - namespace Dali { diff --git a/dali/internal/render/renderers/scene-graph-mesh-renderer.cpp b/dali/internal/render/renderers/scene-graph-mesh-renderer.cpp index 3d30d82..90b9838 100644 --- a/dali/internal/render/renderers/scene-graph-mesh-renderer.cpp +++ b/dali/internal/render/renderers/scene-graph-mesh-renderer.cpp @@ -31,8 +31,6 @@ #include #include -using namespace std; - namespace Dali { diff --git a/dali/internal/render/renderers/scene-graph-text-renderer.cpp b/dali/internal/render/renderers/scene-graph-text-renderer.cpp index f3ec12e..b223923 100644 --- a/dali/internal/render/renderers/scene-graph-text-renderer.cpp +++ b/dali/internal/render/renderers/scene-graph-text-renderer.cpp @@ -35,8 +35,6 @@ #include #include -using namespace std; - #if defined(DEBUG_ENABLED) namespace { @@ -375,7 +373,7 @@ void TextRenderer::DoRender( BufferIndex bufferIndex, Program& program, const Ma const GLint smoothingLoc = program.GetUniformLocation( Program::UNIFORM_SMOOTHING ); if( Program::UNIFORM_UNKNOWN != smoothingLoc ) { - smoothWidth = min( min(mSmoothing, 1.0f - mSmoothing), smoothWidth ); + smoothWidth = std::min( std::min(mSmoothing, 1.0f - mSmoothing), smoothWidth ); if( mPixelSize < SMOOTHING_ADJUSTMENT_PIXEL_SIZE ) { @@ -398,7 +396,7 @@ void TextRenderer::DoRender( BufferIndex bufferIndex, Program& program, const Ma const Vector4& outlineColor = mTextParameters->GetOutlineColor(); float outlineWidth = outline[1] + smoothWidth; float outlineStart = outline[0]; - float outlineEnd = min( 1.0f, outlineStart + outlineWidth ); + float outlineEnd = std::min( 1.0f, outlineStart + outlineWidth ); program.SetUniform2f(outlineLoc, outlineStart, outlineEnd); program.SetUniform4f(outlineColorLoc, outlineColor.r, outlineColor.g, outlineColor.b, outlineColor.a); diff --git a/dali/internal/update/animation/scene-graph-animation.cpp b/dali/internal/update/animation/scene-graph-animation.cpp index 7c4b744..c1a3d04 100644 --- a/dali/internal/update/animation/scene-graph-animation.cpp +++ b/dali/internal/update/animation/scene-graph-animation.cpp @@ -24,8 +24,6 @@ // INTERNAL INCLUDES #include -using namespace std; - namespace Dali { diff --git a/dali/internal/update/common/scene-graph-property-notification.cpp b/dali/internal/update/common/scene-graph-property-notification.cpp index 2396fda..e569c3b 100644 --- a/dali/internal/update/common/scene-graph-property-notification.cpp +++ b/dali/internal/update/common/scene-graph-property-notification.cpp @@ -24,8 +24,6 @@ #include #include -using namespace std; - namespace Dali { diff --git a/dali/internal/update/modeling/scene-graph-mesh.cpp b/dali/internal/update/modeling/scene-graph-mesh.cpp index 321498d..205aff8 100644 --- a/dali/internal/update/modeling/scene-graph-mesh.cpp +++ b/dali/internal/update/modeling/scene-graph-mesh.cpp @@ -23,8 +23,6 @@ #include #include -using namespace std; - namespace Dali { diff --git a/dali/internal/update/node-attachments/node-attachment.cpp b/dali/internal/update/node-attachments/node-attachment.cpp index 28c03e6..659d109 100644 --- a/dali/internal/update/node-attachments/node-attachment.cpp +++ b/dali/internal/update/node-attachments/node-attachment.cpp @@ -22,8 +22,6 @@ #include #include -using namespace std; - namespace Dali { diff --git a/dali/internal/update/node-attachments/scene-graph-camera-attachment.cpp b/dali/internal/update/node-attachments/scene-graph-camera-attachment.cpp index 868ae59..7becbff 100644 --- a/dali/internal/update/node-attachments/scene-graph-camera-attachment.cpp +++ b/dali/internal/update/node-attachments/scene-graph-camera-attachment.cpp @@ -25,12 +25,10 @@ #include #include -using namespace std; - namespace // unnamed namespace { -static unsigned int UPDATE_COUNT = 2u; // Update projection or view matrix this many frames after a change -static unsigned int COPY_PREVIOUS_PROJECTION = 1u; // Copy projection matrix from previous frame +const unsigned int UPDATE_COUNT = 2u; // Update projection or view matrix this many frames after a change +const unsigned int COPY_PREVIOUS_PROJECTION = 1u; // Copy projection matrix from previous frame } namespace Dali diff --git a/dali/internal/update/node-attachments/scene-graph-image-attachment.cpp b/dali/internal/update/node-attachments/scene-graph-image-attachment.cpp index 7d84eb3..803b557 100644 --- a/dali/internal/update/node-attachments/scene-graph-image-attachment.cpp +++ b/dali/internal/update/node-attachments/scene-graph-image-attachment.cpp @@ -39,8 +39,6 @@ #include -using namespace std; - namespace Dali { diff --git a/dali/internal/update/node-attachments/scene-graph-light-attachment.cpp b/dali/internal/update/node-attachments/scene-graph-light-attachment.cpp index 3305c7c..f1d5a13 100644 --- a/dali/internal/update/node-attachments/scene-graph-light-attachment.cpp +++ b/dali/internal/update/node-attachments/scene-graph-light-attachment.cpp @@ -25,8 +25,6 @@ #include #include -using namespace std; - namespace Dali { diff --git a/dali/internal/update/node-attachments/scene-graph-mesh-attachment.cpp b/dali/internal/update/node-attachments/scene-graph-mesh-attachment.cpp index dcf471e..897606c 100644 --- a/dali/internal/update/node-attachments/scene-graph-mesh-attachment.cpp +++ b/dali/internal/update/node-attachments/scene-graph-mesh-attachment.cpp @@ -41,9 +41,6 @@ #include #include - -using namespace std; - namespace Dali { diff --git a/dali/internal/update/node-attachments/scene-graph-renderable-attachment.cpp b/dali/internal/update/node-attachments/scene-graph-renderable-attachment.cpp index 7008134..c4ee129 100644 --- a/dali/internal/update/node-attachments/scene-graph-renderable-attachment.cpp +++ b/dali/internal/update/node-attachments/scene-graph-renderable-attachment.cpp @@ -30,8 +30,6 @@ #include #include -using namespace std; - namespace Dali { diff --git a/dali/internal/update/nodes/scene-graph-layer.cpp b/dali/internal/update/nodes/scene-graph-layer.cpp index 3d0e5e5..8b4e428 100644 --- a/dali/internal/update/nodes/scene-graph-layer.cpp +++ b/dali/internal/update/nodes/scene-graph-layer.cpp @@ -21,9 +21,6 @@ // INTERNAL INCLUDES #include - -using namespace std; - namespace Dali { diff --git a/dali/internal/update/resources/resource-manager.cpp b/dali/internal/update/resources/resource-manager.cpp index 25526ff..1bacd0d 100644 --- a/dali/internal/update/resources/resource-manager.cpp +++ b/dali/internal/update/resources/resource-manager.cpp @@ -48,7 +48,6 @@ #include #include -using namespace std; using namespace Dali::Integration; using Dali::Internal::SceneGraph::DiscardQueue; @@ -60,33 +59,33 @@ namespace Dali namespace Internal { -typedef set LiveRequestContainer; -typedef LiveRequestContainer::iterator LiveRequestIter; -typedef LiveRequestContainer::size_type LiveRequestSize; +typedef std::set LiveRequestContainer; +typedef LiveRequestContainer::iterator LiveRequestIter; +typedef LiveRequestContainer::size_type LiveRequestSize; -typedef map DeadRequestContainer; -typedef DeadRequestContainer::iterator DeadRequestIter; -typedef pair DeadRequestPair; +typedef std::map DeadRequestContainer; +typedef DeadRequestContainer::iterator DeadRequestIter; +typedef std::pair DeadRequestPair; -typedef vector NotifyQueue; -typedef NotifyQueue::iterator NotifyQueueIter; +typedef std::vector NotifyQueue; +typedef NotifyQueue::iterator NotifyQueueIter; -typedef map BitmapMetadataCache; -typedef BitmapMetadataCache::iterator BitmapMetadataIter; -typedef pair BitmapMetadataPair; +typedef std::map BitmapMetadataCache; +typedef BitmapMetadataCache::iterator BitmapMetadataIter; +typedef std::pair BitmapMetadataPair; -typedef map ModelCache; -typedef ModelCache::iterator ModelCacheIter; -typedef pair ModelDataPair; +typedef std::map ModelCache; +typedef ModelCache::iterator ModelCacheIter; +typedef std::pair ModelDataPair; -typedef map MeshCache; -typedef MeshCache::iterator MeshCacheIter; -typedef pair MeshDataPair; +typedef std::map MeshCache; +typedef MeshCache::iterator MeshCacheIter; +typedef std::pair MeshDataPair; -typedef map ShaderCache; -typedef ShaderCache::iterator ShaderCacheIter; -typedef ShaderCache::size_type ShaderCacheSize; -typedef pair ShaderDataPair; +typedef std::map ShaderCache; +typedef ShaderCache::iterator ShaderCacheIter; +typedef ShaderCache::size_type ShaderCacheSize; +typedef std::pair ShaderDataPair; static inline bool RemoveId( LiveRequestContainer& container, ResourceId id ) { diff --git a/dali/public-api/actors/actor.cpp b/dali/public-api/actors/actor.cpp index bd56f4b..1e8abf1 100644 --- a/dali/public-api/actors/actor.cpp +++ b/dali/public-api/actors/actor.cpp @@ -43,8 +43,6 @@ #include #endif -using namespace std; - namespace Dali { diff --git a/dali/public-api/actors/custom-actor-impl.cpp b/dali/public-api/actors/custom-actor-impl.cpp index c393604..d27d22f 100644 --- a/dali/public-api/actors/custom-actor-impl.cpp +++ b/dali/public-api/actors/custom-actor-impl.cpp @@ -22,8 +22,6 @@ #include #include -using namespace std; - namespace Dali { diff --git a/dali/public-api/common/stage.cpp b/dali/public-api/common/stage.cpp index dac376b..f70b46d 100644 --- a/dali/public-api/common/stage.cpp +++ b/dali/public-api/common/stage.cpp @@ -35,8 +35,6 @@ #include #endif -using namespace std; - namespace Dali { diff --git a/dali/public-api/geometry/mesh-data.cpp b/dali/public-api/geometry/mesh-data.cpp index 7905ee2..02df6e5 100644 --- a/dali/public-api/geometry/mesh-data.cpp +++ b/dali/public-api/geometry/mesh-data.cpp @@ -22,14 +22,12 @@ #include #include -using namespace std; - namespace Dali { namespace // unnamed namespace { -static const float kBoundsDefault = 1e10f; +const float kBoundsDefault = 1e10f; } // unnamed namespace using Dali::Vector4; diff --git a/dali/public-api/object/base-object.cpp b/dali/public-api/object/base-object.cpp index 4535bbe..43f4c29 100644 --- a/dali/public-api/object/base-object.cpp +++ b/dali/public-api/object/base-object.cpp @@ -25,8 +25,6 @@ #include #include -using namespace std; - namespace Dali { diff --git a/docs/templates/example-class-internal.cpp b/docs/templates/example-class-internal.cpp index 54cb33b..eecf5cb 100644 --- a/docs/templates/example-class-internal.cpp +++ b/docs/templates/example-class-internal.cpp @@ -24,8 +24,6 @@ // Dali includes #include "actor.h" -using namespace std; - namespace // unnamed namespace start { -- 2.7.4