MCPcopy Create free account
hub / github.com/csmith-project/csmith / SwitchRndNumGenerator

Method SwitchRndNumGenerator

src/RandomNumber.cpp:108–124  ·  view source on GitHub ↗

* Currently we can't switch to SeqRandom mode from other mode, * because we need a way to specify sequence numbers anyway. */

Source from the content-addressed store, hash-verified

106 * because we need a way to specify sequence numbers anyway.
107 */
108RNDNUM_GENERATOR
109RandomNumber::SwitchRndNumGenerator(RNDNUM_GENERATOR rImpl)
110{
111 unsigned int count = AbsRndNumGenerator::count();
112 AbsRndNumGenerator *generator = instance_->generators_[rImpl];
113 if (generator == NULL) {
114 generator = AbsRndNumGenerator::make_rndnum_generator(rImpl, instance_->seed_);
115 assert(generator);
116 instance_->generators_[rImpl] = generator;
117 }
118
119 RNDNUM_GENERATOR old = instance_->curr_generator_->kind();
120 assert(static_cast<unsigned int>(old) < count);
121
122 instance_->curr_generator_ = generator;
123 return old;
124}
125
126std::string
127RandomNumber::get_prefixed_name(const std::string &name)

Callers

nothing calls this directly

Calls 1

kindMethod · 0.45

Tested by

no test coverage detected