| It seems like it should do the middle branch first, i.e.:
if (*p->out == 0.0) { seedVal = (uint32_t)csound->GetRandomSeedFromTime(); csound->Warning(csound, Str("Seeding from current time %u\n"), (unsigned int)seedVal);
} else if (*p->out > FL(0.0)) seedVal = (uint32_t)((double)*p->out + 0.5); else csound->Warning(csound, Str("Seeding with %u\n"), (unsigned int)seedVal);
On Fri Dec 05 2014 at 2:45:34 PM jpff < jpff@codemist.co.uk> wrote: Code says
int seedrand(CSOUND *csound, PRAND *p)
{
uint32_t seedVal = (uint32_t)0;
if (*p->out > FL(0.0))
seedVal = (uint32_t)((double)*p->out + 0.5);
else if (!seedVal) {
seedVal = (uint32_t)csound->GetRandomSeedFromTime();
csound->Warning(csound, Str("Seeding from current time %u\n"),
(unsigned int)seedVal);
}
else
csound->Warning(csound, Str("Seeding with %u\n"), (unsigned int)seedVal);
Coverity asserts correctly in my opinion that te warning message can
never happen. I do not seem to be able to unwrap thisat present;
maybe reading
else if (!p->out) {
there? Help welcome
==John ffitch
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel
|