mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 01:39:16 -04:00
- Convert varargs to stdarg
- Remove BROKEN - Respect CC and CFLAGS - Make portlint happier Approved by: maintainer
This commit is contained in:
parent
d5b6a64e68
commit
4da31eb8be
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=111702
4 changed files with 98 additions and 13 deletions
|
@ -10,7 +10,8 @@ PORTVERSION= 1.13.16
|
||||||
CATEGORIES= games
|
CATEGORIES= games
|
||||||
MASTER_SITES= http://www.giovannelli.it/~gmarco/files/ \
|
MASTER_SITES= http://www.giovannelli.it/~gmarco/files/ \
|
||||||
ftp://ftp.dementia.nu/tetrinet/servers/tetrix/
|
ftp://ftp.dementia.nu/tetrinet/servers/tetrix/
|
||||||
DISTFILES= ${PORTNAME}.${PORTVERSION}.tgz
|
DISTNAME= ${PORTNAME}.${PORTVERSION}
|
||||||
|
EXTRACT_SUFX= .tgz
|
||||||
|
|
||||||
MAINTAINER= gmarco@giovannelli.it
|
MAINTAINER= gmarco@giovannelli.it
|
||||||
COMMENT= An addictive 6 player tetr*s game
|
COMMENT= An addictive 6 player tetr*s game
|
||||||
|
@ -19,17 +20,11 @@ WRKSRC= ${WRKDIR}/tetrinetx-${PORTVERSION}
|
||||||
|
|
||||||
INSTALLDIR= ${PREFIX}/tetrinet-x
|
INSTALLDIR= ${PREFIX}/tetrinet-x
|
||||||
|
|
||||||
.include <bsd.port.pre.mk>
|
|
||||||
|
|
||||||
.if ${OSVERSION} >= 501000
|
|
||||||
BROKEN= "Does not compile"
|
|
||||||
.endif
|
|
||||||
|
|
||||||
do-build:
|
do-build:
|
||||||
(cd ${WRKDIR}/tetrinetx-1.13.16/src && \
|
(cd ${WRKSRC}/src && \
|
||||||
gcc -O2 -fno-strength-reduce -Wall main.c -o ../bin/tetrix.freebsd)
|
${CC} ${CFLAGS} main.c -o ../bin/tetrix.freebsd)
|
||||||
(cd ${WRKDIR}/tetrinetx-1.13.16/contrib/query/src && \
|
(cd ${WRKSRC}/contrib/query/src && \
|
||||||
gcc -O2 -fno-strength-reduce -Wall query.c -o ../../../bin/server-query)
|
${CC} ${CFLAGS} query.c -o ../../../bin/server-query)
|
||||||
|
|
||||||
do-install:
|
do-install:
|
||||||
${MKDIR} ${INSTALLDIR}
|
${MKDIR} ${INSTALLDIR}
|
||||||
|
@ -48,6 +43,5 @@ post-install:
|
||||||
@${ECHO} "Please modify configuration files located in ${INSTALLDIR}"
|
@${ECHO} "Please modify configuration files located in ${INSTALLDIR}"
|
||||||
@${ECHO} "before attempting to run Tetrinet server"
|
@${ECHO} "before attempting to run Tetrinet server"
|
||||||
@${ECHO} ""
|
@${ECHO} ""
|
||||||
@${ECHO} ""
|
|
||||||
|
|
||||||
.include <bsd.port.post.mk>
|
.include <bsd.port.mk>
|
||||||
|
|
53
games/tetrinet-x/files/patch-src::main.c
Normal file
53
games/tetrinet-x/files/patch-src::main.c
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
--- src/main.c.orig Thu Dec 24 06:24:50 1998
|
||||||
|
+++ src/main.c Thu Jun 17 10:06:39 2004
|
||||||
|
@@ -319,12 +319,10 @@
|
||||||
|
|
||||||
|
/* lvprintf( priority, same as printf ) - Logs to the log IF priority is smaller */
|
||||||
|
/* or equal to game.verbose */
|
||||||
|
-void lvprintf(va_alist)
|
||||||
|
-va_dcl
|
||||||
|
+void lvprintf(int priority, char *format, ...)
|
||||||
|
{ /* No bounds checking. Be very careful what you log */
|
||||||
|
- char *format; va_list va; static char SBUF2[768];int priority;
|
||||||
|
- va_start(va);
|
||||||
|
- priority=va_arg(va,int);format=va_arg(va,char *);
|
||||||
|
+ va_list va; static char SBUF2[768];
|
||||||
|
+ va_start(va, format);
|
||||||
|
vsprintf(SBUF2,format,va);
|
||||||
|
if (strlen(SBUF2)>512)
|
||||||
|
{
|
||||||
|
@@ -338,15 +336,14 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
/* lprintf( same as printf ) - Logs to the log. */
|
||||||
|
-void lprintf(va_alist)
|
||||||
|
-va_dcl
|
||||||
|
+void lprintf(char *format, ...)
|
||||||
|
{ /* No bounds checking. Be very careful what you log */
|
||||||
|
- char *format; va_list va; static char SBUF2[768];
|
||||||
|
+ va_list va; static char SBUF2[768];
|
||||||
|
FILE *file_out;
|
||||||
|
char *mytime;
|
||||||
|
char *P;
|
||||||
|
time_t cur_time;
|
||||||
|
- va_start(va);
|
||||||
|
+ va_start(va, format);
|
||||||
|
format=va_arg(va,char *);
|
||||||
|
vsprintf(SBUF2,format,va);
|
||||||
|
if (strlen(SBUF2)>512)
|
||||||
|
@@ -2462,7 +2459,7 @@
|
||||||
|
/* Winlist - Returns Winlist */
|
||||||
|
if (!strcasecmp(buf,"getwinlist"))
|
||||||
|
{
|
||||||
|
- lvprintf("%s: GetWinlist request\n",n->host);
|
||||||
|
+ lprintf("%s: GetWinlist request\n",n->host);
|
||||||
|
for(i=0;i<MAXWINLIST;i++)
|
||||||
|
{
|
||||||
|
if(winlist[i].inuse)
|
||||||
|
@@ -3071,4 +3068,4 @@
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
- }
|
||||||
|
\ No newline at end of file
|
||||||
|
+ }
|
20
games/tetrinet-x/files/patch-src::main.h
Normal file
20
games/tetrinet-x/files/patch-src::main.h
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
--- src/main.h.orig Thu Dec 24 06:24:50 1998
|
||||||
|
+++ src/main.h Thu Jun 17 09:55:28 2004
|
||||||
|
@@ -24,7 +24,7 @@
|
||||||
|
#endif
|
||||||
|
#endif /* but virtually every other OS NEEDS both */
|
||||||
|
#include <arpa/inet.h> /* is this really necessary? */
|
||||||
|
-#include <varargs.h>
|
||||||
|
+#include <stdarg.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#if HAVE_UNISTD_H
|
||||||
|
#include <unistd.h>
|
||||||
|
@@ -296,5 +296,5 @@
|
||||||
|
void net_connected(struct net_t *n, char *buf);
|
||||||
|
void net_waitingforteam(struct net_t *n, char *buf);
|
||||||
|
void init_main(void);
|
||||||
|
-void lprintf();
|
||||||
|
-void lvprintf();
|
||||||
|
\ No newline at end of file
|
||||||
|
+void lprintf(char *format, ...);
|
||||||
|
+void lvprintf(int priority, char *format, ...);
|
18
games/tetrinet-x/files/patch-src::net.c
Normal file
18
games/tetrinet-x/files/patch-src::net.c
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
--- src/net.c.orig Thu Dec 24 06:24:50 1998
|
||||||
|
+++ src/net.c Thu Jun 17 09:52:06 2004
|
||||||
|
@@ -537,12 +537,10 @@
|
||||||
|
pointer, precede with a socket number */
|
||||||
|
/* please stop using this one except for server output. dcc output
|
||||||
|
should now use dprintf(idx,"format",[params]); */
|
||||||
|
-void tprintf(va_alist)
|
||||||
|
-va_dcl
|
||||||
|
+void tprintf(int sock, char *format, ...)
|
||||||
|
{
|
||||||
|
- char *format; int sock; va_list va; static char SBUF2[1050];
|
||||||
|
- va_start(va);
|
||||||
|
- sock=va_arg(va,int); format=va_arg(va,char *);
|
||||||
|
+ va_list va; static char SBUF2[1050];
|
||||||
|
+ va_start(va, format);
|
||||||
|
vsprintf(SBUF2,format,va);
|
||||||
|
if (strlen(SBUF2)>1022)
|
||||||
|
{
|
Loading…
Add table
Reference in a new issue