unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 2f018a03d275dad22bf6bcf0d63832cec5d79d53 2823 bytes (raw)
name: gnu/packages/patches/xplanet-1.3.1-readConfig-fixclang.cpp.patch 	 # note: path name is non-authoritative(*)

 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
 
diff -uNr xplanet-1.3.1/src/readConfig.cpp xplanet-1.3.1.new/src/readConfig.cpp
--- xplanet-1.3.1/src/readConfig.cpp	2013-02-17 01:07:47.000000000 +0530
+++ xplanet-1.3.1.new/src/readConfig.cpp	2020-03-28 22:17:19.919078929 +0530
@@ -4,6 +4,7 @@
 #include <fstream>
 #include <sstream>
 #include <string>
+#include <clocale>
 using namespace std;
 
 #include "body.h"
@@ -20,6 +21,8 @@
 static PlanetProperties *defaultProperties;
 static PlanetProperties *currentProperties;
 
+static inline unsigned char i2b( int x ) { return static_cast<unsigned int>(x) & 0xffU; }
+
 static void
 readConfig(const char *line, PlanetProperties *planetProperties[])
 {
@@ -49,7 +52,7 @@
             int r, g, b;
             if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3)
             {
-                unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff };
+                unsigned char color[3] = { i2b(r), i2b(g), i2b(b) };
                 currentProperties->ArcColor(color);
             }
             else
@@ -179,7 +182,7 @@
             int r, g, b;
             if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3)
             {
-                unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff };
+                unsigned char color[3] = { i2b(r), i2b(g), i2b(b) };
                 currentProperties->Color(color);
             }
             else
@@ -244,7 +247,7 @@
             int r, g, b;
             if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3)
             {
-                unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff };
+                unsigned char color[3] = { i2b(r), i2b(g), i2b(b) };
                 currentProperties->GridColor(color);
             }
             else
@@ -296,7 +299,7 @@
             int r, g, b;
             if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3)
             {
-                unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff };
+                unsigned char color[3] = { i2b(r), i2b(g), i2b(b) };
                 currentProperties->MarkerColor(color);
             }
             else
@@ -403,7 +406,7 @@
             int r, g, b;
             if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3)
             {
-                unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff };
+                unsigned char color[3] = { i2b(r), i2b(g), i2b(b) };
                 currentProperties->OrbitColor(color);
             }
             else
@@ -473,7 +476,7 @@
             int r, g, b;
             if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3)
             {
-                unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff };
+                unsigned char color[3] = { i2b(r), i2b(g), i2b(b) };
                 currentProperties->TextColor(color);
             }
             else

debug log:

solving 2f018a03d2 ...
found 2f018a03d2 in https://yhetil.org/guix-patches/20200330081929.GA7259@tulip/

applying [1/1] https://yhetil.org/guix-patches/20200330081929.GA7259@tulip/
diff --git a/gnu/packages/patches/xplanet-1.3.1-readConfig-fixclang.cpp.patch b/gnu/packages/patches/xplanet-1.3.1-readConfig-fixclang.cpp.patch
new file mode 100644
index 0000000000..2f018a03d2

1:16: trailing whitespace.
 
1:21: trailing whitespace.
 
Checking patch gnu/packages/patches/xplanet-1.3.1-readConfig-fixclang.cpp.patch...
Applied patch gnu/packages/patches/xplanet-1.3.1-readConfig-fixclang.cpp.patch cleanly.
warning: 2 lines add whitespace errors.

index at:
100644 2f018a03d275dad22bf6bcf0d63832cec5d79d53	gnu/packages/patches/xplanet-1.3.1-readConfig-fixclang.cpp.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).