ports/181145: [PATCH] games/xrobots: fix build with clang

Dmitry Marakasov amdmi3 at amdmi3.ru
Thu Aug 8 15:20:02 UTC 2013


>Number:         181145
>Category:       ports
>Synopsis:       [PATCH] games/xrobots: fix build with clang
>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:   Thu Aug 08 15:20:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Dmitry Marakasov
>Release:        FreeBSD 9.1-RELEASE-p4 amd64
>Organization:
>Environment:
System: FreeBSD hades.panopticon 9.1-RELEASE-p4 FreeBSD 9.1-RELEASE-p4 #0 r251956: Tue Jun 18 21:41:37 MSK
>Description:
- Add bunch of patches to make it compile with clang
- Rename old patches according to porter's handbook patch naming guidelines
- Silence REINPLACE_CMD

Port maintainer (edwin at mavetju.org) is cc'd.

Generated with FreeBSD Port Tools 0.99_8 (mode: change, diff: SVN)
>How-To-Repeat:
>Fix:

--- xrobots-1.0_3.patch begins here ---
Index: Makefile
===================================================================
--- Makefile	(revision 324396)
+++ Makefile	(working copy)
@@ -20,7 +20,7 @@
 	${INSTALL} -c -g games -m 664 ${FILESDIR}/xrobotscores ${PREFIX}/lib/X11
 
 post-patch:
-	${REINPLACE_CMD} -e 's|__PREFIX__|${PREFIX}|g' \
+	@${REINPLACE_CMD} -e 's|__PREFIX__|${PREFIX}|g' \
 		${WRKSRC}/xrobots.man ${WRKSRC}/Imakefile
 
 .include <bsd.port.mk>
