Sun 15 Feb 2004 02:30:50 AM UTC, comment #4:
I forgot this:
--- backend.c 2004-02-15 01:51:08.000000000 +0100
+++ backend.c.new 2004-02-15 03:16:44.453125000 +0100
@@ -4375,7 +4375,7 @@
~ if (!ignore) {
~ buf1[0] = NULLCHAR;
- if (sscanf(message, "%d%c %d %d %I64u %[^\n]\n",
+ if (sscanf(message, "%d%c %d %d" u64Display "%[^\n]\n",
~ &plylev, &plyext, &curscore, &time, &nodes, buf1) >= 5) {
~ if (plyext != ' ' && plyext != '\t') {
@@ -4455,7 +4455,7 @@
~ DisplayAnalysis();
~ }
~ return;
- } else if (sscanf(message,"stat01: %d %lu %d %d %d %s",
+ } else if (sscanf(message,"stat01: %d" u64Display "%d %d %d %s",
~ &time, &nodes, &plylev, &mvleft,
~ &mvtot, mvname) >= 5) {
~ /* The stat01: line is from Crafty (9.29+) in response
@@ -9263,7 +9263,7 @@
~ if (programStats.moves_left > 0 && appData.periodicUpdates) {
~ if (programStats.move_name[0] != NULLCHAR) {
- sprintf(buf, "depth=%d %d/%d(%s) %+.2f %s%s\nNodes: %I64u NPS:
%d\nTime: %02d:%02d:%02d.%02d",
+ sprintf(buf, "depth=%d %d/%d(%s) %+.2f %s%s\nNodes: "u64Display"
NPS: %d\nTime: %02d:%02d:%02d.%02d",
~ programStats.depth,
~ programStats.nr_moves-programStats.moves_left,
~ programStats.nr_moves, programStats.move_name,
@@ -9272,7 +9272,7 @@
~ xtra[programStats.got_fail] : "",
~ (u64)programStats.nodes, (int)nps, h, m, s, cs);
~ } else {
- sprintf(buf, "depth=%d %d/%d %+.2f %s%s\nNodes: %I64u NPS:
%d\nTime: %02d:%02d:%02d.%02d",
+ sprintf(buf, "depth=%d %d/%d %+.2f %s%s\nNodes: "u64Display" NPS:
%d\nTime: %02d:%02d:%02d.%02d",
~ programStats.depth,
~ programStats.nr_moves-programStats.moves_left,
~ programStats.nr_moves, ((float)programStats.score)/100.0,
@@ -9282,7 +9282,7 @@
~ (u64)programStats.nodes, (int)nps, h, m, s, cs);
~ }
~ } else {
- sprintf(buf, "depth=%d %+.2f %s%s\nNodes: %I64u NPS: %d\nTime:
%02d:%02d:%02d.%02d",
+ sprintf(buf, "depth=%d %+.2f %s%s\nNodes: "u64Display" NPS:
%d\nTime: %02d:%02d:%02d.%02d",
~ programStats.depth,
~ ((float)programStats.score)/100.0,
~ programStats.movelist,
--- backend.h 2004-02-15 01:51:08.000000000 +0100
+++ backend.h.new 2004-02-15 03:12:08.359375000 +0100
@@ -177,16 +177,17 @@
~ int ics_type;
~ /* unsigned int 64 for engine nodes work and display */
-#define u64Display "%I64u"
~ #ifdef WIN32
~ /* I don't know the name for this type of other compilers
~ * If it not work just added here
~ * Thats for MS Visual Studio
~ */
~ #define u64 unsigned __int64
+ #define u64Display "%I64u"
~ #else
~ /* GNU gcc */
~ #define u64 unsigned long long
+ #define u64Display "%llu"
~ #endif
|
Sun 15 Feb 2004 01:00:57 AM UTC, comment #3:
Hi,
this is my patch for Bug #6908.
Its not full tested, but i'm sure it works. I let my crafty running over
the night and we will see what happend ;))
--- backend.h 2004-02-12 13:32:59.000000000 +0100
+++ backend.h.new 2004-02-15 00:08:52.265625000 +0100
@@ -174,8 +174,21 @@
~ #define ICS_ICC 1
~ #define ICS_FICS 2
~ #define ICS_CHESSNET 3 /* not really supported */
-int ics_type;
-
+int ics_type;
+
+/* unsigned int 64 for engine nodes work and display */
+#define u64Display "%I64u"
+#ifdef WIN32
+ /* I don't know the name for this type of other compilers
+ * If it not work just added here
+ * Thats for MS Visual Studio
+ */
+ #define u64 unsigned __int64
+#else
+ /* GNU gcc */
+ #define u64 unsigned long long
+#endif
+
~ /* pgntags.c prototypes
~ */
--- backend.c 2004-02-12 13:32:59.000000000 +0100
+++ backend.c.new 2004-02-15 01:24:33.578125000 +0100
@@ -131,7 +131,7 @@
~ int nr_moves; /* Total nr of root moves */
~ int moves_left; /* Moves remaining to be searched */
~ char move_name[MOVE_LEN]; /* Current move being searched, if
provided */
- unsigned long nodes; /* # of nodes searched */
+ u64 nodes; /* # of nodes searched */
~ int time; /* Search time (centiseconds) */
~ int score; /* Score (centipawns) */
~ int got_only_move; /* If last msg was "(only move)" */
@@ -4344,7 +4344,7 @@
~ if (appData.showThinking) {
~ int plylev, mvleft, mvtot, curscore, time;
~ char mvname[MOVE_LEN];
- unsigned long nodes;
+ u64 nodes;
~ char plyext;
~ int ignore = FALSE;
~ int prefixHint = FALSE;
@@ -4375,7 +4375,7 @@
~ if (!ignore) {
~ buf1[0] = NULLCHAR;
- if (sscanf(message, "%d%c %d %d %lu %[^\n]\n",
+ if (sscanf(message, "%d%c %d %d %I64u %[^\n]\n",
~ &plylev, &plyext, &curscore, &time, &nodes, buf1) >= 5) {
~ if (plyext != ' ' && plyext != '\t') {
@@ -9251,7 +9251,7 @@
~ if (programStats.got_only_move) {
~ strcpy(buf, programStats.movelist);
~ } else {
- nps = (((double)programStats.nodes) /
+ nps = (((u64)programStats.nodes) /
~ (((double)programStats.time)/100.0));
~ cs = programStats.time % 100;
@@ -9263,32 +9263,32 @@
~ if (programStats.moves_left > 0 && appData.periodicUpdates) {
~ if (programStats.move_name[0] != NULLCHAR) {
- sprintf(buf, "depth=%d %d/%d(%s) %+.2f %s%s\nNodes: %lu NPS:
%d\nTime: %02d:%02d:%02d.%02d",
+ sprintf(buf, "depth=%d %d/%d(%s) %+.2f %s%s\nNodes: %I64u NPS:
%d\nTime: %02d:%02d:%02d.%02d",
~ programStats.depth,
~ programStats.nr_moves-programStats.moves_left,
~ programStats.nr_moves, programStats.move_name,
~ ((float)programStats.score)/100.0, programStats.movelist,
~ only_one_move(programStats.movelist)?
~ xtra[programStats.got_fail] : "",
- programStats.nodes, (int)nps, h, m, s, cs);
+ (u64)programStats.nodes, (int)nps, h, m, s, cs);
~ } else {
- sprintf(buf, "depth=%d %d/%d %+.2f %s%s\nNodes: %lu NPS: %d\nTime:
%02d:%02d:%02d.%02d",
+ sprintf(buf, "depth=%d %d/%d %+.2f %s%s\nNodes: %I64u NPS:
%d\nTime: %02d:%02d:%02d.%02d",
~ programStats.depth,
~ programStats.nr_moves-programStats.moves_left,
~ programStats.nr_moves, ((float)programStats.score)/100.0,
~ programStats.movelist,
~ only_one_move(programStats.movelist)?
~ xtra[programStats.got_fail] : "",
- programStats.nodes, (int)nps, h, m, s, cs);
+ (u64)programStats.nodes, (int)nps, h, m, s, cs);
~ }
~ } else {
- sprintf(buf, "depth=%d %+.2f %s%s\nNodes: %lu NPS: %d\nTime:
%02d:%02d:%02d.%02d",
+ sprintf(buf, "depth=%d %+.2f %s%s\nNodes: %I64u NPS: %d\nTime:
%02d:%02d:%02d.%02d",
~ programStats.depth,
~ ((float)programStats.score)/100.0,
~ programStats.movelist,
~ only_one_move(programStats.movelist)?
~ xtra[programStats.got_fail] : "",
- programStats.nodes, (int)nps, h, m, s, cs);
+ (u64)programStats.nodes, (int)nps, h, m, s, cs);
~ }
~ }
~ DisplayAnalysisText(buf)
|