Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 78456 Details for
Bug 120836
GCC4 patch for games-board/gnubg
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
gnubg-0.14.3-gcc4.patch
gnubg-0.14.3-gcc4.patch (text/plain), 3.50 KB, created by
Joshua Baergen (RETIRED)
on 2006-01-29 10:43:41 UTC
(
hide
)
Description:
gnubg-0.14.3-gcc4.patch
Filename:
MIME Type:
Creator:
Joshua Baergen (RETIRED)
Created:
2006-01-29 10:43:41 UTC
Size:
3.50 KB
patch
obsolete
>--- lib/neuralnet.c.old 2006-01-29 11:16:30.000000000 -0700 >+++ lib/neuralnet.c 2006-01-29 11:21:10.000000000 -0700 >@@ -386,13 +386,15 @@ > } > extern void *NeuralNetCreateDirect( neuralnet *pnn, void *p ) { > >- pnn->cInput = *( ( (int *) p )++ ); >- pnn->cHidden = *( ( (int *) p )++ ); >- pnn->cOutput = *( ( (int *) p )++ ); >- pnn->nTrained = *( ( (int *) p )++ ); >+ int *ip = (int *)p; >+ pnn->cInput = *( ip++ ); >+ pnn->cHidden = *( ip++ ); >+ pnn->cOutput = *( ip++ ); >+ pnn->nTrained = *( ip++ ); > pnn->fDirect = TRUE; >- pnn->rBetaHidden = *( ( (float *) p )++ ); >- pnn->rBetaOutput = *( ( (float *) p )++ ); >+ float *fp = (float *)ip; >+ pnn->rBetaHidden = *( fp++ ); >+ pnn->rBetaOutput = *( fp++ ); > > if( pnn->cInput < 1 || pnn->cHidden < 1 || pnn->cOutput < 1 || > pnn->nTrained < 0 || pnn->rBetaHidden <= 0.0 || >@@ -402,19 +404,19 @@ > 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 = (void *)fp; >+ fp += pnn->cInput * pnn->cHidden; >+ pnn->arOutputWeight = (void *)fp; >+ fp += pnn->cHidden * pnn->cOutput; >+ pnn->arHiddenThreshold = (void *)fp; >+ fp += pnn->cHidden; >+ pnn->arOutputThreshold = (void *)fp; >+ fp += pnn->cOutput; > > pnn->savedBase = malloc( pnn->cHidden * sizeof( float ) ); > pnn->savedIBase = malloc( pnn->cInput * sizeof( float ) ); > >- return p; >+ return (void *)fp; > } > > extern int >--- eval.c.old 2006-01-29 11:24:57.000000000 -0700 >+++ eval.c 2006-01-29 11:27:35.000000000 -0700 >@@ -798,7 +798,9 @@ > 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 */ >+ float *fp = (float *)p; >+ fp += 2; /* skip magic number and version */ >+ p = (void *)fp; > fReadWeights = > ( p = NeuralNetCreateDirect( &nnContact, p ) ) && > ( p = NeuralNetCreateDirect( &nnRace, p ) ) && >--- rollout.c.old 2006-01-29 11:32:54.000000000 -0700 >+++ rollout.c 2006-01-29 11:32:58.000000000 -0700 >@@ -219,7 +219,7 @@ > nPermutationSeed = n; > } > >-static int nSkip; >+static int nSkip_local; > > static int RolloutDice( int iTurn, int iGame, int cGames, > int fInitial, >@@ -234,10 +234,10 @@ > int j; > > if( !iGame ) >- nSkip = 0; >+ nSkip_local = 0; > >- for( ; ; nSkip++ ) { >- j = aaanPermutation[ 0 ][ 0 ][ ( iGame + nSkip ) % 36 ]; >+ for( ; ; nSkip_local++ ) { >+ j = aaanPermutation[ 0 ][ 0 ][ ( iGame + nSkip_local ) % 36 ]; > > anDice[ 0 ] = j / 6 + 1; > anDice[ 1 ] = j % 6 + 1; >@@ -265,7 +265,7 @@ > k; /* 36**i */ > > for( i = 0, j = 0, k = 1; i < 6 && i <= iTurn; i++, k *= 36 ) >- j = aaanPermutation[ i ][ iTurn ][ ( (iGame + nSkip) / k + j ) % 36 ]; >+ j = aaanPermutation[ i ][ iTurn ][ ( (iGame + nSkip_local) / k + j ) % 36 ]; > > anDice[ 0 ] = j / 6 + 1; > anDice[ 1 ] = j % 6 + 1; >@@ -1173,7 +1173,7 @@ > if( prc->fRotate ) > QuasiRandomSeed( prc->nSeed ); > >- nSkip = prc->nSkip; >+ nSkip_local = prc->nSkip; > > /* ... and the RNG */ > if( prc->rngRollout != RNG_MANUAL ) >@@ -1672,7 +1672,7 @@ > return -1; > > pes->rc.nGamesDone = cGames; >- pes->rc.nSkip = nSkip; >+ pes->rc.nSkip = nSkip_local; > > return 0; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 120836
: 78456