- Fixes the build with GCC 4.2

- Removes warnings
- Pass maintainship to submitter

PR:		118254
Submitted by:	Pietro Cerutti <gahr@gahr.ch>
Approved by:	portmgr (pav)
This commit is contained in:
Martin Wilke 2007-11-27 22:49:06 +00:00
parent ae47d2196b
commit 17ea8b00dc
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=202847
5 changed files with 80 additions and 12 deletions

View file

@ -17,7 +17,7 @@ DISTFILES= ${DISTNAME}.tar.gz \
DIST_SUBDIR= ${PORTNAME}
EXTRACT_ONLY= ${DISTNAME}.tar.gz
MAINTAINER= ports@FreeBSD.org
MAINTAINER= gahr@gahr.ch
COMMENT= GNU Backgammon
LIB_DEPENDS= gdbm.3:${PORTSDIR}/databases/gdbm \
@ -67,16 +67,6 @@ CONFIGURE_ARGS+= --with-python
CONFIGURE_ARGS+= --without-python
.endif
.include <bsd.port.pre.mk>
.if ${OSVERSION} >= 700042
BROKEN= Broken with gcc 4.2
.endif
.if ${ARCH} == "sparc64"
BROKEN= does not compile on sparc64
.endif
post-extract:
${GUNZIP_CMD} --stdout ${DISTDIR}/${DIST_SUBDIR}/gnubg.weights-${GNUBG_WEIGHTS_VERSION}.gz > ${WRKSRC}/gnubg.weights
${GUNZIP_CMD} --stdout ${DISTDIR}/${DIST_SUBDIR}/gnubg_os0.bd.gz > ${WRKSRC}/gnubg_os0.bd
@ -87,4 +77,4 @@ post-patch:
${REINPLACE_CMD} -e 's|"getopt\.h"|<getopt.h>|g' ${WRKSRC}/${file}
.endfor
.include <bsd.port.post.mk>
.include <bsd.port.mk>

View file

@ -0,0 +1,11 @@
--- eval.c.orig 2007-11-25 23:01:11.000000000 +0100
+++ eval.c 2007-11-25 23:02:20.000000000 +0100
@@ -798,7 +798,7 @@
if( !fstat( h, &st ) &&
( p = mmap( NULL, st.st_size, PROT_READ | PROT_WRITE,
MAP_PRIVATE, h, 0 ) ) ) {
- ( (float *) p ) += 2; /* skip magic number and version */
+ p += 2; /* skip magic number and version */
fReadWeights =
( p = NeuralNetCreateDirect( &nnContact, p ) ) &&
( p = NeuralNetCreateDirect( &nnRace, p ) ) &&

View file

@ -0,0 +1,10 @@
--- htmlimages.c.orig 2007-11-25 23:07:11.000000000 +0100
+++ htmlimages.c 2007-11-25 23:07:24.000000000 +0100
@@ -30,6 +30,7 @@
#endif
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#if HAVE_SYS_TYPES_H

View file

@ -0,0 +1,46 @@
--- lib/neuralnet.c.orig 2007-11-25 22:55:20.000000000 +0100
+++ lib/neuralnet.c 2007-11-25 23:00:22.000000000 +0100
@@ -384,15 +384,17 @@
return 0;
}
-extern void *NeuralNetCreateDirect( neuralnet *pnn, void *p ) {
+extern void *NeuralNetCreateDirect( neuralnet *pnn, void *v_p ) {
+ int *p = v_p;
+ float *fp = v_p;
pnn->cInput = *( ( (int *) p )++ );
pnn->cHidden = *( ( (int *) p )++ );
pnn->cOutput = *( ( (int *) p )++ );
pnn->nTrained = *( ( (int *) p )++ );
pnn->fDirect = TRUE;
- pnn->rBetaHidden = *( ( (float *) p )++ );
- pnn->rBetaOutput = *( ( (float *) p )++ );
+ pnn->rBetaHidden = *( ( fp )++ );
+ pnn->rBetaOutput = *( ( fp )++ );
if( pnn->cInput < 1 || pnn->cHidden < 1 || pnn->cOutput < 1 ||
pnn->nTrained < 0 || pnn->rBetaHidden <= 0.0 ||
@@ -402,14 +404,14 @@
return NULL;
}
- pnn->arHiddenWeight = p;
- ( (float *) p ) += pnn->cInput * pnn->cHidden;
- pnn->arOutputWeight = p;
- ( (float *) p ) += pnn->cHidden * pnn->cOutput;
- pnn->arHiddenThreshold = p;
- ( (float *) p ) += pnn->cHidden;
- pnn->arOutputThreshold = p;
- ( (float *) p ) += pnn->cOutput;
+ pnn->arHiddenWeight = fp;
+ fp += pnn->cInput * pnn->cHidden;
+ pnn->arOutputWeight = fp;
+ fp += pnn->cHidden * pnn->cOutput;
+ pnn->arHiddenThreshold = fp;
+ fp += pnn->cHidden;
+ pnn->arOutputThreshold = fp;
+ fp += pnn->cOutput;
pnn->savedBase = malloc( pnn->cHidden * sizeof( float ) );
pnn->savedIBase = malloc( pnn->cInput * sizeof( float ) );

View file

@ -0,0 +1,11 @@
--- rollout.h.orig 2007-11-25 23:05:53.000000000 +0100
+++ rollout.h 2007-11-25 23:06:00.000000000 +0100
@@ -59,8 +59,6 @@
} rolloutstat;
-extern int nSkip;
-
typedef void
(rolloutprogressfunc) ( float arOutput[][ NUM_ROLLOUT_OUTPUTS ],
float arStdDev[][ NUM_ROLLOUT_OUTPUTS ],