Index: src/base/Histogram.cc =================================================================== RCS file: /usr/local/CVS/polygraph/src/base/Histogram.cc,v retrieving revision 1.2.2.1 diff -u -r1.2.2.1 Histogram.cc --- src/base/Histogram.cc 2000/06/19 05:53:53 1.2.2.1 +++ src/base/Histogram.cc 2000/11/29 18:05:46 @@ -109,7 +109,7 @@ Assert(theValMax == vmax); Assert(theBinMax == bmax); - if (const bool savedSpace = log.getb()) { + if (log.getb()) { const int binCount = log.geti(); const int busyCount = log.geti(); Assert(binCount == theBins.count()); Index: src/client/Client.cc =================================================================== RCS file: /usr/local/CVS/polygraph/src/client/Client.cc,v retrieving revision 1.2.2.19 diff -u -r1.2.2.19 Client.cc --- src/client/Client.cc 2000/07/24 20:40:15 1.2.2.19 +++ src/client/Client.cc 2000/11/29 18:05:46 @@ -309,9 +309,9 @@ TheXacts->put(x); } -CltXact *Client::genXact(const OidRec &or) { +CltXact *Client::genXact(const OidRec &oidRec) { CltXact *x = TheXacts->get(); - x->oidRec(or); + x->oidRec(oidRec); return x; } @@ -326,18 +326,18 @@ if (sidx < 0) sidx = (int)theCfg->theOriginSel->trial(); - OidRec or; - or.hidx = TheServers[sidx]->hostIdx(); + OidRec oidRec; + oidRec.hidx = TheServers[sidx]->hostIdx(); - genOid(or); - return genXact(or); + genOid(oidRec); + return genXact(oidRec); } -void Client::genOid2(OidRec &or) { - ServerRep &srvRep = *GetServerRep(or.hidx); +void Client::genOid2(OidRec &oidRec) { + ServerRep &srvRep = *GetServerRep(oidRec.hidx); PrivWorld &privWorld = thePrivWorlds[srvRep.serverIdx()]; OidGenStat &oidGenStat = TheStatPhaseMgr->oidGenStat(); - //cerr << here << "pid: " << theId << " server: " << or.hidx << " sidx: " << srvRep.serverIdx() << " wid: " << srvRep.id() << " sec oid: " << srvRep.secOid() << endl; + //cerr << here << "pid: " << theId << " server: " << oidRec.hidx << " sidx: " << srvRep.serverIdx() << " wid: " << srvRep.id() << " sec oid: " << srvRep.secOid() << endl; const bool forcePubOid = srvRep.secOid() <= 0 && srvRep.haveNewOids(); @@ -362,33 +362,33 @@ // the logic gives priority to repeatOid goal rather than to genPubOid if (canRep && (repeatOid || !canNew)) { - or.repeat(true); + oidRec.repeat(true); bool hot = false; if (pubCanRep && (genPubOid || !privCanRep)) { - or.wid = srvRep.id(); // use server id - or.oid = theCfg->thePopModel->choose(rng, + oidRec.wid = srvRep.id(); // use server id + oidRec.oid = theCfg->thePopModel->choose(rng, pubOid, pubWss, srvRep.hotSetPos(), hot); oidGenStat.recordGen(true, true); - or.hot(hot); + oidRec.hot(hot); return; } Assert(privCanRep); - or.wid = theId; // use this robot id - or.oid = theCfg->thePopModel->choose(rng, + oidRec.wid = theId; // use this robot id + oidRec.oid = theCfg->thePopModel->choose(rng, privOid, privWss, privWorld.hotSetPos(), hot); oidGenStat.recordGen(true, false); - or.hot(hot); + oidRec.hot(hot); return; } - or.repeat(false); - or.hot(false); + oidRec.repeat(false); + oidRec.hot(false); if (pubCanNew && (genPubOid || !privCanNew)) { - or.wid = srvRep.id(); // use server id - or.oid = srvRep.newOid(); + oidRec.wid = srvRep.id(); // use server id + oidRec.oid = srvRep.newOid(); oidGenStat.recordGen(false, true); return; } @@ -397,20 +397,20 @@ srvRep.noteNoNewOids(); // new private object (last resort, never fails) - or.wid = theId; // use this robot id - or.oid = privWorld.nextObjName(); + oidRec.wid = theId; // use this robot id + oidRec.oid = privWorld.nextObjName(); oidGenStat.recordGen(false, false); } -void Client::genOid(OidRec &or) { - genOid2(or); +void Client::genOid(OidRec &oidRec) { + genOid2(oidRec); if (theCfg->genUniqUrls) - or.wid = UniqId::Create(); // changes every time - const HostCfg *hcfg = TheHostMap->at(or.hidx); + oidRec.wid = UniqId::Create(); // changes every time + const HostCfg *hcfg = TheHostMap->at(oidRec.hidx); Assert(hcfg); Assert(hcfg->theContent); - const ContentCfg *ccfg = hcfg->theContent->getDir(or); - or.tid = ccfg->id(); + const ContentCfg *ccfg = hcfg->theContent->getDir(oidRec); + oidRec.tid = ccfg->id(); } int Client::genReqType() { @@ -421,12 +421,12 @@ return rtpBasic; } -void Client::noteEmbedded(CltXact *, const OidRec &or) { +void Client::noteEmbedded(CltXact *, const OidRec &oidRec) { static RndGen rng; if (!rng.event(theCfg->theEmbedRecurRatio)) return; - if (tryLaunch(genXact(or))) + if (tryLaunch(genXact(oidRec))) theExtraLaunchLvl++; } Index: src/pgl/popDistrs.cc =================================================================== RCS file: /usr/local/CVS/polygraph/src/pgl/popDistrs.cc,v retrieving revision 1.1.2.2 diff -u -r1.1.2.2 popDistrs.cc --- src/pgl/popDistrs.cc 2000/06/19 05:54:05 1.1.2.2 +++ src/pgl/popDistrs.cc 2000/11/29 18:05:46 @@ -35,7 +35,8 @@ } int ZipfPopDistr::choose(RndGen &rng, int lastOid) { - return 1 + lastOid - (int)pow(lastOid+1, pow(rng(),theSkew)); + const double t = rng(); + return 1 + lastOid - (int)pow(lastOid+1, pow(t,theSkew)); } ostream &ZipfPopDistr::print(ostream &os) const { Index: src/tools/pop_test.cc =================================================================== RCS file: /usr/local/CVS/polygraph/src/tools/pop_test.cc,v retrieving revision 1.1.2.1 diff -u -r1.1.2.1 pop_test.cc --- src/tools/pop_test.cc 2000/06/19 05:54:09 1.1.2.1 +++ src/tools/pop_test.cc 2000/11/29 18:05:46 @@ -246,7 +246,8 @@ int Zipf(double alpha, RndGen &rng, int lastOid) { - return (int)pow(lastOid+1, pow(rng(),alpha)); + const double t = rng(); + return (int)pow(lastOid+1, pow(t,alpha)); } static Index: src/xparser/GLexer.cc =================================================================== RCS file: /usr/local/CVS/polygraph/src/xparser/GLexer.cc,v retrieving revision 1.1.1.1.2.1 diff -u -r1.1.1.1.2.1 GLexer.cc --- src/xparser/GLexer.cc 2000/06/19 05:54:09 1.1.1.1.2.1 +++ src/xparser/GLexer.cc 2000/11/29 18:05:46 @@ -11,6 +11,7 @@ #include "xparser.h" +#include "Assert.h" #include "GLexer.h" GLexer::GLexer(istream &aSource, const String &aFName): Index: src/xstd/gadgets.h =================================================================== RCS file: /usr/local/CVS/polygraph/src/xstd/gadgets.h,v retrieving revision 1.1.2.1 diff -u -r1.1.2.1 gadgets.h --- src/xstd/gadgets.h 2000/06/19 05:54:13 1.1.2.1 +++ src/xstd/gadgets.h 2000/11/29 18:05:46 @@ -12,6 +12,8 @@ #ifndef XSTD_GADGETS_H #define XSTD_GADGETS_H +#include + class ostream; // abs, min, and max Index: src/xstd/rndDistrs.cc =================================================================== RCS file: /usr/local/CVS/polygraph/src/xstd/rndDistrs.cc,v retrieving revision 1.1.1.1.2.1 diff -u -r1.1.1.1.2.1 rndDistrs.cc --- src/xstd/rndDistrs.cc 2000/06/19 05:54:13 1.1.1.1.2.1 +++ src/xstd/rndDistrs.cc 2000/11/29 18:05:46 @@ -83,7 +83,9 @@ static const double TheEMConst = 0.57721566490153286060651209; double ZipfDistr::trial() { - return floor(pow(theWorldCap+1, theGen->trial())); +// return floor(pow(theWorldCap+1, theGen->trial())); + const double t = theGen->trial(); + return floor(pow(theWorldCap+1,t)); } int ZipfDistr::ltrial(int min, int max) { @@ -92,7 +94,8 @@ // wrong: [min, max) // [min, max] min--; - return min + (int) floor(pow(max-min+1, theGen->trial())); + const double t = theGen->trial(); + return min + (int) floor(pow(max-min+1, t)); } double ZipfDistr::omega() const {