X-Git-Url: https://git.draconx.ca/gitweb/cdecl99.git/blobdiff_plain/32785fcd767c52ce826f8f0ed4232360e458f118..02413704070c34bec00184120c4728854671d2d5:/test/declgen.c diff --git a/test/declgen.c b/test/declgen.c index 4fb39cb..c02613a 100644 --- a/test/declgen.c +++ b/test/declgen.c @@ -150,21 +150,15 @@ struct cdecl_declspec *gen_storspecs(struct gen_rng *rng, bool registeronly) * Generate random type specifiers. There is a short list of valid * combinations, from which we can select one uniformly at random. */ -static const unsigned long total_types; -static struct cdecl_declspec *gen_raw_typespecs(struct gen_rng *rng) -{ - switch (gsl_rng_uniform_int(rng->rng, total_types)) { -# include "typegen.h" - } -} -static const unsigned long total_types = TOTAL_TYPES; +#include "typegen.h" struct cdecl_declspec *gen_typespecs(struct gen_rng *rng, bool voidtype) { struct cdecl_declspec *specs; retry: - specs = gen_raw_typespecs(rng); + specs = gen_raw_typespecs(gsl_rng_uniform_int(rng->rng, + GEN_TOTAL_TYPES)); switch (specs->type) { /* void is not always valid, so we might need to pick again. */