summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvisvgm/dvisvgm-0.8.7-PATCHES/patch-02-libdvisvgm-warnings
blob: 63544c87c7e4f1a9d71929252d6458aeb85f4453 (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
	Various casts to avoid compiler warnings.

diff -ur dvisvgm-0.8.7.orig/src/Color.cpp dvisvgm-0.8.7/src/Color.cpp
--- dvisvgm-0.8.7.orig/src/Color.cpp	2009-11-09 17:36:55.000000000 +0100
+++ dvisvgm-0.8.7/src/Color.cpp	2009-11-13 18:21:01.000000000 +0100
@@ -32,7 +32,7 @@
 
 
 static inline UInt8 float_to_byte (float v) {
-	return floor(255*v+0.5);
+	return (UInt8) (floor(255*v+0.5));
 }
 
 
@@ -101,7 +101,7 @@
 		rgb[0] = rgb[1] = rgb[2] = hsb[2];
 	else {
 		float h = hsb[0]-floor(hsb[0]);
-		int i = 6*h;
+		int i = (int) (6*h);
 		float f =  6*h-i;
 		float p = hsb[2]*(1-hsb[1]);
 		float q = hsb[2]*(1-hsb[1]*f);
diff -ur dvisvgm-0.8.7.orig/src/ColorSpecialHandler.cpp dvisvgm-0.8.7/src/ColorSpecialHandler.cpp
--- dvisvgm-0.8.7.orig/src/ColorSpecialHandler.cpp	2009-11-06 22:17:58.000000000 +0100
+++ dvisvgm-0.8.7/src/ColorSpecialHandler.cpp	2009-11-13 18:21:56.000000000 +0100
@@ -49,7 +49,7 @@
 		rgb[0] = rgb[1] = rgb[2] = hsb[2];
 	else {
 		float h = hsb[0]-floor(hsb[0]);
-		int i = 6*h;
+		int i = (int) (6*h);
 		float f =  6*h-i;
 		float p = hsb[2]*(1-hsb[1]);
 		float q = hsb[2]*(1-hsb[1]*f);
diff -ur dvisvgm-0.8.7.orig/src/FontManager.cpp dvisvgm-0.8.7/src/FontManager.cpp
--- dvisvgm-0.8.7.orig/src/FontManager.cpp	2009-11-06 22:17:58.000000000 +0100
+++ dvisvgm-0.8.7/src/FontManager.cpp	2009-11-13 18:42:59.000000000 +0100
@@ -100,7 +100,7 @@
 
 int FontManager::vfFirstFontNum (VirtualFont *vf) const {
 	VfFirstFontMap::const_iterator it = _vfFirstFontMap.find(vf);
-	return (it == _vfFirstFontMap.end()) ? -1 : it->second;
+	return (it == _vfFirstFontMap.end()) ? -1 : (int) it->second;
 }
 
 
diff -ur dvisvgm-0.8.7.orig/src/PsSpecialHandler.cpp dvisvgm-0.8.7/src/PsSpecialHandler.cpp
--- dvisvgm-0.8.7.orig/src/PsSpecialHandler.cpp	2009-11-09 17:36:55.000000000 +0100
+++ dvisvgm-0.8.7/src/PsSpecialHandler.cpp	2009-11-13 14:12:39.000000000 +0100
@@ -558,8 +558,8 @@
 void PsSpecialHandler::setdash (vector<double> &p) {
 	_dashpattern.clear();
 	for (size_t i=0; i < p.size()-1; i++)
-		_dashpattern.push_back(p[i]*1.00375);
-	_dashoffset = p.back()*1.00375;
+		_dashpattern.push_back((int) (p[i]*1.00375));
+	_dashoffset = (int) (p.back()*1.00375);
 }
 
 
diff -ur dvisvgm-0.8.7.orig/src/PsSpecialHandler.h dvisvgm-0.8.7/src/PsSpecialHandler.h
--- dvisvgm-0.8.7.orig/src/PsSpecialHandler.h	2009-11-09 17:36:55.000000000 +0100
+++ dvisvgm-0.8.7/src/PsSpecialHandler.h	2009-11-13 14:08:37.000000000 +0100
@@ -82,8 +82,8 @@
 		void setdash (std::vector<double> &p);
 		void setgray (std::vector<double> &p);
 		void sethsbcolor (std::vector<double> &hsb);
-		void setlinecap (std::vector<double> &p)     {_linecap = p[0];}
-		void setlinejoin (std::vector<double> &p)    {_linejoin = p[0];}
+		void setlinecap (std::vector<double> &p)     {_linecap = (unsigned int) p[0];}
+		void setlinejoin (std::vector<double> &p)    {_linejoin = (unsigned int) p[0];}
 		void setlinewidth (std::vector<double> &p)   {_linewidth = p[0] ? p[0]*1.00375 : 0.5;}
 		void setmatrix (std::vector<double> &p);
 		void setmiterlimit (std::vector<double> &p)  {_miterlimit = p[0]*1.00375;}
diff -ur dvisvgm-0.8.7.orig/src/TpicSpecialHandler.cpp dvisvgm-0.8.7/src/TpicSpecialHandler.cpp
--- dvisvgm-0.8.7.orig/src/TpicSpecialHandler.cpp	2009-11-06 22:17:58.000000000 +0100
+++ dvisvgm-0.8.7/src/TpicSpecialHandler.cpp	2009-11-13 18:20:12.000000000 +0100
@@ -172,7 +172,7 @@
 		angle1 *= -1;
 		angle2 *= -1;
 		if (fabs(angle1) > PI2) {
-			int n = angle1/PI2;
+			int n = (int) (angle1/PI2);
 			angle1 = angle1 - n*PI2;
 			angle2 = angle2 - n*PI2;
 		}