OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

105 lines
3.4 KiB

  1. # --- T2-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # T2 SDE: package/.../gnubg/gcc4.patch
  5. # Copyright (C) 2006 The T2 SDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- T2-COPYRIGHT-NOTE-END ---
  16. diff -Nur gnubg-0.14.3-orig/eval.c gnubg-0.14.3/eval.c
  17. --- gnubg-0.14.3-orig/eval.c 2004-05-07 05:20:21.000000000 +0000
  18. +++ gnubg-0.14.3/eval.c 2006-01-26 13:30:59.383449250 +0000
  19. @@ -798,7 +798,10 @@
  20. if( !fstat( h, &st ) &&
  21. ( p = mmap( NULL, st.st_size, PROT_READ | PROT_WRITE,
  22. MAP_PRIVATE, h, 0 ) ) ) {
  23. - ( (float *) p ) += 2; /* skip magic number and version */
  24. +// ( (float *) p ) += 2; /* skip magic number and version */
  25. + float *pf = p;
  26. + p += 2;
  27. + p = pf;
  28. fReadWeights =
  29. ( p = NeuralNetCreateDirect( &nnContact, p ) ) &&
  30. ( p = NeuralNetCreateDirect( &nnRace, p ) ) &&
  31. diff -Nur gnubg-0.14.3-orig/lib/neuralnet.c gnubg-0.14.3/lib/neuralnet.c
  32. --- gnubg-0.14.3-orig/lib/neuralnet.c 2004-02-24 10:15:50.000000000 +0000
  33. +++ gnubg-0.14.3/lib/neuralnet.c 2006-01-26 13:24:02.577400500 +0000
  34. @@ -386,13 +386,23 @@
  35. }
  36. extern void *NeuralNetCreateDirect( neuralnet *pnn, void *p ) {
  37. - pnn->cInput = *( ( (int *) p )++ );
  38. - pnn->cHidden = *( ( (int *) p )++ );
  39. - pnn->cOutput = *( ( (int *) p )++ );
  40. - pnn->nTrained = *( ( (int *) p )++ );
  41. + float *fp;
  42. + int *ip = ( int *)p;
  43. +
  44. + pnn->cInput = *ip;
  45. + ip++;
  46. + pnn->cHidden = *ip;
  47. + ip++;
  48. + pnn->cOutput = *ip;
  49. + ip++;
  50. + pnn->nTrained = *ip;
  51. + ip++;
  52. pnn->fDirect = TRUE;
  53. - pnn->rBetaHidden = *( ( (float *) p )++ );
  54. - pnn->rBetaOutput = *( ( (float *) p )++ );
  55. + fp = (float*)ip;
  56. + pnn->rBetaHidden = *fp;
  57. + fp++;
  58. + pnn->rBetaOutput = *fp;
  59. + fp++;
  60. if( pnn->cInput < 1 || pnn->cHidden < 1 || pnn->cOutput < 1 ||
  61. pnn->nTrained < 0 || pnn->rBetaHidden <= 0.0 ||
  62. @@ -402,19 +412,19 @@
  63. return NULL;
  64. }
  65. - pnn->arHiddenWeight = p;
  66. - ( (float *) p ) += pnn->cInput * pnn->cHidden;
  67. - pnn->arOutputWeight = p;
  68. - ( (float *) p ) += pnn->cHidden * pnn->cOutput;
  69. - pnn->arHiddenThreshold = p;
  70. - ( (float *) p ) += pnn->cHidden;
  71. - pnn->arOutputThreshold = p;
  72. - ( (float *) p ) += pnn->cOutput;
  73. + pnn->arHiddenWeight = fp;
  74. + fp += pnn->cInput * pnn->cHidden;
  75. + pnn->arOutputWeight = fp;
  76. + fp += pnn->cHidden * pnn->cOutput;
  77. + pnn->arHiddenThreshold = fp;
  78. + fp += pnn->cHidden;
  79. + pnn->arOutputThreshold = fp;
  80. + fp += pnn->cOutput;
  81. pnn->savedBase = malloc( pnn->cHidden * sizeof( float ) );
  82. pnn->savedIBase = malloc( pnn->cInput * sizeof( float ) );
  83. - return p;
  84. + return fp;
  85. }
  86. extern int
  87. diff -Nur gnubg-0.14.3-orig/rollout.c gnubg-0.14.3/rollout.c
  88. --- gnubg-0.14.3-orig/rollout.c 2004-05-07 05:20:21.000000000 +0000
  89. +++ gnubg-0.14.3/rollout.c 2006-01-26 13:32:38.445640250 +0000
  90. @@ -219,7 +219,7 @@
  91. nPermutationSeed = n;
  92. }
  93. -static int nSkip;
  94. +int nSkip;
  95. static int RolloutDice( int iTurn, int iGame, int cGames,
  96. int fInitial,