From 564acf7c9bff822f608cda0d5df0a64a9f9aaefd Mon Sep 17 00:00:00 2001 From: Chris Craik Date: Thu, 2 Jan 2014 16:46:18 -0800 Subject: Fix Clang warnings/errors Fix several build warnings (struct != class, int != size_t) and errors (variable leng non-POD arrays). Change-Id: I70b4e784365514303d8954bfcb1f39d7c22c1321 --- libs/hwui/AmbientShadow.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'libs/hwui/AmbientShadow.cpp') diff --git a/libs/hwui/AmbientShadow.cpp b/libs/hwui/AmbientShadow.cpp index 923571efd541..1f5d26c4dad4 100644 --- a/libs/hwui/AmbientShadow.cpp +++ b/libs/hwui/AmbientShadow.cpp @@ -18,6 +18,7 @@ #include #include +#include #include "AmbientShadow.h" #include "Vertex.h" @@ -60,10 +61,11 @@ void AmbientShadow::createAmbientShadow(const Vector3* vertices, int vertexCount Vector2 centroid; calculatePolygonCentroid(vertices, vertexCount, centroid); - Vector2 dir[rays]; + Vector dir; // TODO: use C++11 unique_ptr + dir.setCapacity(rays); float rayDist[rays]; float rayHeight[rays]; - calculateRayDirections(rays, dir); + calculateRayDirections(rays, dir.editArray()); // Calculate the length and height of the points along the edge. // @@ -105,7 +107,7 @@ void AmbientShadow::createAmbientShadow(const Vector3* vertices, int vertexCount for (int i = 0; i < rays; i++) { Vector2 normal(1.0f, 0.0f); - calculateNormal(rays, i, dir, rayDist, normal); + calculateNormal(rays, i, dir.array(), rayDist, normal); float opacity = strength * (0.5f) / (1 + rayHeight[i] / heightFactor); -- cgit v1.2.3-59-g8ed1b