From ea63746c2c7c9f1998fc1ee425e4cb7eeb2196e3 Mon Sep 17 00:00:00 2001 From: Lee Morgan Date: Mon, 3 Mar 2014 12:57:20 +0000 Subject: [PATCH] Emscripten/llvm related issues [Issue] N/A [Problem] Emscripten/llvm patch (f33bf99) highlighted issues [Cause] N/A [Solution] N/A Signed-off-by: Paul Wisbey Change-Id: I625e1cd852bf199b5bea261581c71ae4d0ff83e2 --- .../animation/utc-Dali-ActiveConstraint.cpp | 2 +- .../type-registry/utc-Dali-TypeRegistry.cpp | 4 ++-- dali/internal/event/common/type-info-impl.cpp | 19 ++++++++++++++----- dali/internal/event/images/image-factory.h | 2 +- dali/internal/event/modeling/animatable-mesh-impl.cpp | 8 ++++---- dali/internal/event/modeling/animatable-mesh-impl.h | 3 +-- dali/internal/event/text/font-factory.cpp | 4 ++-- dali/internal/event/text/font-metrics.cpp | 8 +++----- dali/internal/event/text/font-metrics.h | 8 ++------ dali/public-api/geometry/animatable-mesh.cpp | 2 +- dali/public-api/geometry/animatable-vertex.cpp | 12 ++++++------ 11 files changed, 37 insertions(+), 35 deletions(-) diff --git a/automated-tests/dali-test-suite/animation/utc-Dali-ActiveConstraint.cpp b/automated-tests/dali-test-suite/animation/utc-Dali-ActiveConstraint.cpp index ef32a48..facc341 100644 --- a/automated-tests/dali-test-suite/animation/utc-Dali-ActiveConstraint.cpp +++ b/automated-tests/dali-test-suite/animation/utc-Dali-ActiveConstraint.cpp @@ -365,7 +365,7 @@ void UtcDaliConstraintProperties() } catch ( DaliException& e ) { - DALI_TEST_ASSERT_CONDITION_STARTS_WITH_SUBSTRING( e, "! \"Property index is invalid", TEST_LOCATION ); + DALI_TEST_ASSERT_CONDITION_STARTS_WITH_SUBSTRING( e, "! \"Cannot find property index", TEST_LOCATION ); } DALI_TEST_EQUALS( active.GetPropertyIndex( "invalid-property-name"), Property::INVALID_INDEX, TEST_LOCATION ); try diff --git a/automated-tests/dali-test-suite/type-registry/utc-Dali-TypeRegistry.cpp b/automated-tests/dali-test-suite/type-registry/utc-Dali-TypeRegistry.cpp index 87553cb..16eea9f 100644 --- a/automated-tests/dali-test-suite/type-registry/utc-Dali-TypeRegistry.cpp +++ b/automated-tests/dali-test-suite/type-registry/utc-Dali-TypeRegistry.cpp @@ -843,7 +843,7 @@ void UtcDaliPropertyRegistrationInvalidGetAndSet() } catch ( DaliException& e ) { - DALI_TEST_ASSERT_CONDITION_STARTS_WITH_SUBSTRING( e, "false && \"Property index not found", TEST_LOCATION ); + DALI_TEST_ASSERT_CONDITION_STARTS_WITH_SUBSTRING( e, "! \"Cannot find property index", TEST_LOCATION ); } // Try to get an index that hasn't been added @@ -854,6 +854,6 @@ void UtcDaliPropertyRegistrationInvalidGetAndSet() } catch ( DaliException& e ) { - DALI_TEST_ASSERT_CONDITION_STARTS_WITH_SUBSTRING( e, "false && \"Property index not found", TEST_LOCATION ); + DALI_TEST_ASSERT_CONDITION_STARTS_WITH_SUBSTRING( e, "! \"Cannot find property index", TEST_LOCATION ); } } diff --git a/dali/internal/event/common/type-info-impl.cpp b/dali/internal/event/common/type-info-impl.cpp index d600629..5a237d9 100644 --- a/dali/internal/event/common/type-info-impl.cpp +++ b/dali/internal/event/common/type-info-impl.cpp @@ -249,9 +249,10 @@ const std::string& TypeInfo::GetPropertyName( Property::Index index ) const return GetImplementation(base).GetPropertyName( index ); } + DALI_ASSERT_ALWAYS( ! "Cannot find property index" ); // use the same assert as ProxyObject + // Property not found, return reference to invalid property string. static const std::string EMPTY_PROPERTY_NAME; - DALI_LOG_WARNING( "Property index (%d) invalid", index ); return EMPTY_PROPERTY_NAME; } @@ -380,6 +381,10 @@ bool TypeInfo::IsPropertyWritable( Property::Index index ) const { writable = GetImplementation(base).IsPropertyWritable( index ); } + else + { + DALI_ASSERT_ALWAYS( ! "Cannot find property index" ); // use the same assert as ProxyObject + } } return writable; @@ -403,6 +408,10 @@ Property::Type TypeInfo::GetPropertyType( Property::Index index ) const { type = GetImplementation(base).GetPropertyType( index ); } + else + { + DALI_ASSERT_ALWAYS( ! "Cannot find property index" ); // use the same assert as ProxyObject + } } return type; @@ -426,7 +435,7 @@ void TypeInfo::SetProperty( BaseObject *object, Property::Index index, const Pro } else { - DALI_ASSERT_ALWAYS( false && "Property index not found" ); + DALI_ASSERT_ALWAYS( ! "Cannot find property index" ); // use the same assert as ProxyObject } } } @@ -449,7 +458,7 @@ void TypeInfo::SetProperty( BaseObject *object, const std::string& name, const P } else { - DALI_ASSERT_ALWAYS( false && "Property name not found" ); + DALI_ASSERT_ALWAYS( ! "Cannot find property name" ); } } } @@ -470,7 +479,7 @@ Property::Value TypeInfo::GetProperty( const BaseObject *object, Property::Index return GetImplementation( base ).GetProperty( object, index ); } - DALI_ASSERT_ALWAYS( false && "Property index not found" ); + DALI_ASSERT_ALWAYS( ! "Cannot find property index" ); // use the same assert as ProxyObject return Property::Value(); } @@ -491,7 +500,7 @@ Property::Value TypeInfo::GetProperty( const BaseObject *object, const std::stri return GetImplementation( base ).GetProperty( object, name ); } - DALI_ASSERT_ALWAYS( false && "Property name not found" ); + DALI_ASSERT_ALWAYS( ! "Cannot find property name" ); return Property::Value(); } diff --git a/dali/internal/event/images/image-factory.h b/dali/internal/event/images/image-factory.h index f40cc1e..ff11e36 100644 --- a/dali/internal/event/images/image-factory.h +++ b/dali/internal/event/images/image-factory.h @@ -31,7 +31,7 @@ class ResourceType; namespace ImageFactoryCache { -class Request; +struct Request; } /** diff --git a/dali/internal/event/modeling/animatable-mesh-impl.cpp b/dali/internal/event/modeling/animatable-mesh-impl.cpp index 70a2a1e..0f6d11e 100644 --- a/dali/internal/event/modeling/animatable-mesh-impl.cpp +++ b/dali/internal/event/modeling/animatable-mesh-impl.cpp @@ -97,8 +97,8 @@ AnimatableMeshPtr AnimatableMesh::New( DALI_ASSERT_ALWAYS( numVertices > 0 && "Mesh has no vertices" ); DALI_ASSERT_ALWAYS( ( numVertices * 3 ) < DEFAULT_PROPERTY_MAX_COUNT && "Mesh exceeds maximum supported vertices" ); DALI_ASSERT_ALWAYS( faceIndices.size() > 0 && "Mesh has no faces" ); - for( Dali::AnimatableMesh::FacesConstIter faceIter=faceIndices.begin() ; - faceIter != faceIndices.end() ; + for( Dali::AnimatableMesh::FacesConstIter faceIter=faceIndices.begin(); + faceIter != faceIndices.end(); ++faceIter ) { unsigned int faceIndex = *faceIter; @@ -152,7 +152,7 @@ unsigned int AnimatableMesh::GetNumberOfVertices() const return mNumberOfVertices; } -Property::Index AnimatableMesh::GetPropertyIndex( +Property::Index AnimatableMesh::GetVertexPropertyIndex( unsigned int vertex, Property::Index property ) const { @@ -378,7 +378,7 @@ const SceneGraph::PropertyBase* AnimatableMesh::GetSceneObjectAnimatableProperty property = &mSceneObject->mVertices[vertexIndex].color; break; case Dali::AnimatableVertex::TEXTURE_COORDS: - property = &mSceneObject->mVertices[vertexIndex].textureCoords ; + property = &mSceneObject->mVertices[vertexIndex].textureCoords; break; default: diff --git a/dali/internal/event/modeling/animatable-mesh-impl.h b/dali/internal/event/modeling/animatable-mesh-impl.h index d15d85f..e9d163d 100644 --- a/dali/internal/event/modeling/animatable-mesh-impl.h +++ b/dali/internal/event/modeling/animatable-mesh-impl.h @@ -87,8 +87,7 @@ public: /** * Get the property index from the vertex index and the vertex property enumeration */ - using ProxyObject::GetPropertyIndex; - Property::Index GetPropertyIndex( unsigned int vertex, Property::Index property ) const; + Property::Index GetVertexPropertyIndex( unsigned int vertex, Property::Index property ) const; /** * Set the given vertex position diff --git a/dali/internal/event/text/font-factory.cpp b/dali/internal/event/text/font-factory.cpp index 89af73a..7c6f2b5 100644 --- a/dali/internal/event/text/font-factory.cpp +++ b/dali/internal/event/text/font-factory.cpp @@ -62,7 +62,7 @@ FontMetricsIntrusivePtr FontFactory::GetFontMetrics( const std::string& fontFami FontMetricsIter iter = mMetricsCache.find( hashValue ); if ( iter == mMetricsCache.end() ) { - metrics = FontMetrics::New( Vector2(mHorizontalDpi, mVerticalDpi), hashValue, mFontCount, fontFamily, fontStyle, mResourceClient ); + metrics = FontMetrics::New( Vector2(mHorizontalDpi, mVerticalDpi), hashValue, mFontCount, fontFamily, fontStyle ); mFontCount++; // load the global metrics @@ -113,7 +113,7 @@ void FontFactory::GetFontInformation( FontId fontId, for( FontMetricsMap::const_iterator iter = mMetricsCache.begin(); iter != endIter; ++iter) { - const FontMetrics* metric( (*iter).second.Get() ) ; + const FontMetrics* metric( (*iter).second.Get() ); if( metric->GetFontId() == fontId) { diff --git a/dali/internal/event/text/font-metrics.cpp b/dali/internal/event/text/font-metrics.cpp index a30c78e..334b7e5 100644 --- a/dali/internal/event/text/font-metrics.cpp +++ b/dali/internal/event/text/font-metrics.cpp @@ -62,10 +62,9 @@ FontMetricsIntrusivePtr FontMetrics::New( const Vector2& dpi, const std::size_t hashValue, const FontId fontId, const std::string& fontFamily, - const std::string& fontStyle, - ResourceClient& resourceClient ) + const std::string& fontStyle ) { - return new FontMetrics( dpi, hashValue, fontId, fontFamily, fontStyle, resourceClient); + return new FontMetrics( dpi, hashValue, fontId, fontFamily, fontStyle ); } void FontMetrics::LoadGlobalMetrics() @@ -417,8 +416,7 @@ FontMetrics::FontMetrics(const Vector2& dpi, const std::size_t hashValue, const FontId fontId, const std::string& fontFamily, - const std::string& fontStyle, - ResourceClient& resourceClient ) + const std::string& fontStyle ) : mFontFamily(fontFamily), mFontStyle(fontStyle), diff --git a/dali/internal/event/text/font-metrics.h b/dali/internal/event/text/font-metrics.h index 65762c7..35cd7c7 100644 --- a/dali/internal/event/text/font-metrics.h +++ b/dali/internal/event/text/font-metrics.h @@ -65,7 +65,6 @@ namespace Internal // Forward declarations. class FontMetrics; -class ResourceClient; typedef IntrusivePtr FontMetricsIntrusivePtr; @@ -88,15 +87,13 @@ public: * @param [in] fontId font id. * @param [in] fontFamily the font family * @param [in] fontStyle the font style - * @param [in] resourceClient resource client * @return An intrusive-pointer to the new instance. */ static FontMetricsIntrusivePtr New( const Vector2& dpi, const std::size_t hashValue, const FontId fontId, const std::string& fontFamily, - const std::string& fontStyle, - ResourceClient& resourceClient ); + const std::string& fontStyle ); /** @@ -291,8 +288,7 @@ private: const std::size_t hashValue, const FontId fontId, const std::string& fontFamily, - const std::string& fontStyle, - ResourceClient& resourceClient ); + const std::string& fontStyle ); /** * Virtual destructor. diff --git a/dali/public-api/geometry/animatable-mesh.cpp b/dali/public-api/geometry/animatable-mesh.cpp index 1f903f4..08a798a 100644 --- a/dali/public-api/geometry/animatable-mesh.cpp +++ b/dali/public-api/geometry/animatable-mesh.cpp @@ -71,7 +71,7 @@ Property::Index AnimatableMesh::GetPropertyIndex( { DALI_ASSERT_ALWAYS( index < GetNumberOfVertices() && "Index out of bounds" ); - return GetImplementation(*this).GetPropertyIndex( index, property ); + return GetImplementation(*this).GetVertexPropertyIndex( index, property ); } Property AnimatableMesh::GetVertexProperty( unsigned int vertex, Property::Index property) diff --git a/dali/public-api/geometry/animatable-vertex.cpp b/dali/public-api/geometry/animatable-vertex.cpp index 82a5b64..1ab41a5 100644 --- a/dali/public-api/geometry/animatable-vertex.cpp +++ b/dali/public-api/geometry/animatable-vertex.cpp @@ -35,37 +35,37 @@ AnimatableVertex::~AnimatableVertex() void AnimatableVertex::SetPosition(const Vector3& position) { - mMesh.SetProperty( mMesh.GetPropertyIndex(mVertex, POSITION), Property::Value(position) ); + mMesh.SetProperty( mMesh.GetVertexPropertyIndex(mVertex, POSITION), Property::Value(position) ); } void AnimatableVertex::SetColor(const Vector4& color) { - mMesh.SetProperty( mMesh.GetPropertyIndex(mVertex, COLOR), Property::Value(color) ); + mMesh.SetProperty( mMesh.GetVertexPropertyIndex(mVertex, COLOR), Property::Value(color) ); } void AnimatableVertex::SetTextureCoords(const Vector2& textureCoords) { - mMesh.SetProperty( mMesh.GetPropertyIndex(mVertex, TEXTURE_COORDS), Property::Value(textureCoords) ); + mMesh.SetProperty( mMesh.GetVertexPropertyIndex(mVertex, TEXTURE_COORDS), Property::Value(textureCoords) ); } Vector3 AnimatableVertex::GetCurrentPosition() { Vector3 position; - mMesh.GetProperty( mMesh.GetPropertyIndex(mVertex, POSITION) ).Get(position); + mMesh.GetProperty( mMesh.GetVertexPropertyIndex(mVertex, POSITION) ).Get(position); return position; } Vector4 AnimatableVertex::GetCurrentColor() { Vector4 color; - mMesh.GetProperty( mMesh.GetPropertyIndex(mVertex, COLOR) ).Get(color); + mMesh.GetProperty( mMesh.GetVertexPropertyIndex(mVertex, COLOR) ).Get(color); return color; } Vector2 AnimatableVertex::GetCurrentTextureCoords() { Vector2 textureCoords; - mMesh.GetProperty( mMesh.GetPropertyIndex(mVertex, TEXTURE_COORDS) ).Get(textureCoords); + mMesh.GetProperty( mMesh.GetVertexPropertyIndex(mVertex, TEXTURE_COORDS) ).Get(textureCoords); return textureCoords; } -- 2.7.4