Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 571650 - =x11-misc/xplanet-1.3.0-r1[gif] with giflib:0/7: error: too few arguments to function ‘EGifCloseFile’
Summary: =x11-misc/xplanet-1.3.0-r1[gif] with giflib:0/7: error: too few arguments to ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Desktop Misc. Team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: giflib-5
  Show dependency tree
 
Reported: 2016-01-12 12:12 UTC by Bernard Cafarelli
Modified: 2016-04-11 05:41 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,30.61 KB, text/plain)
2016-01-12 12:12 UTC, Bernard Cafarelli
Details
Patch that should support all versions (xplanet-1.3.0-giflib.patch,25.63 KB, patch)
2016-03-11 13:42 UTC, Bernard Cafarelli
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bernard Cafarelli gentoo-dev 2016-01-12 12:12:56 UTC
Created attachment 422662 [details]
build.log

gif.c:182:9: error: too few arguments to function ‘DGifCloseFile’
     if (DGifCloseFile(GifFile) == GIF_ERROR) {
         ^
In file included from gif.c:25:0:
/usr/include/gif_lib.h:183:9: note: declared here
     int DGifCloseFile(GifFileType * GifFile, int *ErrorCode);
         ^
gif.c: In function ‘QuitGifError’:
gif.c:496:26: error: too few arguments to function ‘EGifCloseFile’
     if (GifFile != NULL) EGifCloseFile(GifFile);
                          ^
In file included from gif.c:25:0:
/usr/include/gif_lib.h:132:5: note: declared here
 int EGifCloseFile(GifFileType *GifFile, int *ErrorCode);
     ^
gif.c: In function ‘write_gif’:
gif.c:592:9: error: too few arguments to function ‘EGifCloseFile’
     if (EGifCloseFile(GifFile) == GIF_ERROR)
         ^
In file included from gif.c:25:0:
/usr/include/gif_lib.h:132:5: note: declared here
 int EGifCloseFile(GifFileType *GifFile, int *ErrorCode);
     ^

giflib-5.1 added an error code parameter to these 2 functions:
http://sourceforge.net/p/giflib/code/ci/116179a7d4681dda9afcdd43b5fbfb391b44918b/tree/doc/gif_lib.xml?diff=8408b09b69e5ce836d01a29e05c626ffa55cffaa

Also:
png.c: In function ‘read_png’:
png.c:143:13: warning: implicit declaration of function ‘memcpy’ [-Wimplicit-function-declaration]
             memcpy(ptr, row_pointers[i], 3 * *width);
             ^
png.c:143:13: warning: incompatible implicit declaration of built-in function ‘memcpy’
png.c:143:13: note: include ‘<string.h>’ or provide a declaration of ‘memcpy’
Comment 1 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2016-01-12 12:49:29 UTC
There's this commit in upstream's svn repo:

http://sourceforge.net/p/xplanet/code/186/

which is tagged as "update gif code to 5.0.0"
Comment 2 Bernard Cafarelli gentoo-dev 2016-01-14 13:02:12 UTC
The *GifCloseFile are an additional change in 5.1 (1.3.0-r1 has the patch to support 5.0)

FreeBSD patch was update to support 5.1 (with proper #ifdef):
http://svnweb.freebsd.org/ports/head/astro/xplanet/files/patch-src_libimage_gif.c?revision=401388

Working fine here with system 5.1 :)
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2016-01-16 11:04:19 UTC
(In reply to Bernard Cafarelli from comment #2)
> The *GifCloseFile are an additional change in 5.1 (1.3.0-r1 has the patch to
> support 5.0)
> 
> FreeBSD patch was update to support 5.1 (with proper #ifdef):
> http://svnweb.freebsd.org/ports/head/astro/xplanet/files/patch-
> src_libimage_gif.c?revision=401388
> 
> Working fine here with system 5.1 :)

But it's broken with giflib 4.1.6.
Comment 4 Bernard Cafarelli gentoo-dev 2016-03-11 13:42:58 UTC
Created attachment 427952 [details, diff]
Patch that should support all versions

I updated the current Gentoo patch to handle the 5.1 case. It looks quite different (I used unified diff), but the changes are in fact limited to:
% diff -Naur /var/tmp/portage/x11-misc/xplanet-1.3.0-r1/work/xplanet-1.3.0/src/libimage/gif.c ~/xplanet-1.3.0/src/libimage/gif.c
--- /var/tmp/portage/x11-misc/xplanet-1.3.0-r1/work/xplanet-1.3.0/src/libimage/gif.c	2016-03-11 11:17:28.731270651 +0100
+++ /home/voyageur/xplanet-1.3.0/src/libimage/gif.c	2016-03-11 11:15:30.285427606 +0100
@@ -178,8 +178,11 @@
 	    *BufferP++ = ColorMapEntry->Blue;
 	}
     }
-    
+#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 
+    if (DGifCloseFile(GifFile, NULL) == GIF_ERROR) {
+#else
     if (DGifCloseFile(GifFile) == GIF_ERROR) {
+#endif
 	return(0);
     }
 
@@ -493,7 +496,11 @@
 static void QuitGifError(GifFileType *GifFile)
 {
     fprintf(stderr, "Error writing GIF file\n");
+#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 
+    if (GifFile != NULL) EGifCloseFile(GifFile, NULL);
+#else
     if (GifFile != NULL) EGifCloseFile(GifFile);
+#endif
 }
 
 int 
@@ -589,7 +596,11 @@
 	Ptr += width;
     }
 
+#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 
+    if (EGifCloseFile(GifFile, NULL) == GIF_ERROR)
+#else
     if (EGifCloseFile(GifFile) == GIF_ERROR)
+#endif
 
     {
 	QuitGifError(GifFile);
Comment 5 Ludovic Bellier 2016-03-28 12:51:33 UTC
Same problem here, solved by the Bernard Cafarelli's patch.

Thank's Bernard.

Could you push a new xplanet-1.3.0-r2 version?
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2016-04-11 05:41:06 UTC
Fixed in 1.3.1.