[gentoo-commits] repo/gentoo:master commit in: x11-misc/xplanet/, x11-misc/xplanet/files/

2021-12-21 Thread Bernard Cafarelli
commit: ce2c932b8a8af3e40d0ed68289b5b10525ef3668
Author: Bernard Cafarelli  gentoo  org>
AuthorDate: Tue Dec 21 09:10:23 2021 +
Commit: Bernard Cafarelli  gentoo  org>
CommitDate: Tue Dec 21 09:10:23 2021 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ce2c932b

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  gentoo.org>

 .../files/xplanet-1.3.1-narrowing_conversion.patch | 87 ++
 x11-misc/xplanet/xplanet-1.3.1-r2.ebuild   |  1 +
 2 files changed, 88 insertions(+)

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 ..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.0 
+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", , , ) == 3)
++unsigned char r, g, b;
++if (sscanf(returnString, "%hhu,%hhu,%hhu", , , ) == 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", , , ) == 3)
++unsigned char r, g, b;
++if (sscanf(returnString, "%hhu,%hhu,%hhu", , , ) == 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", , , ) == 3)
++unsigned char r, g, b;
++if (sscanf(returnString, "%hhu,%hhu,%hhu", , , ) == 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", , , ) == 3)
++unsigned char r, g, b;
++if (sscanf(returnString, "%hhu,%hhu,%hhu", , , ) == 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", , , ) == 3)
++unsigned char r, g, b;
++if (sscanf(returnString, "%hhu,%hhu,%hhu", , , ) == 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", , , ) == 3)
++unsigned char r, g, b;
++if (sscanf(returnString, "%hhu,%hhu,%hhu", , , ) == 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
 )



[gentoo-commits] repo/gentoo:master commit in: x11-misc/xplanet/, x11-misc/xplanet/files/

2016-04-10 Thread Jeroen Roovers
commit: f1fc7bdbb2ed98129536359ffa9e88331728513e
Author: Jeroen Roovers  gentoo  org>
AuthorDate: Mon Apr 11 05:40:42 2016 +
Commit: Jeroen Roovers  gentoo  org>
CommitDate: Mon Apr 11 05:41:18 2016 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f1fc7bdb

x11-misc/xplanet: Old.

Package-Manager: portage-2.2.28

 x11-misc/xplanet/files/xplanet-1.3.0-giflib.patch | 741 --
 x11-misc/xplanet/xplanet-1.3.0-r1.ebuild  |  78 ---
 2 files changed, 819 deletions(-)

diff --git a/x11-misc/xplanet/files/xplanet-1.3.0-giflib.patch 
b/x11-misc/xplanet/files/xplanet-1.3.0-giflib.patch
deleted file mode 100644
index 193719e..000
--- a/x11-misc/xplanet/files/xplanet-1.3.0-giflib.patch
+++ /dev/null
@@ -1,741 +0,0 @@
-Fixes from upstream SVN, to support giflib-4.2 and giflib-5.
-
-Index: src/libimage/gif.c
-===
 src/libimage/gif.c (revision 184)
-+++ src/libimage/gif.c (revision 186)
-@@ -20,222 +20,581 @@
- 
- #include 
- #include 
-+#include 
- 
- #include 
- 
- /*
--  A lot of this is based on the gif2rgb and rgb2gif codes in the libungif 
--  distribution. 
-+  Based on the gif2rgb and rgb2gif codes in the libgif distribution. 
- */
- 
- int
- read_gif(const char *filename, int *width, int *height, unsigned char **rgb)
- {
--int interlace_offset[] = { 0, 4, 2, 1 };
--int interlace_jump[] = { 8, 8, 4, 2 };
--GifColorType *colormap;
--GifFileType *infile;
--GifRecordType record_type;
--GifRowType *buffer = NULL;
-+int   BackGround = 0;
-+/* The way Interlaced image should be read - offsets and
-+   jumps... */
-+int InterlacedOffset[] = { 0, 4, 2, 1 }; 
-+int InterlacedJumps[] = { 8, 8, 4, 2 };
-+ColorMapObject *ColorMap;
- 
--int i, j;
--int color_index;
--unsigned char *ptr = NULL;
-+int   i, j, Size, Row, Col, Width, Height, ExtCode, Count;
-+GifRecordType RecordType;
-+GifByteType *Extension;
-+GifRowType *ScreenBuffer;
- 
--infile = DGifOpenFileName(filename);
-+GifRowType GifRow;
-+GifColorType *ColorMapEntry;
-+unsigned char *BufferP;
- 
--if (infile == NULL)
-+GifFileType *GifFile;
-+#if GIFLIB_MAJOR >= 5
-+GifFile = DGifOpenFileName(filename, NULL);
-+#else
-+GifFile = DGifOpenFileName(filename);
-+#endif
-+if (GifFile == NULL) {
-+  fprintf(stderr, "Can't open GIF file %s\n", filename);
-+  return(0);
-+}
-+/* (Following comment was probably written on a 286 running under DOS.)  
*/
-+/* Allocate the screen as vector of column of rows. We can't allocate 
the*/
-+/* whole screen at once, as this broken minded CPU can allocate up to
*/
-+/* 64k at a time and our image can be bigger than that:*/
-+/* Note this screen is device independent - it's the screen defined by   
*/
-+/* the GIF file parameters.   
 */
-+if ((ScreenBuffer = (GifRowType *)
-+   malloc(GifFile->SHeight * sizeof(GifRowType))) == NULL)
- {
--PrintGifError();
--return(0);
-+  fprintf(stderr, "Failed to allocate memory required, aborted.");
-+  return(0);
- }
- 
--do
-+Size = GifFile->SWidth * sizeof(GifPixelType);/* Size in bytes one row.*/
-+if ((ScreenBuffer[0] = (GifRowType) malloc(Size)) == NULL) /* First row. 
*/
- {
--if (DGifGetRecordType(infile, _type) == GIF_ERROR) 
--{
--PrintGifError();
--return(0);
-+  fprintf(stderr, "Failed to allocate memory required, aborted.");
-+  return(0);
-+}
-+
-+for (i = 0; i < GifFile->SWidth; i++)  /* Set its color to BackGround. */
-+  ScreenBuffer[0][i] = GifFile->SBackGroundColor;
-+for (i = 1; i < GifFile->SHeight; i++) {
-+  /* Allocate the other rows, and set their color to background too: */
-+  if ((ScreenBuffer[i] = (GifRowType) malloc(Size)) == NULL)
-+  {
-+  fprintf(stderr, "Failed to allocate memory required, aborted.\n");
-+  return(0);
-+  }
-+
-+  memcpy(ScreenBuffer[i], ScreenBuffer[0], Size);
-+}
-+
-+/* Scan the content of the GIF file and load the image(s) in: */
-+do {
-+  if (DGifGetRecordType(GifFile, ) == GIF_ERROR) {
-+  fprintf(stderr, "Can't read GIF file\n");
-+  return(0);
-+  }
-+  switch (RecordType) {
-+  case IMAGE_DESC_RECORD_TYPE:
-+  if (DGifGetImageDesc(GifFile) == GIF_ERROR) {
-+  return(0);
-+  }
-+  Row = GifFile->Image.Top; /* Image Position relative to Screen. */
-+  Col = GifFile->Image.Left;
-+  Width = GifFile->Image.Width;
-+  Height = GifFile->Image.Height;
-+  if (GifFile->Image.Left + GifFile->Image.Width > GifFile->SWidth ||
-+  GifFile->Image.Top + GifFile->Image.Height > GifFile->SHeight) {
-+  return(0);
-+