Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Nov 2007 05:06:31 GMT
From:      "Pedro F. Giffuni" <giffunip@tutopia.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/118344: Cleanups to the graphics/urt port
Message-ID:  <200711300506.lAU56Vn0066111@www.freebsd.org>
Resent-Message-ID: <200711300510.lAU5A0D2024853@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         118344
>Category:       ports
>Synopsis:       Cleanups to the graphics/urt port
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 30 05:10:00 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator:     Pedro F. Giffuni
>Release:        6.2-Release
>Organization:
>Environment:
FreeBSD kakumen.cable.net.co 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Fri Jan 12 08:43:30 UTC 2007     root@portnoy.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP  amd64

>Description:
Some, rather minor, fixes:

- Fix for gif2rle (from BRLCAD)
- misc. fixes from the SGI port
- some other warning cleanups and remove a check that was not serving any purpose
>How-To-Repeat:

>Fix:
diff -ruN urt.orig/files/patch-cnv::gif2rle.c urt/files/patch-cnv::gif2rle.c
--- urt.orig/files/patch-cnv::gif2rle.c	Thu Nov 29 10:04:03 2007
+++ urt/files/patch-cnv::gif2rle.c	Thu Nov 29 10:42:28 2007
@@ -1,6 +1,44 @@
---- cnv/giftorle.c.orig	Thu Mar 10 20:04:40 2005
-+++ cnv/giftorle.c	Thu Mar 10 20:07:12 2005
-@@ -278,7 +278,7 @@
+--- cnv/giftorle.c.orig	Mon Oct 18 08:59:37 1993
++++ cnv/giftorle.c	Thu Nov 29 10:42:17 2007
+@@ -21,7 +21,10 @@
+ /* |   don't try to make money off it, or pretend that you wrote it.  | */
+ /* +------------------------------------------------------------------+ */
+ 
++#include	<stdlib.h>
+ #include	<stdio.h>
++#include	<unistd.h>
++
+ #include	"rle.h"
+ 
+ #ifndef lint
+@@ -69,7 +72,7 @@
+ 
+ static int output_colormap = FALSE;
+ 
+-void
++int
+ main(argc,argv)
+ int	argc;
+ char	**argv;
+@@ -96,7 +99,7 @@
+ 
+     while ( nfname-- > 0 )
+ 	(void)ReadGIF( *infname++ );
+-    exit( 0 );
++    return( 0 );
+ }
+ 
+ int
+@@ -203,7 +206,7 @@
+ 	    EasyFail("EOF in extention\n",TRUE);
+ 	if (c == 0)
+ 	    return FALSE;
+-	if (read(fd,buf,(int) c)!=(int) c) 
++	if (read(fileno(fd),buf,(int) c)!=(int) c) 
+ 	    EasyFail("EOF in extention\n",TRUE);
+     }
+ }
+@@ -278,7 +281,7 @@
  	max_code_size = 2*clear_code;
  	max_code = clear_code+2;
  
