SOURCES: Sjeng-Free-cleanup.patch (NEW), Sjeng-Free-FHS.patch (NEW...
qboosh
qboosh at pld-linux.org
Fri Jan 4 04:22:36 CET 2008
Author: qboosh Date: Fri Jan 4 03:22:36 2008 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- unbzip2ped
---- Files affected:
SOURCES:
Sjeng-Free-cleanup.patch (NONE -> 1.1) (NEW), Sjeng-Free-FHS.patch (NONE -> 1.1) (NEW), Sjeng-Free-cleanup.patch.bz2 (1.1 -> NONE) (REMOVED), Sjeng-Free-FHS.patch.bz2 (1.1 -> NONE) (REMOVED)
---- Diffs:
================================================================
Index: SOURCES/Sjeng-Free-cleanup.patch
diff -u /dev/null SOURCES/Sjeng-Free-cleanup.patch:1.1
--- /dev/null Fri Jan 4 04:22:36 2008
+++ SOURCES/Sjeng-Free-cleanup.patch Fri Jan 4 04:22:31 2008
@@ -0,0 +1,823 @@
+--- Sjeng-Free-11.2/book.c.deb 2001-07-16 20:04:48.000000000 +0800
++++ Sjeng-Free-11.2/book.c 2005-07-03 19:25:22.000000000 +0800
+@@ -21,6 +21,8 @@
+
+ */
+
++#include <unistd.h>
++
+ #include "sjeng.h"
+ #include "protos.h"
+ #include "extvars.h"
+--- Sjeng-Free-11.2/ecache.c.deb 2001-12-28 06:25:20.000000000 +0800
++++ Sjeng-Free-11.2/ecache.c 2005-07-03 19:25:22.000000000 +0800
+@@ -29,7 +29,7 @@
+ {
+ unsigned long stored_hash;
+ unsigned long hold_hash;
+-unsigned int score;
++long int score;
+ } ECacheType;
+
+ /*ECacheType ECache[ECACHESIZE];*/
+@@ -40,7 +40,7 @@
+
+ void storeECache(long int score)
+ {
+- int index;
++ unsigned int index;
+
+ index = hash % ECacheSize;
+
+@@ -51,7 +51,7 @@
+
+ void checkECache(long int *score, int *in_cache)
+ {
+- int index;
++ unsigned int index;
+
+ ECacheProbes++;
+
+@@ -84,7 +84,7 @@
+ exit(EXIT_FAILURE);
+ }
+
+- printf("Allocated %lu eval cache entries, totalling %lu bytes.\n",
++ printf("Allocated %u eval cache entries, totalling %zu bytes.\n",
+ ECacheSize, sizeof(ECacheType)*ECacheSize);
+ return;
+ }
+--- Sjeng-Free-11.2/epd.c.deb 2001-07-23 03:27:36.000000000 +0800
++++ Sjeng-Free-11.2/epd.c 2005-07-03 19:25:22.000000000 +0800
+@@ -24,6 +24,7 @@
+ #include "sjeng.h"
+ #include "protos.h"
+ #include "extvars.h"
++#include <errno.h>
+
+ void setup_epd_line(char* inbuff)
+ {
+@@ -243,6 +244,10 @@
+ thinktime *= 100;
+
+ testsuite = fopen(testname, "r");
++ if (testsuite==NULL) {
++ fprintf(stderr, "Cannot open file %s: %s\n", testname, strerror(errno));
++ return;
++ }
+
+ while (fgets(readbuff, 2000, testsuite) != NULL)
+ {
+@@ -264,8 +269,8 @@
+ // cpu_end = clock();
+ // rdelay(2);
+
+- elapsed = (cpu_end-cpu_start)/(double) CLOCKS_PER_SEC;
+- printf("Time: %f\n", elapsed);
++ // elapsed = (cpu_end-cpu_start)/(double) CLOCKS_PER_SEC;
++ // printf("Time: %f\n", elapsed);
+
+ if (interrupt()) rinput(tempbuff, STR_BUFF, stdin);
+
+@@ -304,7 +309,7 @@
+
+ printf("Move ordering : %f%%\n", (((float)FHF*100)/(float)FH+1));
+
+- printf("Material score: %d Eval : %d\n", Material, eval());
++ printf("Material score: %d Eval : %ld\n", Material, eval());
+ printf("\n");
+
+ if (!forcedwin)
+@@ -329,5 +334,6 @@
+ };
+
+ printf("\n");
++ fclose(testsuite);
+ };
+
+--- Sjeng-Free-11.2/extvars.h.deb 2001-12-28 06:19:58.000000000 +0800
++++ Sjeng-Free-11.2/extvars.h 2005-07-03 19:25:22.000000000 +0800
+@@ -164,7 +164,7 @@
+ extern int havercfile;
+ extern int TTSize;
+ extern int PBSize;
+-extern int ECacheSize;
++extern unsigned int ECacheSize;
+
+ extern int my_rating, opp_rating;
+ extern int userealholdings;
+@@ -190,5 +190,3 @@
+
+
+
+-
+-
+--- Sjeng-Free-11.2/learn.c.deb 2001-09-28 18:14:13.000000000 +0800
++++ Sjeng-Free-11.2/learn.c 2005-07-03 19:25:22.000000000 +0800
+@@ -36,13 +36,13 @@
+ }
+ LearnType;
+
+-void Learn(int score, int best, int depth)
++void Learn(long score, int best, int depth)
+ {
+ int number = 0, next = 0;
+ LearnType draft;
+ FILE **lrnfile;
+
+- printf("Learning score: %d best: %d depth:%d hash: %X\n", score, best, depth, hash);
++ printf("Learning score: %ld best: %d depth:%d hash: %lX\n", score, best, depth, hash);
+
+ if (Variant == Normal)
+ {
+@@ -122,6 +122,7 @@
+ {
+ lrnfile = &lrn_losers;
+ }
++ else return; // Can this happen?
+
+ fseek(*lrnfile, 0, SEEK_SET);
+ fread(&number, sizeof(int), 1, *lrnfile);
+--- Sjeng-Free-11.2/leval.c.deb 2001-09-02 19:04:53.000000000 +0800
++++ Sjeng-Free-11.2/leval.c 2005-07-03 19:25:22.000000000 +0800
+@@ -120,13 +120,13 @@
+ long int losers_eval (void) {
+
+ /* return a score for the current middlegame position: */
+- int srank, pawn_file, pawns[2][11], white_back_pawn[11], black_back_pawn[11];
++ int srank = 0, pawn_file = 0, pawns[2][11], white_back_pawn[11], black_back_pawn[11];
+ int isolated, backwards;
+ int i, a, j;
+ long int score = 0;
+ int in_cache;
+ int wp = 0, bp = 0;
+- int wks, bks;
++ int wks = 0, bks = 0;
+ int wpassp = 0, bpassp = 0;
+ int wpawns = 0, bpawns = 0;
+
+--- Sjeng-Free-11.2/moves.c.deb 2001-06-07 06:12:46.000000000 +0800
++++ Sjeng-Free-11.2/moves.c 2005-07-03 19:25:22.000000000 +0800
+@@ -31,7 +31,7 @@
+ int numb_moves;
+ static move_s *genfor;
+
+-int fcaptures;
++bool fcaptures;
+ int gfrom;
+
+ int kingcap; /* break if we capture the king */
+--- Sjeng-Free-11.2/neval.c.deb 2001-06-29 03:48:09.000000000 +0800
++++ Sjeng-Free-11.2/neval.c 2005-07-03 19:25:22.000000000 +0800
+@@ -177,7 +177,7 @@
+ int in_cache;
+ int wp = 0, bp = 0, wn = 0, bn = 0, wb = 0, bb = 0,
+ wq = 0, bq = 0, wr = 0, br = 0;
+- int fwrook, fbrook, rwrook, rbrook;
++ int fwrook = 0, fbrook = 0, rwrook = 0, rbrook = 0;
+ int wpotential = 0, bpotential = 0, tmp;
+
+ in_cache = 0;
+@@ -818,7 +818,7 @@
+ int in_cache;
+ int wp = 0, bp = 0, wn = 0, bn = 0, wb = 0, bb = 0,
+ wq = 0, bq = 0, wr = 0, br = 0;
+- int rbrook, fbrook, rwrook,fwrook;
++ int rbrook = 0, fbrook = 0, rwrook = 0,fwrook = 0;
+
+ in_cache = 0;
+
+--- Sjeng-Free-11.2/newbook.c.deb 2001-06-07 06:12:39.000000000 +0800
++++ Sjeng-Free-11.2/newbook.c 2005-07-03 19:25:22.000000000 +0800
+@@ -43,7 +43,7 @@
+ typedef struct
+ {
+ unsigned long played;
+- signed long score;
++ long int score;
+ } posinfo_t;
+
+ typedef struct
+@@ -118,7 +118,6 @@
+ posinfo_t *pst;
+ datum index;
+ datum data;
+- int win = 0, loss = 0;
+ int ret;
+
+ /* fill in the key field */
+@@ -461,7 +460,7 @@
+ int raw;
+ int num_moves, i;
+ char output[6];
+- signed long scores[MOVE_BUFF], best_score = 0;
++ long int scores[MOVE_BUFF], best_score = 0;
+
+ srand(time(0));
+
+@@ -524,7 +523,7 @@
+
+ comp_to_coord(moves[i], output);
+
+- printf("Move %s: %ld times played, %d learned\n", output,
++ printf("Move %s: %ld times played, %ld learned\n", output,
+ ps->played, ps->score);
+
+ if ((ps->played + ps->score) >= PLAYTHRESHOLD)
+@@ -593,7 +592,7 @@
+
+ void book_learning(int result)
+ {
+- GDBM_FILE binbook;
++ GDBM_FILE binbook = NULL;
+ hashkey_t key;
+ posinfo_t *ps;
+ datum index;
+@@ -675,7 +674,7 @@
+ }
+
+ /* don't 'overlearn' */
+- if (abs((ps->score)+pi) < (ps->played*5))
++ if ((unsigned long)labs((ps->score)+pi) < (ps->played*5))
+ {
+
+ printf("Learning opening %lu, played %lu, old score %ld, new score %ld\n",
+--- Sjeng-Free-11.2/probe.c.deb 2001-09-12 17:28:18.000000000 +0800
++++ Sjeng-Free-11.2/probe.c 2005-07-03 19:25:22.000000000 +0800
+@@ -121,7 +121,8 @@
+ #endif
+ }
+
+-const static int EGTranslate(int sqidx)
++#ifdef USE_EGTB
++static int EGTranslate(int sqidx)
+ {
+ int r;
+
+@@ -129,6 +130,7 @@
+
+ return r;
+ }
++#endif
+
+ int probe_egtb(void)
+ {
+--- Sjeng-Free-11.2/proof.c.deb 2001-12-28 06:52:15.000000000 +0800
++++ Sjeng-Free-11.2/proof.c 2005-07-03 19:25:22.000000000 +0800
+@@ -79,7 +79,7 @@
+ void losers_pn_eval (node_t *this);
+
+ unsigned char *membuff;
+-int bufftop = 0;
++unsigned int bufftop = 0;
+
+ void* Xmalloc(int size)
+ {
+@@ -506,7 +506,6 @@
+ int i;
+ move_s moves[MOVE_BUFF];
+ int l, num_moves;
+- int reploop;
+ int ic;
+
+ if (node->expanded)
+@@ -1024,7 +1023,7 @@
+ node_t *root;
+ node_t *mostproving;
+ node_t *currentnode;
+- int leastlooked, leastlooked_l, leastlooked_i;
++ int leastlooked, leastlooked_l = 0, leastlooked_i = 0;
+ int losers;
+ int xnodecount;
+ int firsts, alternates;
+@@ -1364,7 +1363,7 @@
+ #endif
+ {
+ #ifdef PN2
+- printf("P: %d D: %d N: %d S: %d Mem: %2.2fM Iters: %d ", root->proof, root->disproof, nodecount, frees, (((nodecount) * sizeof(node_t) / (float)(1024*1024))), iters);
++ printf("P: %d D: %d N: %d S: %ld Mem: %2.2fM Iters: %d ", root->proof, root->disproof, nodecount, frees, (((nodecount) * sizeof(node_t) / (float)(1024*1024))), iters);
+
+ printf ("PV: ");
+
+@@ -1415,7 +1414,7 @@
+ }
+ };
+
+- printf ("P: %d D: %d N: %d S: %d Mem: %2.2fM Iters: %d MaxDepth: %d\n", root->proof, root->disproof, nodecount, frees, (((nodecount) * sizeof (node_t) / (float) (1024 * 1024))), iters,maxply);
++ printf ("P: %d D: %d N: %d S: %ld Mem: %2.2fM Iters: %d MaxDepth: %d\n", root->proof, root->disproof, nodecount, frees, (((nodecount) * sizeof (node_t) / (float) (1024 * 1024))), iters,maxply);
+
+ if (xb_mode && post)
+ printf ("tellics whisper proof %d, disproof %d, %d nodes, %d forwards, %d iters, highest depth %d\n", root->proof, root->disproof, nodecount, forwards, iters, maxply);
+@@ -1608,7 +1607,7 @@
+ }
+ };
+
+- printf("P: %d D: %d N: %d S: %d Mem: %2.2fM Iters: %d\n", root->proof, root->disproof, nodecount, frees, (((nodecount) * sizeof(node_t) / (float)(1024*1024))), iters);
++ printf("P: %d D: %d N: %d S: %ld Mem: %2.2fM Iters: %d\n", root->proof, root->disproof, nodecount, frees, (((nodecount) * sizeof(node_t) / (float)(1024*1024))), iters);
+
+ while(currentnode != root)
+ {
+--- Sjeng-Free-11.2/protos.h.deb 2001-07-18 09:21:37.000000000 +0800
++++ Sjeng-Free-11.2/protos.h 2005-07-03 19:25:22.000000000 +0800
+@@ -67,7 +67,7 @@
+
+
+ void push_slidE (int target);
+-long int qsearch (int alpha, int beta, int depth);
++long int qsearch (long alpha, long beta, int depth);
+ void rdelay (int time_in_s);
+ long int rdifftime (rtime_t end, rtime_t start);
+ bool remove_one (int *marker, long int move_ordering[], int num_moves);
+@@ -75,8 +75,8 @@
+ void check_piece_square (void);
+ void rinput (char str[], int n, FILE *stream);
+ rtime_t rtime (void);
+-long int search (int alpha, int beta, int depth, int is_null);
+-move_s search_root (int alpha, int beta, int depth);
++long int search (long alpha, long beta, int depth, int is_null);
++move_s search_root (long alpha, long beta, int depth);
+ void start_up (void);
+ move_s think (void);
+ void toggle_bool (bool *var);
+@@ -111,14 +111,14 @@
+ move_s choose_book_move(void);
+ move_s choose_binary_book_move(void);
+
+-void StoreTT(int score, int alpha, int beta, int best , int threat, int depth);
+-void QStoreTT(int score, int alpha, int beta, int best);
+-int ProbeTT(int *score, int alpha, int beta, int *best, int *threat, int *donull, int depth);
+-int QProbeTT(int *score, int alpha, int beta, int *best);
+-void LearnStoreTT(int score, unsigned nhash, unsigned hhash, int tomove, int best, int depth);
++void StoreTT(long score, long alpha, long beta, int best , int threat, int depth);
++void QStoreTT(long score, long alpha, long beta, int best);
++int ProbeTT(long *score, long alpha, long beta, int *best, int *threat, int *donull, int depth);
++int QProbeTT(long *score, long alpha, long beta, int *best);
++void LearnStoreTT(long score, unsigned nhash, unsigned hhash, int tomove, int best, int depth);
+
+ void LoadLearn(void);
+-void Learn(int score, int best, int depth);
++void Learn(long score, int best, int depth);
+
+ void pinput (int n, FILE *stream);
+
+@@ -170,5 +170,9 @@
+ void gen_all_tables(void);
+ int egtb(int s);
+
++int load_2piece(void);
++int load_3piece(int w1_man, int b1_man, int b2_man, signed char *t);
++int init_segtb(void);
++
+ #endif
+
+--- Sjeng-Free-11.2/rcfile.c.deb 2001-09-28 18:19:18.000000000 +0800
++++ Sjeng-Free-11.2/rcfile.c 2005-07-03 19:25:22.000000000 +0800
+@@ -21,6 +21,10 @@
+
+ */
+
++#include <pwd.h>
++#include <unistd.h>
++#include <sys/types.h>
++
+ #include "sjeng.h"
+ #include "protos.h"
+ #include "extvars.h"
+@@ -30,7 +34,7 @@
+ char line[STR_BUFF];
+
+ int TTSize;
+-int ECacheSize;
++unsigned int ECacheSize;
+ int PBSize;
+
+ int cfg_booklearn;
+@@ -100,7 +104,7 @@
+
+ fgets(line, STR_BUFF, rcfile);
+ while (line[0] == '#') fgets(line, STR_BUFF, rcfile);
+- sscanf(line, "%d", &ECacheSize);
++ sscanf(line, "%u", &ECacheSize);
+
+ fgets(line, STR_BUFF, rcfile);
+ while (line[0] == '#') fgets(line, STR_BUFF, rcfile);
+@@ -181,6 +185,7 @@
+
+ sprintf(setcode, "%u", setc);
+
++ fclose(rcfile);
+ initialize_eval();
+ alloc_hash();
+ alloc_ecache();
+--- Sjeng-Free-11.2/search.c.deb 2001-12-28 06:20:56.000000000 +0800
++++ Sjeng-Free-11.2/search.c 2005-07-03 19:25:22.000000000 +0800
+@@ -264,7 +264,7 @@
+ }
+
+
+-long int qsearch (int alpha, int beta, int depth) {
++long int qsearch (long alpha, long beta, int depth) {
+
+ /* perform a quiscense search on the current node using alpha-beta with
+ negamax search */
+@@ -275,9 +275,10 @@
+ move_ordering[MOVE_BUFF],
+ see_values[MOVE_BUFF];
+ bool legal_move, no_moves = TRUE;
+- int sbest, best_score, best, delta, bound;
+- int originalalpha;
+- int oldtime;
++ long best_score, bound, delta;
++ int sbest, best;
++ long originalalpha;
++ long int oldtime;
+ int seev;
+
+ pv_length[ply] = ply;
+@@ -301,7 +302,7 @@
+ extendedtime = 1;
+ oldtime = time_for_move;
+ time_for_move += allocate_time();
+- printf("Extended from %d to %d, time left %d\n", oldtime,
++ printf("Extended from %ld to %ld, time left %ld\n", oldtime,
+ time_for_move,
+ time_left);
+ }
+@@ -473,7 +474,7 @@
+
+ }
+
+-long int search (int alpha, int beta, int depth, int is_null) {
++long int search (long alpha, long beta, int depth, int is_null) {
+
+ /* search the current node using alpha-beta with negamax search */
+
+@@ -481,16 +482,18 @@
+ int num_moves, i, j;
+ long int score = -INF, move_ordering[MOVE_BUFF], see_values[MOVE_BUFF];
+ bool no_moves, legal_move;
+- int bound, threat, donull, best, sbest, best_score, old_ep;
++ long int best_score, bound;
++ int threat, donull, best, sbest, old_ep;
+ bool incheck, first;
+- int extend, fscore, fmax, selective;
++ long int fscore, fmax;
++ int extend, selective;
+ move_s kswap;
+ int ksswap;
+- int originalalpha;
++ long originalalpha;
+ int afterincheck;
+ int legalmoves;
+ int dropcut;
+- int oldtime;
++ long int oldtime;
+ int egscore;
+ static const int rc_index[14] = {0,1,1,2,2,5,5,3,3,4,4,2,2,0};
+
+@@ -512,7 +515,7 @@
+ extendedtime = 1;
+ oldtime = time_for_move;
+ time_for_move += allocate_time();
+- printf("Extended from %d to %d, time left %d\n", oldtime,
++ printf("Extended from %ld to %ld, time left %ld\n", oldtime,
+ time_for_move,
+ time_left);
+ }
+@@ -826,11 +829,12 @@
+ afterincheck = f_in_check(&moves[0], i);
+ checks[ply] = afterincheck;
+
+- if (!afterincheck && ((Variant == Normal)
+- || (Variant == Suicide)
+- || (Variant == Losers)) && (depth < 3) &&
+- (((board[moves[i].target] == wpawn) && (rank(moves[i].target) >= 6)
+- || ((board[moves[i].target] == bpawn) && (rank(moves[i].target) <= 3)))))
++ if (!afterincheck
++ && ((Variant == Normal) || (Variant == Suicide) || (Variant == Losers))
++ && (depth < 3)
++ && (((board[moves[i].target] == wpawn) && (rank(moves[i].target) >= 6))
++ ||
++ ((board[moves[i].target] == bpawn) && (rank(moves[i].target) <= 3))))
+ {
+ extend++;
+ };
+@@ -1066,7 +1070,7 @@
+ }
+
+
+-move_s search_root (int originalalpha, int originalbeta, int depth) {
++move_s search_root (long originalalpha, long originalbeta, int depth) {
+
+ /* search the root node using alpha-beta with negamax search */
+
+@@ -1074,7 +1078,7 @@
+ int num_moves, i, j;
+ long int root_score = -INF, move_ordering[MOVE_BUFF], see_values[MOVE_BUFF];
+ bool no_moves, legal_move, first;
+- int alpha, beta;
++ long alpha, beta;
+ move_s kswap;
+ move_s oldbest;
+ int oldbestnum;
+@@ -1447,15 +1451,15 @@
+
+ move_s comp_move, temp_move, old_move;
+ int i, j, k;
+- long int elapsed, temp_score, true_score;
++ long int elapsed, temp_score = 0, true_score;
+ char postmove[STR_BUFF];
+ clock_t cpu_start, cpu_end;
+ float et = 0;
+- int alpha, beta;
++ long alpha, beta;
+ int tmptmp;
+ int rs;
+ move_s moves[MOVE_BUFF];
+- int l, lastlegal, ic;
++ int l, lastlegal = 0, ic;
+ int pn_restart;
+ int num_moves;
+ char output[8];
+@@ -1632,7 +1636,7 @@
+
+ if (pn_restart) time_for_move = (float)time_for_move * (float)2/((float)pn_restart+1.0);
+
+- printf("Time for move : %d\n", time_for_move);
++ printf("Time for move : %ld\n", time_for_move);
+
+ if (time_for_move > 50)
+ LoadLearn();
+@@ -1658,6 +1662,7 @@
+ if ((forcedwin || result) && (pn_move.target != dummy.target)
+ && !is_analyzing)
+ {
++ cpu_start = clock();
+ comp_move = pn_move;
+ }
+ else
+@@ -1861,7 +1866,7 @@
+ break;
+ }
+ }
+- for (j = 0; j < num_moves; j++)
++ for (j = 0, k = 0; j < num_moves; j++)
+ {
+ if (rootlosers[j]) k++;
+ }
+@@ -1883,7 +1888,7 @@
+ }
+ elapsed = rdifftime (rtime (), start_time);
+
+- printf("Used time : %d\n", elapsed);
++ printf("Used time : %ld\n", elapsed);
+
+ /* update our elapsed time_cushion: */
+ if (moves_to_tc && !is_pondering) {
+@@ -1937,7 +1942,7 @@
+
+ if ((et > 0) && (Variant != Bughouse))
+ {
+- printf("tellics whisper d%d %+.2f %sn: %ld qp: %.0f%% fh: %.0f%% c-x: %d r-x: %d 1-x: %d egtb: %d time: %.2f nps: %ld\n",
++ printf("tellics whisper d%d %+.2f %sn: %ld qp: %.0f%% fh: %.0f%% c-x: %ld r-x: %ld 1-x: %ld egtb: %d time: %.2f nps: %ld\n",
+ true_i_depth, (float)temp_score/100.0, postpv, nodes,
+ (((float)qnodes*100)/((float)nodes+1)),
+ ((float)FHF*100)/((float)(FH+1)),
+--- Sjeng-Free-11.2/segtb.c.deb 2001-12-28 06:46:41.000000000 +0800
++++ Sjeng-Free-11.2/segtb.c 2005-07-03 19:25:22.000000000 +0800
+@@ -742,10 +742,10 @@
+
+ int egtb(int s)
+ {
<<Diff was trimmed, longer than 597 lines>>
More information about the pld-cvs-commit
mailing list