diff options
author | Bernard Cafarelli <voyageur@gentoo.org> | 2021-12-21 10:10:23 +0100 |
---|---|---|
committer | Bernard Cafarelli <voyageur@gentoo.org> | 2021-12-21 10:10:23 +0100 |
commit | ce2c932b8a8af3e40d0ed68289b5b10525ef3668 (patch) | |
tree | 9d4294d1a2617b0fb66dfab2d8954c641cd0734e /x11-misc/xplanet | |
parent | x11-misc/xplanet: add myself to maintainers (diff) | |
download | gentoo-ce2c932b8a8af3e40d0ed68289b5b10525ef3668.tar.gz gentoo-ce2c932b8a8af3e40d0ed68289b5b10525ef3668.tar.bz2 gentoo-ce2c932b8a8af3e40d0ed68289b5b10525ef3668.zip |
x11-misc/xplanet: fix compilation with clang
Closes: https://bugs.gentoo.org/742761
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Bernard Cafarelli <voyageur@gentoo.org>
Diffstat (limited to 'x11-misc/xplanet')
-rw-r--r-- | x11-misc/xplanet/files/xplanet-1.3.1-narrowing_conversion.patch | 87 | ||||
-rw-r--r-- | x11-misc/xplanet/xplanet-1.3.1-r2.ebuild | 1 |
2 files changed, 88 insertions, 0 deletions
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 new file mode 100644 index 000000000000..ebf090f30bcd --- /dev/null +++ b/x11-misc/xplanet/files/xplanet-1.3.1-narrowing_conversion.patch @@ -0,0 +1,87 @@ +diff -Naur xplanet-1.3.1.orig/src/readConfig.cpp xplanet-1.3.1/src/readConfig.cpp +--- xplanet-1.3.1.orig/src/readConfig.cpp 2013-02-16 20:37:47.000000000 +0100 ++++ xplanet-1.3.1/src/readConfig.cpp 2021-12-21 10:06:22.434195435 +0100 +@@ -46,10 +46,10 @@ + { + case ARC_COLOR: + { +- int r, g, b; +- if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) ++ unsigned char r, g, b; ++ if (sscanf(returnString, "%hhu,%hhu,%hhu", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { r, g, b }; + currentProperties->ArcColor(color); + } + else +@@ -176,10 +176,10 @@ + break; + case COLOR: + { +- int r, g, b; +- if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) ++ unsigned char r, g, b; ++ if (sscanf(returnString, "%hhu,%hhu,%hhu", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { r, g, b }; + currentProperties->Color(color); + } + else +@@ -241,10 +241,10 @@ + break; + case GRID_COLOR: + { +- int r, g, b; +- if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) ++ unsigned char r, g, b; ++ if (sscanf(returnString, "%hhu,%hhu,%hhu", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { r, g, b }; + currentProperties->GridColor(color); + } + else +@@ -293,10 +293,10 @@ + break; + case MARKER_COLOR: + { +- int r, g, b; +- if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) ++ unsigned char r, g, b; ++ if (sscanf(returnString, "%hhu,%hhu,%hhu", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { r, g, b }; + currentProperties->MarkerColor(color); + } + else +@@ -400,10 +400,10 @@ + break; + case ORBIT_COLOR: + { +- int r, g, b; +- if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) ++ unsigned char r, g, b; ++ if (sscanf(returnString, "%hhu,%hhu,%hhu", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { r, g, b }; + currentProperties->OrbitColor(color); + } + else +@@ -470,10 +470,10 @@ + break; + case TEXT_COLOR: + { +- int r, g, b; +- if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) ++ unsigned char r, g, b; ++ if (sscanf(returnString, "%hhu,%hhu,%hhu", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { r, g, b }; + currentProperties->TextColor(color); + } + else diff --git a/x11-misc/xplanet/xplanet-1.3.1-r2.ebuild b/x11-misc/xplanet/xplanet-1.3.1-r2.ebuild index ac79390deb72..581d092126e2 100644 --- a/x11-misc/xplanet/xplanet-1.3.1-r2.ebuild +++ b/x11-misc/xplanet/xplanet-1.3.1-r2.ebuild @@ -40,6 +40,7 @@ BDEPEND=" PATCHES=( "${FILESDIR}"/${P}-giflib.patch + "${FILESDIR}"/${P}-narrowing_conversion.patch "${FILESDIR}"/${P}-remove-null-comparison.patch "${FILESDIR}"/${P}-freetype_pkgconfig.patch #788136 ) |