diff -ruN urt.orig/files/patch-cnv::rlatorle.c urt/files/patch-cnv::rlatorle.c
--- urt.orig/files/patch-cnv::rlatorle.c	Wed Dec 31 19:00:00 1969
+++ urt/files/patch-cnv::rlatorle.c	Thu Nov 29 22:16:54 2007
@@ -0,0 +1,11 @@
+--- cnv/rlatorle.c.orig	Thu Nov 29 22:14:43 2007
++++ cnv/rlatorle.c	Thu Nov 29 22:15:43 2007
+@@ -162,7 +162,7 @@
+        }
+    VPRINTF(stderr, "Channel color space %s\n", head.rla_head.chan);
+    if ( rlb_flag )
+-       VPRINTF(stderr, "Interlaced?         %s\n", head.rlb_head.filter_type);
++       VPRINTF(stderr, "Interlaced?         %hd\n", head.rlb_head.filter_type);
+    else
+        VPRINTF(stderr, "Interlaced?         %s\n", "-unused-");
+    if (do_matte)
diff -ruN urt.orig/files/patch-get::getx11::map_scan.c urt/files/patch-get::getx11::map_scan.c
--- urt.orig/files/patch-get::getx11::map_scan.c	Wed Dec 31 19:00:00 1969
+++ urt/files/patch-get::getx11::map_scan.c	Thu Nov 29 22:31:31 2007
@@ -0,0 +1,11 @@
+--- get/getx11/map_scan.c.orig	Thu Nov 29 22:24:53 2007
++++ get/getx11/map_scan.c	Thu Nov 29 22:26:37 2007
+@@ -2195,7 +2195,7 @@
+     
+     if (!img->divN || !img->modN || !img->dm16 )
+     {
+-	fprintf( stderr, "%s: malloc error getting dither arrays\n");
++	fprintf( stderr, "%s: malloc error getting dither arrays\n", progname);
+ 	exit (1);
+     }
+ }
diff -ruN urt.orig/files/patch-get::getx11::x11_stuff.c urt/files/patch-get::getx11::x11_stuff.c
--- urt.orig/files/patch-get::getx11::x11_stuff.c	Wed Dec 31 19:00:00 1969
+++ urt/files/patch-get::getx11::x11_stuff.c	Thu Nov 29 22:48:51 2007
@@ -0,0 +1,36 @@
+--- get/getx11/x11_stuff.c.orig	Fri May 13 20:05:44 1994
++++ get/getx11/x11_stuff.c	Thu Nov 29 22:48:26 2007
+@@ -40,7 +40,7 @@
+  */
+ #include "getx11.h"
+ #ifdef X_SHARED_MEMORY
+-#include <sys/errno.h>
++#include <errno.h>
+ #endif
+ 
+ #include "circle.bitmap"
+@@ -155,7 +155,6 @@
+ 			IPC_CREAT|0777 );
+ 	    if ( img->shm_img.shmid < 0 )
+ 	    {
+-		extern int errno;
+ 		if ( errno == ENOSPC )
+ 		{
+ 		    if ( !no_shared_space )
+@@ -333,7 +332,7 @@
+     
+     if (( img->pixmap != NULL && reallocate ) ||
+ 	( img->pixmap != NULL && (img->pix_w < iw || img->pix_h < ih ))){
+-	free_X_pixmap( dpy, img->pixmap );
++	free_X_pixmap( img, img->pixmap );
+ 	img->pixmap = NULL;
+     }
+     
+@@ -361,7 +360,6 @@
+ 	    XDestroyImage( image );
+ 	    if ( img->shm_pix.shmid < 0 )
+ 	    {
+-		extern int errno;
+ 		if ( errno == ENOSPC )
+ 		{
+ 		    if ( !no_shared_space )
diff -ruN urt.orig/files/patch-lib-rle_open_f.c urt/files/patch-lib-rle_open_f.c
--- urt.orig/files/patch-lib-rle_open_f.c	Thu Nov 29 10:04:03 2007
+++ urt/files/patch-lib-rle_open_f.c	Thu Nov 29 23:40:42 2007
@@ -1,5 +1,5 @@
---- lib/rle_open_f.c.orig	Thu May 13 21:28:51 1993
-+++ lib/rle_open_f.c	Wed Jan 12 16:06:07 2005
+--- lib/rle_open_f.c.orig	Thu May 13 16:28:51 1993
++++ lib/rle_open_f.c	Thu Nov 29 23:38:49 2007
 @@ -56,6 +56,7 @@
      CONST_DECL char *err_str;
      register char *cp;
@@ -8,15 +8,6 @@
  
  #ifdef STDIO_NEEDS_BINARY
      char mode_string[32];	/* Should be enough. */
-@@ -63,7 +64,7 @@
-     /* Concatenate a 'b' onto the mode. */
-     mode_string[0] = mode[0];
-     mode_string[1] = 'b';
--    strcpy( mode_string + 2, mode + 1 );
-+    strncpy( mode_string + 2, mode + 1, sizeof(mode_string + 2) );
-     mode = mode_string;
- #endif
- 
 @@ -150,7 +151,8 @@
  	else if ( cp > file_name && *cp == '.' && *(cp + 1) == 'Z' )
  	{
@@ -42,3 +33,11 @@
  
  	    fp = my_popen( combuf, mode, &thepid );
  	    free( combuf );
+@@ -256,7 +258,6 @@
+     int pipefd[2];
+     int i;
+     char *argv[4];
+-    extern int errno;
+ 
+     /* Check args. */
+     if ( *mode != 'r' && *mode != 'w' )
diff -ruN urt.orig/files/patch-lib::rle_hdr.c urt/files/patch-lib::rle_hdr.c
--- urt.orig/files/patch-lib::rle_hdr.c	Wed Dec 31 19:00:00 1969
+++ urt/files/patch-lib::rle_hdr.c	Thu Nov 29 22:02:41 2007
@@ -0,0 +1,11 @@
+--- lib/rle_hdr.c.orig	Thu Nov 29 21:57:53 2007
++++ lib/rle_hdr.c	Thu Nov 29 21:59:23 2007
+@@ -269,6 +269,8 @@
+ {
+     rle_hdr *ret_hdr;
+ 
++    if ( rle_dflt_hdr.rle_file == NULL)
++    	rle_dflt_hdr.rle_file = stdout;
+     if ( the_hdr == &rle_dflt_hdr )
+ 	return the_hdr;
+ 
diff -ruN urt.orig/files/patch-lib::scanargs.c urt/files/patch-lib::scanargs.c
--- urt.orig/files/patch-lib::scanargs.c	Thu Nov 29 10:04:03 2007
+++ urt/files/patch-lib::scanargs.c	Thu Nov 29 23:23:49 2007
@@ -1,5 +1,5 @@
---- lib/scanargs.c.orig	Thu Mar 10 21:23:06 2005
-+++ lib/scanargs.c	Thu Mar 10 21:25:26 2005
+--- lib/scanargs.c.orig	Thu Feb 27 16:18:15 1992
++++ lib/scanargs.c	Thu Nov 29 23:22:40 2007
 @@ -128,10 +128,10 @@
  va_list argl;
  {
@@ -13,3 +13,13 @@
      int	    optarg = 0;			/* where optional args start */
      int	    nopt = 0;
      char    tmpflg,			/* temp flag */
+@@ -408,7 +408,8 @@
+ 				 * Copy the string so we remain nondestructive
+ 				 */
+ 				s = NEW( char, strlen(argp)+1 );
+-				strcpy( s, argp );
++				strncpy( s, argp, sizeof(s)-1 );
++				s[sizeof(s) - 1] = '\0';
+ 				argp = s;
+ 
+ 				/* 
diff -ruN urt.orig/files/patch-tools::into.c urt/files/patch-tools::into.c
--- urt.orig/files/patch-tools::into.c	Thu Nov 29 10:04:03 2007
+++ urt/files/patch-tools::into.c	Thu Nov 29 16:20:37 2007
@@ -1,6 +1,6 @@
---- tools/into.c.orig	Thu Apr 30 23:10:15 1992
-+++ tools/into.c	Fri Dec 27 23:23:48 2002
-@@ -41,7 +41,10 @@
+--- tools/into.c.orig	Thu Apr 30 09:10:15 1992
++++ tools/into.c	Thu Nov 29 16:17:55 2007
+@@ -41,9 +41,12 @@
  short forceflg;				/* overwrite an unwritable file? */
  
  extern int errno;
@@ -9,5 +9,17 @@
  extern char *sys_errlist[];
 +#endif
  
- void
+-void
++int
  main(argc, argv)
+ int argc;
+ char **argv;
+@@ -82,7 +85,7 @@
+     }
+     else
+ 	strcpy( buf, temp );
+-    mktemp( buf );
++    mkstemp( buf );
+ 
+     if ( (outf = fopen( buf, "w" )) == NULL )
+     {
diff -ruN urt.orig/files/patch-tools::rleaddcom.c urt/files/patch-tools::rleaddcom.c
--- urt.orig/files/patch-tools::rleaddcom.c	Wed Dec 31 19:00:00 1969
+++ urt/files/patch-tools::rleaddcom.c	Thu Nov 29 16:37:50 2007
@@ -0,0 +1,20 @@
+--- tools/rleaddcom.c.orig	Thu Nov 29 16:12:38 2007
++++ tools/rleaddcom.c	Thu Nov 29 16:25:14 2007
+@@ -60,7 +60,7 @@
+  * Algorithm:
+  *	[None]
+  */
+-void
++int
+ main( argc, argv )
+ int argc;
+ char **argv;
+@@ -118,7 +118,7 @@
+ 	}
+ 	else
+ 	    strcpy( buf, temp );
+-	mktemp( buf );
++	mkstemp( buf );
+ #ifndef NO_OPEN_PIPES
+ 	/* Compressed file special case. */
+ 	cp = i_fname + strlen( i_fname ) - 2;
diff -ruN urt.orig/files/patch-tools::rlecat.c urt/files/patch-tools::rlecat.c
--- urt.orig/files/patch-tools::rlecat.c	Wed Dec 31 19:00:00 1969
+++ urt/files/patch-tools::rlecat.c	Thu Nov 29 16:45:47 2007
@@ -0,0 +1,20 @@
+--- tools/rlecat.c.orig	Thu Nov 29 16:39:51 2007
++++ tools/rlecat.c	Thu Nov 29 16:40:44 2007
+@@ -62,7 +62,7 @@
+  *  	repeat count.  If the collation flag (-c) is specified, then
+  *  	all images will be read before starting to repeat.
+  */
+-void
++int
+ main( argc, argv )
+ int argc;
+ char **argv;
+@@ -110,7 +110,7 @@
+ 	    nflag = 0;		/* Not really repeating! */
+ 	else
+ 	{
+-	    mktemp( temp );	/* Make a temporary file name */
++	    mkstemp( temp );	/* Make a temporary file name */
+ 	    tmpfile = rle_open_f( cmd_name( argv ), temp, "w+" );
+ 	}
+     }


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200711300506.lAU56Vn0066111>