Index: files/patch-aa
===================================================================
--- files/patch-aa	(revision 324396)
+++ files/patch-aa	(working copy)
@@ -1,91 +0,0 @@
-*** score.c.orig	Thu Jan 22 09:58:52 1998
---- score.c	Sun Apr 12 14:00:32 1998
-***************
-*** 56,61 ****
---- 56,62 ----
-  
-  #include <X11/Xos.h>	/* brings in <sys/file.h> */
-  #include <stdio.h>
-+ #include <stdlib.h>
-  #include "xrobots.h"
-  
-  /*----------------------------------------------------------------------*/
-***************
-*** 67,73 ****
-  
-  static SCORE scores[MAXSCORES];
-  
-! void 	show_scores(),   
-  	write_out_scores();
-  	
-  static void new_high_score(),
---- 68,74 ----
-  
-  static SCORE scores[MAXSCORES];
-  
-! static void 	show_scores(),   
-  	write_out_scores();
-  	
-  static void new_high_score(),
-***************
-*** 110,121 ****
-  #ifndef SYSV
-    flock(scorefile->_file, LOCK_EX);
-  #endif
-!   while( fgets(scores[i].score,6,scorefile) 	/* get score */
-!       && fgets(scores[i].name,26,scorefile) 	/* get name */
-!       && fgetc(scorefile))			/* and newline */
-!   {
-!     i++;
-!     if( i > MAXSCORES ) break;
-    }
-  }
-  
---- 111,123 ----
-  #ifndef SYSV
-    flock(scorefile->_file, LOCK_EX);
-  #endif
-!   for(i = 0; i < MAXSCORES; i++) {
-!     if(!fgets(scores[i].score, 6, scorefile)) 	/* get score */
-!       break;
-!     if(!fgets(scores[i].name, 26, scorefile)) 	/* get name */
-!       break;
-!     if(!fgetc(scorefile))			/* and newline */
-!       break;
-    }
-  }
-  
-***************
-*** 194,200 ****
-  
-  
-  /*ARGSUSED*/
-! static XtCallbackProc 
-  popdown_callback(w, closure, call_data)
-    Widget w;
-    caddr_t closure;
---- 196,202 ----
-  
-  
-  /*ARGSUSED*/
-! static void
-  popdown_callback(w, closure, call_data)
-    Widget w;
-    caddr_t closure;
-***************
-*** 253,259 ****
-  show_scores()
-  {
-    int i;
-!   char tmp_str[31];
-    Arg tmp_arg;
-  
-    for(i = 0;i<MAXSCORES;i++) {
---- 255,261 ----
-  show_scores()
-  {
-    int i;
-!   char tmp_str[64];
-    Arg tmp_arg;
-  
-    for(i = 0;i<MAXSCORES;i++) {
Index: files/patch-ab
===================================================================
--- files/patch-ab	(revision 324396)
+++ files/patch-ab	(working copy)
@@ -1,14 +0,0 @@
-*** xrobots.h.orig	Fri Nov 17 14:37:40 1989
---- xrobots.h	Mon Jan  2 22:47:56 1995
-***************
-*** 146,154 ****
-  		game_active,
-  		sonic_used;
-  
-- #define MIN(a,b) ((a<b)?a:b)
-- #define MAX(a,b) ((a>b)?a:b)
-- 
-  #define INXRANGE( _x_ )  (((_x_) >=0) && ((_x_)<MAXX))
-  #define INYRANGE( _y_ )  (((_y_) >=0) && ((_y_)<MAXY))
-  
---- 146,151 ----
Index: files/patch-ac
===================================================================
--- files/patch-ac	(revision 324396)
+++ files/patch-ac	(working copy)
@@ -1,18 +0,0 @@
---- Imakefile.orig	Fri Jan 23 01:14:38 1998
-+++ Imakefile	Sat Dec  8 13:20:22 2001
-@@ -1,5 +1,5 @@
- 
--     SCORE_FILE = -DSCORE_FILE=\"./xrobotscores\"
-+     SCORE_FILE = -DSCORE_FILE=\"__PREFIX__/lib/X11/xrobotscores\"
-       MAXSCORES = -DMAXSCORES=20
-            MAXX = -DMAXX=35
-            MAXY = -DMAXY=20
-@@ -14,6 +14,8 @@
-   SYS_LIBRARIES = -lm
- 
- all:: xrobots
-+MANSUFFIX=6
-+INSTPGMFLAGS = -s -g games -m 2755
- 
- ComplexProgramTarget(xrobots)
- /*
Index: files/patch-actions.c
===================================================================
--- files/patch-actions.c	(revision 0)
+++ files/patch-actions.c	(working copy)
@@ -0,0 +1,38 @@
+--- actions.c.orig	1989-11-18 01:37:37.000000000 +0300
++++ actions.c	2013-08-07 21:19:04.174230878 +0400
+@@ -58,7 +58,7 @@
+ }
+ 
+ /*ARGSUSED*/
+-XtActionProc
++void
+ do_nothing_action(w,event,params,num_params)
+   Widget w;
+   XEvent *event;
+@@ -155,7 +155,7 @@
+ 
+ 
+ /*ARGSUSED*/
+-XtActionProc
++void
+ move_action(w,event,params,num_params)
+   Widget w;
+   XButtonEvent *event;
+@@ -197,7 +197,7 @@
+ 
+ 
+ /*ARGSUSED*/
+-XtActionProc
++void
+ jump_action(w,event,params,num_params)
+   Widget w;
+   XButtonEvent *event;
+@@ -246,7 +246,7 @@
+ 
+ 
+ /*ARGSUSED*/
+-XtActionProc
++void
+ go_here_action(w,event,params,num_params)
+   Widget w;
+   XButtonEvent *event;

Property changes on: files/patch-actions.c
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: files/patch-main.c
===================================================================
--- files/patch-main.c	(revision 324396)
+++ files/patch-main.c	(working copy)
@@ -1,6 +1,17 @@
---- main.c.orig	Thu Jan 22 06:34:05 1998
-+++ main.c	Sat Feb 28 03:53:04 2004
-@@ -170,25 +170,25 @@
+--- main.c.orig	1998-01-22 17:34:05.000000000 +0300
++++ main.c	2013-08-07 21:22:35.021712665 +0400
+@@ -55,6 +55,10 @@
+ #endif
+ 
+ 
++#include <stdio.h>
++#include <stdlib.h>
++#include <unistd.h>
++
+ #include "xrobots.h"
+ 
+ #define srandom srand
+@@ -170,31 +174,31 @@
  	{"-scorefile","scorefile",XrmoptionSepArg, NULL },
  };
  
@@ -36,11 +47,17 @@
  };
  
  /*----------------------------------------------------------------------*/
-@@ -205,6 +205,16 @@
- 	 new_game_command;
  
+ main(argc, argv)
+-  unsigned int argc;
++  int argc;
+   char **argv;
+ {
+   Arg args[1];
+@@ -206,6 +210,16 @@
+ 
    srandom(getpid());
-+
+ 
 +  application_resources[0].resource_offset=(Cardinal)&fg;
 +  application_resources[1].resource_offset=(Cardinal)&bg;
 +  application_resources[2].resource_offset=(Cardinal)&spiffy;
@@ -50,6 +67,7 @@
 +  application_resources[6].resource_offset=(Cardinal)&diewaiting;
 +  application_resources[7].resource_offset=(Cardinal)&translations;
 +  application_resources[8].resource_offset=(Cardinal)&score_filename;
- 
++
    top_shell = XtInitialize(argv[0], "xrobots", options, XtNumber(options),
    (int *)&argc, argv);
+   XtSetValues(top_shell, arglisttop_shell, XtNumber(arglisttop_shell));
Index: files/patch-xrobots.h
===================================================================
--- files/patch-xrobots.h	(revision 324359)
+++ files/patch-xrobots.h	(working copy)
@@ -1,14 +1,21 @@
-*** xrobots.h.orig	Fri Nov 17 14:37:40 1989
---- xrobots.h	Mon Jan  2 22:47:56 1995
-***************
-*** 146,154 ****
-  		game_active,
-  		sonic_used;
-  
-- #define MIN(a,b) ((a<b)?a:b)
-- #define MAX(a,b) ((a>b)?a:b)
-- 
-  #define INXRANGE( _x_ )  (((_x_) >=0) && ((_x_)<MAXX))
-  #define INYRANGE( _y_ )  (((_y_) >=0) && ((_y_)<MAXY))
-  
---- 146,151 ----
+--- xrobots.h.orig	1989-11-18 01:37:40.000000000 +0300
++++ xrobots.h	2013-08-07 21:19:30.782262446 +0400
+@@ -80,7 +80,7 @@
+ extern void 		sonic_action(),
+ 			reset_sonic_button();
+ 
+-extern XtActionProc	do_nothing_action(),
++extern void	do_nothing_action(),
+ 			move_action(),
+ 			jump_action(),
+ 			go_here_action();
+@@ -146,9 +146,6 @@
+ 		game_active,
+ 		sonic_used;
+ 
+-#define MIN(a,b) ((a<b)?a:b)
+-#define MAX(a,b) ((a>b)?a:b)
+-
+ #define INXRANGE( _x_ )  (((_x_) >=0) && ((_x_)<MAXX))
+ #define INYRANGE( _y_ )  (((_y_) >=0) && ((_y_)<MAXY))
+ 
--- xrobots-1.0_3.patch ends here ---

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


More information about the freebsd-ports-bugs mailing list