summaryrefslogtreecommitdiff
path: root/nanosvg/nanosvg.diff
blob: 0f0db20f5c8fb08400243b45b0fdde7fd9a57816 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Index: nanosvg.h
===================================================================
--- nanosvg.h	(revision 12413)
+++ nanosvg.h	(working copy)
@@ -1081,7 +1081,7 @@
 	char* cur = (char*)s;
 	char* end = NULL;
 	double res = 0.0, sign = 1.0;
-	long long intPart = 0, fracPart = 0;
+	double intPart = 0, fracPart = 0;
 	char hasIntPart = 0, hasFracPart = 0;
 
 	// Parse optional sign
@@ -1095,7 +1095,11 @@
 	// Parse integer part
 	if (nsvg__isdigit(*cur)) {
 		// Parse digit sequence
-		intPart = (double)strtoll(cur, &end, 10);
+#ifdef _MSC_VER
+          intPart = (double)_strtoi64(cur, &end, 10);
+#else
+          intPart = (double)strtoll(cur, &end, 10);
+#endif
 		if (cur != end) {
 			res = (double)intPart;
 			hasIntPart = 1;
@@ -1108,7 +1112,11 @@
 		cur++; // Skip '.'
 		if (nsvg__isdigit(*cur)) {
 			// Parse digit sequence
-			fracPart = strtoll(cur, &end, 10);
+#ifdef _MSC_VER
+                        fracPart = (double)_strtoi64(cur, &end, 10);
+#else
+                        fracPart = (double)strtoll(cur, &end, 10);
+#endif
 			if (cur != end) {
 				res += (double)fracPart / pow(10.0, (double)(end - cur));
 				hasFracPart = 1;
@@ -1123,11 +1131,11 @@
 
 	// Parse optional exponent
 	if (*cur == 'e' || *cur == 'E') {
-		int expPart = 0;
+		double expPart = 0;
 		cur++; // skip 'E'
-		expPart = strtol(cur, &end, 10); // Parse digit sequence with sign
+		expPart = (double)strtol(cur, &end, 10); // Parse digit sequence with sign
 		if (cur != end) {
-			res *= pow(10.0, (double)expPart);
+			res *= pow(10.0, expPart);
 		}
 	}
 

Property changes on: nanosvg.h
___________________________________________________________________
Added: eol-style
## -0,0 +1 ##
+native
\ No newline at end of property