8144858: HBShaper.c does not compiler with VS2010
authorprr
Thu, 10 Dec 2015 12:51:08 -0800
changeset 34813 b3a2fa246c32
parent 34812 276e466f4636
child 34814 09435f7f0013
8144858: HBShaper.c does not compiler with VS2010 Reviewed-by: serb, simonis
jdk/src/java.desktop/share/native/libfontmanager/HBShaper.c
--- a/jdk/src/java.desktop/share/native/libfontmanager/HBShaper.c	Thu Dec 10 11:46:23 2015 -0800
+++ b/jdk/src/java.desktop/share/native/libfontmanager/HBShaper.c	Thu Dec 10 12:51:08 2015 -0800
@@ -80,15 +80,18 @@
     float scale = 1.0f/64.0f;
     unsigned int* glyphs;
     float* positions;
+    int initialCount, glyphArrayLen, posArrayLen, maxGlyphs, storeadv;
+    unsigned int* indices;
+    jarray glyphArray, posArray, inxArray;
 
     if (!init_JNI_IDs(env)) {
         return 0;
     }
 
-    int initialCount = (*env)->GetIntField(env, gvdata, gvdCountFID);
-    jarray glyphArray =
+    initialCount = (*env)->GetIntField(env, gvdata, gvdCountFID);
+    glyphArray =
        (jarray)(*env)->GetObjectField(env, gvdata, gvdGlyphsFID);
-    jarray posArray =
+    posArray =
         (jarray)(*env)->GetObjectField(env, gvdata, gvdPositionsFID);
 
     if (glyphArray == NULL || posArray == NULL)
@@ -101,9 +104,9 @@
     // and re-invokes layout. I suppose this is expected to be rare
     // because at least in a single threaded case there should be
     // re-use of the same container, but it is a little wasteful/distateful.
-    int glyphArrayLen = (*env)->GetArrayLength(env, glyphArray);
-    int posArrayLen = (*env)->GetArrayLength(env, posArray);
-    int maxGlyphs = glyphCount + initialCount;
+    glyphArrayLen = (*env)->GetArrayLength(env, glyphArray);
+    posArrayLen = (*env)->GetArrayLength(env, posArray);
+    maxGlyphs = glyphCount + initialCount;
     if ((maxGlyphs >  glyphArrayLen) ||
         (maxGlyphs * 2 + 2 >  posArrayLen))
     {
@@ -125,7 +128,7 @@
         x += glyphPos[i].x_advance * scale;
         y += glyphPos[i].y_advance * scale;
     }
-    int storeadv = initialCount+glyphCount;
+    storeadv = initialCount+glyphCount;
     // The final slot in the positions array is important
     // because when the GlyphVector is created from this
     // data it determines the overall advance of the glyphvector
@@ -138,11 +141,10 @@
     (*env)->ReleasePrimitiveArrayCritical(env, glyphArray, glyphs, 0);
     (*env)->ReleasePrimitiveArrayCritical(env, posArray, positions, 0);
     putFloat(env, startPt,positions[(storeadv*2)],positions[(storeadv*2)+1] );
-    jarray inxArray =
+    inxArray =
         (jarray)(*env)->GetObjectField(env, gvdata, gvdIndicesFID);
-    unsigned int* indices =
+    indices =
         (unsigned int*)(*env)->GetPrimitiveArrayCritical(env, inxArray, NULL);
-    int prevCluster = -1;
     for (i = 0; i < glyphCount; i++) {
         int cluster = glyphInfo[i].cluster;
         if (direction == HB_DIRECTION_LTR) {