Fix Clang warnings/errors

Fix several build warnings (struct != class, int != size_t) and errors
(variable leng non-POD arrays).

Change-Id: I70b4e784365514303d8954bfcb1f39d7c22c1321
diff --git a/libs/hwui/AmbientShadow.cpp b/libs/hwui/AmbientShadow.cpp
index 923571e..1f5d26c 100644
--- a/libs/hwui/AmbientShadow.cpp
+++ b/libs/hwui/AmbientShadow.cpp
@@ -18,6 +18,7 @@
 
 #include <math.h>
 #include <utils/Log.h>
+#include <utils/Vector.h>
 
 #include "AmbientShadow.h"
 #include "Vertex.h"
@@ -60,10 +61,11 @@
     Vector2 centroid;
     calculatePolygonCentroid(vertices, vertexCount, centroid);
 
-    Vector2 dir[rays];
+    Vector<Vector2> 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 @@
         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);