public inbox for [email protected]  
help / color / mirror / Atom feed
From: Peter Eisentraut <[email protected]>
To: [email protected]
Subject: pgsql: pgbench: Make set_random_seed() 64-bit everywhere.
Date: Sat, 29 Mar 2025 14:31:17 +0000
Message-ID: <[email protected]> (raw)

pgbench: Make set_random_seed() 64-bit everywhere.

Delete an intermediate variable, a redundant cast, a use of long and a
use of long long.  scanf() the seed directly into a uint64, now that we
can do that with SCNu64 from <inttypes.h>.

The previous coding was from pre-C99 times when %lld might not have been
there, so it read into an unsigned long.  Therefore behavior varied
by OS, and --random-seed would accept either 32 or 64 bit seeds.  Now
it's the same everywhere.

Author: Thomas Munro <[email protected]>
Discussion: https://postgr.es/m/b936d2fb-590d-49c3-a615-92c3a88c6c19%40eisentraut.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/53a2a1564ae450a46a7c565756ab536b84150e36

Modified Files
--------------
src/bin/pgbench/pgbench.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)



reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: pgsql: pgbench: Make set_random_seed() 64-bit everywhere.
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox