summaryrefslogtreecommitdiff
path: root/contrib/tsm_system_time/tsm_system_time.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/tsm_system_time/tsm_system_time.c')
-rw-r--r--contrib/tsm_system_time/tsm_system_time.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/contrib/tsm_system_time/tsm_system_time.c b/contrib/tsm_system_time/tsm_system_time.c
index 788d8f9a68d..36acc6c1060 100644
--- a/contrib/tsm_system_time/tsm_system_time.c
+++ b/contrib/tsm_system_time/tsm_system_time.c
@@ -69,7 +69,7 @@ static BlockNumber system_time_nextsampleblock(SampleScanState *node, BlockNumbe
static OffsetNumber system_time_nextsampletuple(SampleScanState *node,
BlockNumber blockno,
OffsetNumber maxoffset);
-static uint32 random_relative_prime(uint32 n, SamplerRandomState randstate);
+static uint32 random_relative_prime(uint32 n, pg_prng_state *randstate);
/*
@@ -224,25 +224,25 @@ system_time_nextsampleblock(SampleScanState *node, BlockNumber nblocks)
if (sampler->step == 0)
{
/* Initialize now that we have scan descriptor */
- SamplerRandomState randstate;
+ pg_prng_state randstate;
/* If relation is empty, there's nothing to scan */
if (nblocks == 0)
return InvalidBlockNumber;
/* We only need an RNG during this setup step */
- sampler_random_init_state(sampler->seed, randstate);
+ sampler_random_init_state(sampler->seed, &randstate);
/* Compute nblocks/firstblock/step only once per query */
sampler->nblocks = nblocks;
/* Choose random starting block within the relation */
/* (Actually this is the predecessor of the first block visited) */
- sampler->firstblock = sampler_random_fract(randstate) *
+ sampler->firstblock = sampler_random_fract(&randstate) *
sampler->nblocks;
/* Find relative prime as step size for linear probing */
- sampler->step = random_relative_prime(sampler->nblocks, randstate);
+ sampler->step = random_relative_prime(sampler->nblocks, &randstate);
}
/* Reinitialize lb and start_time */
@@ -330,7 +330,7 @@ gcd(uint32 a, uint32 b)
* (else return 1).
*/
static uint32
-random_relative_prime(uint32 n, SamplerRandomState randstate)
+random_relative_prime(uint32 n, pg_prng_state *randstate)
{
uint32 r;