From a6ee0aa3cb34740abc586b8496c3aa1c1d6cf6e1 Mon Sep 17 00:00:00 2001 From: Jean-loup Gailly Date: Thu, 11 Mar 2010 17:10:02 +0100 Subject: [PATCH] get_replies: avoid uninitialized variable "now". --- distributed/distributed.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/distributed/distributed.c b/distributed/distributed.c index 6653170..ec66545 100644 --- a/distributed/distributed.c +++ b/distributed/distributed.c @@ -384,7 +384,6 @@ new_cmd(struct board *b, char *cmd, char *args) static void get_replies(double time_limit, int min_playouts, struct board *b) { - double now; while (reply_count == 0 || reply_count < active_slaves) { if (time_limit && reply_count > 0) { struct timespec ts; @@ -398,8 +397,7 @@ get_replies(double time_limit, int min_playouts, struct board *b) if (reply_count == 0) continue; if (reply_count >= active_slaves) return; if (time_limit) { - now = time_now(); - if (now >= time_limit) break; + if (time_now() >= time_limit) break; } else { int playouts, threads; struct move_stats s; @@ -411,7 +409,7 @@ get_replies(double time_limit, int min_playouts, struct board *b) char buf[1024]; snprintf(buf, sizeof(buf), "get_replies timeout %.3f >= %.3f, replies %d < active %d\n", - now - start_time, time_limit - start_time, reply_count, active_slaves); + time_now() - start_time, time_limit - start_time, reply_count, active_slaves); logline(NULL, "? ", buf); } assert(reply_count > 0); -- 2.11.4.GIT