Change 'char' type to 'signed char'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / renderers / svg / nanosvg / nanosvg.cc
index e52cb15..9643567 100644 (file)
@@ -230,13 +230,25 @@ typedef struct NSVGgradientData
 {
     char id[64];
     char ref[64];
-    char type;
+
+    /**
+     * In the original file, using char type (without signed or unsigned) can be interpreted
+     * as 'unsigned char' in some build environments, like ARM architecture.
+     * To prevent the unexpected behavior, we replace 'char type' with 'signed char type' here.
+     */
+    signed char type;
     union {
         NSVGlinearData linear;
         NSVGradialData radial;
     };
     char spread;
-    char units;
+
+    /**
+     * In the original file, using char type (without signed or unsigned) can be interpreted
+     * as 'unsigned char' in some build environments, like ARM architecture.
+     * To prevent the unexpected behavior, we replace 'char units' with 'signed char units' here.
+     */
+    signed char units;
     float xform[6];
     int nstops;
     NSVGgradientStop* stops;
@@ -643,7 +655,12 @@ static NSVGgradientData* nsvg__findGradientData(NSVGparser* p, const char* id)
     return NULL;
 }
 
-static NSVGgradient* nsvg__createGradient(NSVGparser* p, const char* id, const float* localBounds, char* paintType)
+/**
+ * In the original file, using char type (without signed or unsigned) can be interpreted
+ * as 'unsigned char' in some build environments, like ARM architecture.
+ * To prevent the unexpected behavior, we replace 'char paintType' with 'signed char paintType' here.
+ */
+static NSVGgradient* nsvg__createGradient(NSVGparser* p, const char* id, const float* localBounds, signed char* paintType)
 {
     NSVGattrib* attr = nsvg__getAttr(p);
     NSVGgradientData* data = NULL;