1 |
commit: ce2c932b8a8af3e40d0ed68289b5b10525ef3668 |
2 |
Author: Bernard Cafarelli <voyageur <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Dec 21 09:10:23 2021 +0000 |
4 |
Commit: Bernard Cafarelli <voyageur <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Dec 21 09:10:23 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ce2c932b |
7 |
|
8 |
x11-misc/xplanet: fix compilation with clang |
9 |
|
10 |
Closes: https://bugs.gentoo.org/742761 |
11 |
Package-Manager: Portage-3.0.30, Repoman-3.0.3 |
12 |
Signed-off-by: Bernard Cafarelli <voyageur <AT> gentoo.org> |
13 |
|
14 |
.../files/xplanet-1.3.1-narrowing_conversion.patch | 87 ++++++++++++++++++++++ |
15 |
x11-misc/xplanet/xplanet-1.3.1-r2.ebuild | 1 + |
16 |
2 files changed, 88 insertions(+) |
17 |
|
18 |
diff --git a/x11-misc/xplanet/files/xplanet-1.3.1-narrowing_conversion.patch b/x11-misc/xplanet/files/xplanet-1.3.1-narrowing_conversion.patch |
19 |
new file mode 100644 |
20 |
index 000000000000..ebf090f30bcd |
21 |
--- /dev/null |
22 |
+++ b/x11-misc/xplanet/files/xplanet-1.3.1-narrowing_conversion.patch |
23 |
@@ -0,0 +1,87 @@ |
24 |
+diff -Naur xplanet-1.3.1.orig/src/readConfig.cpp xplanet-1.3.1/src/readConfig.cpp |
25 |
+--- xplanet-1.3.1.orig/src/readConfig.cpp 2013-02-16 20:37:47.000000000 +0100 |
26 |
++++ xplanet-1.3.1/src/readConfig.cpp 2021-12-21 10:06:22.434195435 +0100 |
27 |
+@@ -46,10 +46,10 @@ |
28 |
+ { |
29 |
+ case ARC_COLOR: |
30 |
+ { |
31 |
+- int r, g, b; |
32 |
+- if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) |
33 |
++ unsigned char r, g, b; |
34 |
++ if (sscanf(returnString, "%hhu,%hhu,%hhu", &r, &g, &b) == 3) |
35 |
+ { |
36 |
+- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; |
37 |
++ unsigned char color[3] = { r, g, b }; |
38 |
+ currentProperties->ArcColor(color); |
39 |
+ } |
40 |
+ else |
41 |
+@@ -176,10 +176,10 @@ |
42 |
+ break; |
43 |
+ case COLOR: |
44 |
+ { |
45 |
+- int r, g, b; |
46 |
+- if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) |
47 |
++ unsigned char r, g, b; |
48 |
++ if (sscanf(returnString, "%hhu,%hhu,%hhu", &r, &g, &b) == 3) |
49 |
+ { |
50 |
+- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; |
51 |
++ unsigned char color[3] = { r, g, b }; |
52 |
+ currentProperties->Color(color); |
53 |
+ } |
54 |
+ else |
55 |
+@@ -241,10 +241,10 @@ |
56 |
+ break; |
57 |
+ case GRID_COLOR: |
58 |
+ { |
59 |
+- int r, g, b; |
60 |
+- if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) |
61 |
++ unsigned char r, g, b; |
62 |
++ if (sscanf(returnString, "%hhu,%hhu,%hhu", &r, &g, &b) == 3) |
63 |
+ { |
64 |
+- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; |
65 |
++ unsigned char color[3] = { r, g, b }; |
66 |
+ currentProperties->GridColor(color); |
67 |
+ } |
68 |
+ else |
69 |
+@@ -293,10 +293,10 @@ |
70 |
+ break; |
71 |
+ case MARKER_COLOR: |
72 |
+ { |
73 |
+- int r, g, b; |
74 |
+- if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) |
75 |
++ unsigned char r, g, b; |
76 |
++ if (sscanf(returnString, "%hhu,%hhu,%hhu", &r, &g, &b) == 3) |
77 |
+ { |
78 |
+- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; |
79 |
++ unsigned char color[3] = { r, g, b }; |
80 |
+ currentProperties->MarkerColor(color); |
81 |
+ } |
82 |
+ else |
83 |
+@@ -400,10 +400,10 @@ |
84 |
+ break; |
85 |
+ case ORBIT_COLOR: |
86 |
+ { |
87 |
+- int r, g, b; |
88 |
+- if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) |
89 |
++ unsigned char r, g, b; |
90 |
++ if (sscanf(returnString, "%hhu,%hhu,%hhu", &r, &g, &b) == 3) |
91 |
+ { |
92 |
+- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; |
93 |
++ unsigned char color[3] = { r, g, b }; |
94 |
+ currentProperties->OrbitColor(color); |
95 |
+ } |
96 |
+ else |
97 |
+@@ -470,10 +470,10 @@ |
98 |
+ break; |
99 |
+ case TEXT_COLOR: |
100 |
+ { |
101 |
+- int r, g, b; |
102 |
+- if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) |
103 |
++ unsigned char r, g, b; |
104 |
++ if (sscanf(returnString, "%hhu,%hhu,%hhu", &r, &g, &b) == 3) |
105 |
+ { |
106 |
+- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; |
107 |
++ unsigned char color[3] = { r, g, b }; |
108 |
+ currentProperties->TextColor(color); |
109 |
+ } |
110 |
+ else |
111 |
|
112 |
diff --git a/x11-misc/xplanet/xplanet-1.3.1-r2.ebuild b/x11-misc/xplanet/xplanet-1.3.1-r2.ebuild |
113 |
index ac79390deb72..581d092126e2 100644 |
114 |
--- a/x11-misc/xplanet/xplanet-1.3.1-r2.ebuild |
115 |
+++ b/x11-misc/xplanet/xplanet-1.3.1-r2.ebuild |
116 |
@@ -40,6 +40,7 @@ BDEPEND=" |
117 |
|
118 |
PATCHES=( |
119 |
"${FILESDIR}"/${P}-giflib.patch |
120 |
+ "${FILESDIR}"/${P}-narrowing_conversion.patch |
121 |
"${FILESDIR}"/${P}-remove-null-comparison.patch |
122 |
"${FILESDIR}"/${P}-freetype_pkgconfig.patch #788136 |
123 |
) |