From ac7d787b08e14f324bb30ef51f268a6ff65c09f3 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Fri, 18 May 2012 16:49:48 +0200 Subject: [PATCH] fast_frandom() always returns float, not floating_t Noticed by Michael Williams. --- ownermap.c | 1 + random.c | 4 ++-- random.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ownermap.c b/ownermap.c index c993489..9f8b392 100644 --- a/ownermap.c +++ b/ownermap.c @@ -61,6 +61,7 @@ board_ownermap_judge_groups(struct board *b, struct board_ownermap *ownermap, st if (!g) continue; enum point_judgement pj = board_ownermap_judge_point(ownermap, c, judge->thres); + // assert(judge->gs[g] == GS_NONE || judge->gs[g] == pj); if (pj == PJ_UNKNOWN) { /* Fate is uncertain. */ judge->gs[g] = GS_UNKNOWN; diff --git a/random.c b/random.c index 20457ea..0e2309b 100644 --- a/random.c +++ b/random.c @@ -33,7 +33,7 @@ fast_random(unsigned int max) return ((pmseed & 0xffff) * max) >> 16; } -floating_t +float fast_frandom(void) { /* Construct (1,2) IEEE floating_t from our random integer */ @@ -85,7 +85,7 @@ fast_random(unsigned int max) return ((pmseed & 0xffff) * max) >> 16; } -floating_t +float fast_frandom(void) { /* Construct (1,2) IEEE floating_t from our random integer */ diff --git a/random.h b/random.h index 77b169b..d00a4a4 100644 --- a/random.h +++ b/random.h @@ -14,7 +14,7 @@ uint16_t fast_random(unsigned int max); static uint32_t fast_irandom(unsigned int max); /* Get random number in [0..1] range. */ -floating_t fast_frandom(); +float fast_frandom(); static inline uint32_t -- 2.11.4.GIT