ports/120860: [patch] games/atr3d unbreak fix build on 64 bits platforms + adopt maintainship

Pietro Cerutti gahr at gahr.ch
Tue Feb 19 23:20:03 UTC 2008


>Number:         120860
>Category:       ports
>Synopsis:       [patch] games/atr3d unbreak fix build on 64 bits platforms + adopt maintainship
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 19 23:20:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Pietro Cerutti
>Release:        FreeBSD 8.0-CURRENT i386
>Organization:
>Environment:


System: FreeBSD 8.0-CURRENT #4: Wed Feb 13 18:13:34 CET 2008
    root at gahrtop.localhost:/usr/obj/usr/src/sys/MSI1034



>Description:


It's sad, but there's still people casting void pointers to int...

While at it, fix a few const string deprecated conversions and adopt maintainship


>How-To-Repeat:





>Fix:


--- _atr3d.diff begins here ---
--- /dev/null	2008-02-19 19:11:00.000000000 +0100
+++ files/patch-mainplayerthread.cpp	2008-02-19 19:05:13.000000000 +0100
@@ -0,0 +1,42 @@
+--- mainplayerthread.cpp.orig	2008-02-19 18:54:17.000000000 +0100
++++ mainplayerthread.cpp	2008-02-19 18:59:50.000000000 +0100
+@@ -21,7 +21,7 @@
+ void *MainPlayerThread(void *threadid);
+ void SetupShipSendData(int shipnum, int threadnum, ShipDesc *ShipData);
+ void SetupObjSendData(int objnum, struct ObjectDesc *ObjData);
+-void SendPlayerData(int threadnum);
++void SendPlayerData(size_t threadnum);
+ void SetupStatusSendData(char *GameStatus, int playernum);
+ void TransferData(char *SendData, int *DataSize, int threadnum);
+ 
+@@ -29,10 +29,10 @@
+ void *MainPlayerThread(void *threadid)
+ {
+   int n, rc;
+-  int threadnum;
++  size_t threadnum;
+   pthread_t readthread;
+ 
+-  threadnum=(int)threadid;
++  threadnum=(size_t)threadid;
+ 
+   SendPlayerData(threadnum);
+ 
+@@ -41,7 +41,7 @@
+ 
+ 
+ // Main function which loops and continuously sends data to the player
+-void SendPlayerData(int threadnum)
++void SendPlayerData(size_t threadnum)
+ {
+   int i, j;
+   int DataSize=0;
+@@ -53,7 +53,7 @@
+   while(!StopServer) {
+     pthread_mutex_lock(&ServerLock);
+ #ifdef DEBUG
+-    printf("Main Player Thread %d Awake\n", threadnum);
++    printf("Main Player Thread %zd Awake\n", threadnum);
+ #endif
+     if (!ServerShips[threadnum]) {
+       pthread_mutex_unlock(&ServerLock);
--- /dev/null	2008-02-19 19:11:00.000000000 +0100
+++ files/patch-servergame.cpp	2008-02-19 19:05:29.000000000 +0100
@@ -0,0 +1,11 @@
+--- servergame.cpp.orig	2008-02-19 18:59:58.000000000 +0100
++++ servergame.cpp	2008-02-19 19:03:29.000000000 +0100
+@@ -66,7 +66,7 @@
+ 
+   ServerGameRunning=1;
+ 
+-  threadnum=(int)threadid;
++  threadnum=(size_t)threadid;
+ 
+   pthread_mutex_lock(&ServerLock);
+ 
--- Makefile.orig	2008-02-19 19:20:14.000000000 +0100
+++ Makefile	2008-02-19 19:20:51.000000000 +0100
@@ -13,7 +13,7 @@
 DISTNAME=	${PORTNAME}_source_${PORTVERSION}
 EXTRACT_SUFX=	.tgz
 
-MAINTAINER=	ports at FreeBSD.org
+MAINTAINER=	gahr at gahr.ch
 COMMENT=	3D asteroids-like multiplayer game
 
 LIB_DEPENDS=	openal.0:${PORTSDIR}/audio/openal \
@@ -38,14 +38,6 @@
 CPPFLAGS=	-I${LOCALBASE}/include -I${X11BASE}/include ${PTHREAD_CFLAGS}
 LDFLAGS=	-L${LOCALBASE}/lib -L${X11BASE}/lib ${PTHREAD_LIBS}
 
-.include <bsd.port.pre.mk>
-
-.if ${OSVERSION} >= 700042
-.if ${ARCH} == amd64 || ${ARCH} == sparc64
-BROKEN=		does not compile
-.endif
-.endif
-
 pre-patch:
 	@${PERL} -pi.orig -e 's|^aclocal|${ACLOCAL}|; \
 		s|^autoconf|${AUTOCONF}|; s|^automake|${AUTOMAKE}|' \
@@ -63,4 +55,4 @@
 		's|-lpthread|${PTHREAD_LIBS}|g' \
 		${WRKSRC}/Makefile
 
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
--- /dev/null	2008-02-19 19:36:17.000000000 +0100
+++ files/patch-init.cpp	2008-02-19 19:29:30.000000000 +0100
@@ -0,0 +1,31 @@
+--- init.cpp.orig	2008-02-19 19:27:46.000000000 +0100
++++ init.cpp	2008-02-19 19:29:23.000000000 +0100
+@@ -36,8 +36,8 @@
+ pthread_mutex_t ServerLock;
+ 
+ 
+-void LoadSpec(char *dirname, char *filename);
+-int copyfile(char *ConfDirName, char *FileName);
++void LoadSpec(char *dirname, const char *filename);
++int copyfile(char *ConfDirName, const char *FileName);
+ 
+ 
+ void DoInitializations()
+@@ -115,7 +115,7 @@
+ }
+ 
+ 
+-void LoadSpec(char *dirname, char *filename)
++void LoadSpec(char *dirname, const char *filename)
+ {
+   FILE *fileptr;
+   char entry[80];
+@@ -277,7 +277,7 @@
+ }
+ 
+ 
+-int copyfile(char *ConfDirName, char *FileName)
++int copyfile(char *ConfDirName, const char *FileName)
+ {
+   FILE *oldfd, *newfd;
+   char oldFileName[80], newFileName[80];
--- /dev/null	2008-02-19 19:36:17.000000000 +0100
+++ files/patch-menu.cpp	2008-02-19 19:30:58.000000000 +0100
@@ -0,0 +1,24 @@
+--- menu.cpp.orig	2008-02-19 19:29:51.000000000 +0100
++++ menu.cpp	2008-02-19 19:30:51.000000000 +0100
+@@ -194,8 +194,8 @@
+ 
+   ClearScreen();
+   DrawText(ScreenWidth/2-200, ScreenHeight/2+50,
+-	   "Congratulations, you've made a high score", &Blue, 1);
+-  pos=DrawText(ScreenWidth/2-200, ScreenHeight/2, "Enter Name", &Blue, 1);
++	   (char *)"Congratulations, you've made a high score", &Blue, 1);
++  pos=DrawText(ScreenWidth/2-200, ScreenHeight/2, (char *)"Enter Name", &Blue, 1);
+   DrawRect(pos+17, ScreenHeight/2-2, pos+17, ScreenHeight/2+20,
+ 	   pos+300, ScreenHeight/2+20, pos+300, ScreenHeight/2-2, &DarkGray);
+   pos=DrawText(pos+20, ScreenHeight/2, TextValue, &Red, 1);
+@@ -319,8 +319,8 @@
+   int NumScoresDisplayed;
+   struct Color *TextColor;
+ 
+-  DrawText(20, ScreenHeight-50, "Name", &Blue, 1);
+-  DrawText(ScreenWidth/2, ScreenHeight-50, "Score", &Blue, 1);
++  DrawText(20, ScreenHeight-50, (char *)"Name", &Blue, 1);
++  DrawText(ScreenWidth/2, ScreenHeight-50, (char *)"Score", &Blue, 1);
+ 
+   NumScoresDisplayed=(ScreenHeight-(150+25*NumScoreMenuItems))/25;
+   if (NumScoresDisplayed > NUM_HIGHSCORES) {
--- /dev/null	2008-02-19 19:36:17.000000000 +0100
+++ files/patch-radar.cpp	2008-02-19 19:31:20.000000000 +0100
@@ -0,0 +1,11 @@
+--- radar.cpp.orig	2008-02-19 19:31:03.000000000 +0100
++++ radar.cpp	2008-02-19 19:31:11.000000000 +0100
+@@ -16,7 +16,7 @@
+ {
+   int i;
+ 
+-  DrawText(ScreenWidth/2-12, ScreenHeight/3, "Radar", &Green);
++  DrawText(ScreenWidth/2-12, ScreenHeight/3, (char *)"Radar", &Green);
+   DrawCircle(ScreenWidth/2, ScreenHeight/6, &Green, 64, 0.27, 0);
+ 
+   for (i=0; i<MAX_PLAYERS; i++) {
--- _atr3d.diff ends here ---



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



More information about the freebsd-ports-bugs mailing list