Commit 3866f884 authored by hkrishna's avatar hkrishna

warning fixes for engine directory

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@23639 18c085ea-50e0-402c-830e-de6fd14e8384
parent fab8851c
......@@ -225,8 +225,9 @@ protected:
<< " [" << minmax[0] << ", " << minmax[1] << "]" << endl;
std::vector<VISIT_LONG_LONG> hist(256, 0);
if(!avtDatasetExaminer::CalculateHistogram(ds, it->first, minmax[0], minmax[1], hist))
if(!avtDatasetExaminer::CalculateHistogram(ds, it->first, minmax[0], minmax[1], hist)) {
debug1 << "CalculateHistogram failed" << endl;
}
it->second = new Histogram;
for(int i = 0; i < 256; ++i)
......@@ -611,7 +612,7 @@ CumulativeQuery<CQCellIdentifier,
delete [] allIds;
delete [] allFrequencies;
for( int ts=0; ts<selectionPerTimeStep.size(); ++ts )
for( size_t ts=0; ts<selectionPerTimeStep.size(); ++ts )
{
delete [] allIdsPerTimeStep[ts];
delete [] allVariablesPerTimeStep[ts];
......@@ -856,11 +857,11 @@ CumulativeQuery<CQCellIdentifier, CQSelection>::Summation(
typename CQSelection::const_iterator it;
for(it = cellFrequency.begin(); it != cellFrequency.end(); ++it)
{
if(it->second.frequency == nts)
if((unsigned int)it->second.frequency == nts)
{
selection[it->first] = it->second;
for( int ts=0; ts<nts; ++ts )
for( unsigned int ts=0; ts<nts; ++ts )
{
// cellsPerTimeStep is a const but the [] operator
// is not a const so use find instead which is a
......@@ -884,7 +885,7 @@ CumulativeQuery<CQCellIdentifier, CQSelection>::Summation(
{
selection = cellFrequency;
for( int ts=0; ts<nts; ++ts )
for( unsigned int ts=0; ts<nts; ++ts )
selectionPerTimeStep[ts] = cellsPerTimeStep[ts];
}
}
......@@ -1517,7 +1518,7 @@ CumulativeQuery<CQCellIdentifier, CQSelection>::SelectAndHistogram(
double *allVariables = new double[totalCells];
int *index = new int[totalCells];
int i = 0;
//int i = 0;
// Create an index variable that we'll sort using another variable
// while storing the variables and ids in a one dimensional array.
......@@ -2597,7 +2598,7 @@ GetSelectionEx(avtDataObject_p dob, avtContract_p contract, const SelectionPrope
// the variables that we care about.
//
hist.SetInput(newdob);
for(int i = 0; i < prop2.GetVariables().size(); ++i)
for(size_t i = 0; i < prop2.GetVariables().size(); ++i)
hist.AddVariable(prop2.GetVariables()[i]);
newdob = hist.GetOutput();
......@@ -2701,7 +2702,7 @@ avtNamedSelection *
CumulativeQueryNamedSelectionExtension::GetSelection(avtDataObject_p dob,
const SelectionProperties &props, avtNamedSelectionCache &cache)
{
const char *mName = "CumulativeQueryNamedSelectionExtension::GetSelection: ";
//const char *mName = "CumulativeQueryNamedSelectionExtension::GetSelection: ";
avtNamedSelection *ns = NULL;
avtContract_p c0 = dob->GetContractFromPreviousExecution();
......
......@@ -128,7 +128,7 @@ DataNetwork::~DataNetwork(void)
if (!clone)
{
ReleaseData();
for (int i = 0 ; i < nodeList.size() ; i++)
for (size_t i = 0 ; i < nodeList.size() ; i++)
{
delete nodeList[i];
}
......
This diff is collapsed.
......@@ -1409,7 +1409,7 @@ RPCExecutor<DefineVirtualDatabaseRPC>::Execute(DefineVirtualDatabaseRPC *rpc)
<< ", time=" << rpc->GetTime()
<< ", numStates=" << rpc->GetDatabaseFiles().size()
<< endl;
for (int i = 0; i < rpc->GetDatabaseFiles().size(); ++i)
for (size_t i = 0; i < rpc->GetDatabaseFiles().size(); ++i)
debug5 << "file["<<i<<"]="<<rpc->GetDatabaseFiles()[i].c_str() << endl;
TRY
......@@ -1495,7 +1495,7 @@ RPCExecutor<RenderRPC>::Execute(RenderRPC *rpc)
debug2 << "Executing RenderRPC for the following plots" << endl;
debug2 << " ";
for (int i = 0; i < rpc->GetIDs().size(); i++)
for (size_t i = 0; i < rpc->GetIDs().size(); i++)
debug2 << rpc->GetIDs()[i] << ", ";
debug2 << endl;
......
......@@ -327,7 +327,7 @@ IceTNetworkManager::Render(bool checkThreshold, intVector networkIds, bool getZB
this->RenderSetup(networkIds, getZBuffer, annotMode, windowID, leftEye);
bool plotDoingTransparencyOutsideTransparencyActor = false;
for(int i = 0 ; i < networkIds.size() ; i++)
for(size_t i = 0 ; i < networkIds.size() ; i++)
{
workingNet = NULL;
UseNetwork(networkIds[i]);
......
......@@ -603,6 +603,7 @@ LoadBalancer::Reduce(avtContract_p input)
// data replication.
//
bool dataReplicationRequested = input->ReplicateSingleDomainOnAllProcessors();
(void) dataReplicationRequested; /// variable used in parallel env..
input->SetReplicateSingleDomainOnAllProcessors(false);
//
......@@ -649,7 +650,7 @@ LoadBalancer::Reduce(avtContract_p input)
UpdateProgress(pipelineInfo[input->GetPipelineIndex()].current,
(int)list.size());
pipelineInfo[input->GetPipelineIndex()].current++;
if (pipelineInfo[input->GetPipelineIndex()].current == list.size())
if (pipelineInfo[input->GetPipelineIndex()].current == (int)list.size())
pipelineInfo[input->GetPipelineIndex()].complete = true;
return new_data;
}
......@@ -707,7 +708,7 @@ LoadBalancer::Reduce(avtContract_p input)
UpdateProgress(pipelineInfo[input->GetPipelineIndex()].current,
domainListForStreaming.size());
pipelineInfo[input->GetPipelineIndex()].current++;
if (pipelineInfo[input->GetPipelineIndex()].current == domainListForStreaming.size())
if (pipelineInfo[input->GetPipelineIndex()].current == (int)domainListForStreaming.size())
{
pipelineInfo[input->GetPipelineIndex()].complete = true;
domainListForStreaming.clear();
......@@ -762,15 +763,15 @@ LoadBalancer::Reduce(avtContract_p input)
}
else if (theScheme == LOAD_BALANCE_STRIDE_ACROSS_BLOCKS)
{
for (int j = 0 ; j < list.size() ; j++)
for (size_t j = 0 ; j < list.size() ; j++)
{
if (j % nProcs == rank)
if (j % nProcs == (size_t)rank)
mylist.push_back(list[j]);
}
}
else if (theScheme == LOAD_BALANCE_ABSOLUTE)
{
for (int j = 0 ; j < list.size() ; j++)
for (size_t j = 0 ; j < list.size() ; j++)
{
if (list[j] % nProcs == rank)
mylist.push_back(list[j]);
......@@ -782,9 +783,9 @@ LoadBalancer::Reduce(avtContract_p input)
IOInfo &ioInfo(ioMap[lbInfo.db]);
const HintList &hints(ioInfo.ioInfo.GetHints());
for (int j = 0 ; j < list.size() ; j++)
for (size_t j = 0 ; j < list.size() ; j++)
{
if (hints.size() >= rank)
if (hints.size() >= (size_t)rank)
{
const vector<int> &doms = hints[rank];
int ndoms = doms.size();
......@@ -804,7 +805,7 @@ LoadBalancer::Reduce(avtContract_p input)
// all procs randomly jumble the list of domain ids
// all procs compute same jumbled list due to same seed
// [ which won't be true on a heterogeneous platform ]
int j;
size_t j;
vector<int> jumbledList = list;
srand(0xDeadBeef);
for (j = 0 ; j < list.size() * 5; j++)
......@@ -818,7 +819,7 @@ LoadBalancer::Reduce(avtContract_p input)
// now, do round-robin assignment from the jumbled list
for (j = 0 ; j < list.size() ; j++)
{
if (j % nProcs == rank)
if (j % nProcs == (size_t)rank)
mylist.push_back(jumbledList[j]);
}
}
......@@ -854,7 +855,7 @@ LoadBalancer::Reduce(avtContract_p input)
trav.GetDomainList(domainList);
// Make a work list and a completed list
int totaldomains = domainList.size();
size_t totaldomains = domainList.size();
deque<int> incomplete(domainList.begin(), domainList.end());
vector<int> complete;
......@@ -934,7 +935,7 @@ LoadBalancer::Reduce(avtContract_p input)
// count the number of processors which have
// this file opened
int nopen = 0;
for (int j=0; j<ioInfo.files.size(); j++)
for (size_t j=0; j<ioInfo.files.size(); j++)
if (ioInfo.files[j].count(fileno) > 0)
nopen++;
if (nopen < minopen)
......@@ -1082,18 +1083,19 @@ LoadBalancer::AddDatabase(const string &db, avtDatabase *db_ptr, int time)
debug4 << "LoadBalancer::AddDatabase - db=" << db.c_str() << endl;
debug4 << " iohints=[";
const HintList &hints = io.GetHints();
for (int i=0; i<hints.size(); i++)
for (size_t i=0; i<hints.size(); i++)
{
debug4 << " {";
for (int j=0; j<hints[i].size(); j++)
for (size_t j=0; j<hints[i].size(); j++)
{
ioMap[db].fileMap[hints[i][j]] = i;
debug4 << hints[i][j];
if (j<hints[i].size()-1) debug4 << ",";
if (j<hints[i].size()-1) { debug4 << ","; }
}
debug4 << "}";
if (i<hints.size()-1)
if (i<hints.size()-1) {
debug4 << "\n ";
}
}
debug4 << "] " << endl;
}
......@@ -1141,7 +1143,7 @@ LoadBalancer::AddPipeline(const string &db)
void
LoadBalancer::ResetPipeline(int index)
{
if (index < 0 || index >= pipelineInfo.size())
if (index < 0 || (size_t)index >= pipelineInfo.size())
{
debug1 << "Given an invalid pipeline index to reset (" << index << ")."
<< endl;
......
......@@ -267,7 +267,7 @@ MPIXfer::Process()
{
if(PAR_UIProcess())
{
int i, msgLength = curLength + sizeof(int)*2;
size_t i, msgLength = curLength + sizeof(int)*2;
#ifdef VISIT_BLUE_GENE_P
// Make the buffer be 32-byte aligned
unsigned char *buf = 0;
......@@ -464,8 +464,9 @@ MPIXfer::VisIt_MPI_Bcast(void *buf, int count, MPI_Datatype datatype, int root,
if (nanoSecsOfSleeps <= 0)
{
static bool first = true;
if (first)
if (first) {
debug5 << "Using MPI's Bcast; not VisIt_MPI_Bcast" << endl;
}
first = false;
MPI_Bcast(buf, count, datatype, root, comm);
return 2;
......@@ -539,9 +540,10 @@ MPIXfer::VisIt_MPI_Bcast(void *buf, int count, MPI_Datatype datatype, int root,
double idleTime = TOA_THIS_LINE - startedIdlingAt;
if (idleTime > secsOfSpinBeforeSleeps)
{
if (first)
if (first) {
debug5 << "VisIt_MPI_Bcast started using " << nanoSecsOfSleeps / 1.0e9
<< " seconds of nanosleep" << endl;
}
first = false;
#if defined(_WIN32)
SleepEx((DWORD)(nanoSecsOfSleeps/1e6), false);
......
......@@ -251,7 +251,7 @@ NetnodeFilter::ReleaseData(void)
filter->ReleaseData();
// Release the data for my inputs.
for (int i = 0; i < inputNodes.size(); i++)
for (size_t i = 0; i < inputNodes.size(); i++)
inputNodes[i]->ReleaseData();
}
......
......@@ -685,7 +685,7 @@ NetworkManager::GetDBFromCache(const std::string &filename, int time,
#if defined(_WIN32)
_getcwd(tmpcwd, 1023);
#else
getcwd(tmpcwd, 1023);
char* res = getcwd(tmpcwd, 1023); (void) res;
#endif
tmpcwd[1023] = '\0';
......@@ -705,7 +705,7 @@ NetworkManager::GetDBFromCache(const std::string &filename, int time,
#if defined(_WIN32)
_chdir(path.c_str());
#else
chdir(path.c_str());
int res = chdir(path.c_str()); (void) res;
#endif
}
// look for files that match pattern
......@@ -726,7 +726,7 @@ NetworkManager::GetDBFromCache(const std::string &filename, int time,
#if defined(_WIN32)
_chdir(oldPath.c_str());
#else
chdir(oldPath.c_str());
int res = chdir(oldPath.c_str()); (void) res;
#endif
}
......@@ -1671,7 +1671,7 @@ NetworkManager::EndNetwork(int windowID)
{
const std::string &selName = workingNet->GetSelectionName();
std::vector<Netnode *> netnodes = workingNet->GetNodeList();
for (int i = 0 ; i < netnodes.size() ; i++)
for (size_t i = 0 ; i < netnodes.size() ; i++)
{
avtFilter *filt = netnodes[i]->GetFilter();
if (filt == NULL)
......@@ -1763,7 +1763,7 @@ NetworkManager::UseNetwork(int id)
EXCEPTION0(ImproperUseException);
}
if (id >= networkCache.size())
if ((size_t)id >= networkCache.size())
{
debug1 << "Internal error: asked to reuse network ID (" << id
<< " >= num saved networks (" << networkCache.size() << ")"
......@@ -2077,7 +2077,7 @@ NetworkManager::GetShouldUseCompression(int windowID) const
void
NetworkManager::DoneWithNetwork(int id)
{
if (id >= networkCache.size())
if ((size_t)id >= networkCache.size())
{
debug1 << "Internal error: Done with network ID (" << id
<< " >= num saved networks (" << networkCache.size() << ")"
......@@ -2100,7 +2100,7 @@ NetworkManager::DoneWithNetwork(int id)
bool otherNetsUseThisWindow = false;
for (size_t i = 0; i < networkCache.size(); i++)
{
if (i == id)
if (i == (size_t)id)
continue;
if (networkCache[i] && (thisNetworksWinID ==
networkCache[i]->GetWinID()))
......@@ -2156,7 +2156,7 @@ NetworkManager::DoneWithNetwork(int id)
void
NetworkManager::UpdatePlotAtts(int id, const AttributeGroup *atts)
{
if (id >= networkCache.size())
if ((size_t)id >= networkCache.size())
{
debug1 << "Internal error: asked to reuse network ID (" << id
<< ") >= num saved networks (" << networkCache.size() << ")"
......@@ -2845,7 +2845,7 @@ NetworkManager::SaveWindow(const intVector &ids,
if(networkCache.size() > 0)
{
DataNetwork *net = networkCache[networkIds[0]];
int id = net->GetNetID();
//int id = net->GetNetID();
// We need to update the view so we can see what we have. This is
// not quite the method I wanted to use to get the data attributes
......@@ -3608,7 +3608,7 @@ NetworkManager::StopQueryMode(void)
void
NetworkManager::Pick(const int id, const int winId, PickAttributes *pa)
{
if (id >= networkCache.size())
if ((size_t)id >= networkCache.size())
{
debug1 << "Internal error: asked to use network ID (" << id << ") >= "
<< "num saved networks (" << networkCache.size() << ")" << endl;
......@@ -3967,7 +3967,7 @@ NetworkManager::Query(const std::vector<int> &ids, QueryAttributes *qa)
for (size_t i = 0 ; i < ids.size() ; i++)
{
int id = ids[i];
if (id >= networkCache.size())
if ((size_t)id >= networkCache.size())
{
debug1 << "Internal error: asked to use network ID (" << id
<< ") >= num saved networks ("
......@@ -4113,7 +4113,7 @@ NetworkManager::CreateNamedSelection(int id, const SelectionProperties &props)
{
// The selection source is a plot that has been executed.
if (id >= networkCache.size())
if ((size_t)id >= networkCache.size())
{
debug1 << mName << "Internal error: asked to use network ID (" << id
<< ") >= num saved networks ("
......@@ -4402,7 +4402,7 @@ NetworkManager::SaveNamedSelection(const std::string &selName)
void
NetworkManager::ConstructDataBinning(int id, ConstructDataBinningAttributes *atts)
{
if (id >= networkCache.size())
if ((size_t)id >= networkCache.size())
{
debug1 << "Internal error: asked to use network ID (" << id
<< ") >= num saved networks ("
......@@ -4598,7 +4598,7 @@ NetworkManager::ExportDatabases(const intVector &ids, ExportDBAttributes *atts)
void
NetworkManager::ExportSingleDatabase(int id, ExportDBAttributes *atts)
{
if (id >= networkCache.size())
if ((size_t)id >= networkCache.size())
{
debug1 << "Internal error: asked to use network ID (" << id
<< ") >= num saved networks ("
......@@ -4798,7 +4798,7 @@ NetworkManager::CloneNetwork(const int id)
EXCEPTION1(ImproperUseException,error);
}
if (id >= networkCache.size())
if ((size_t)id >= networkCache.size())
{
debug1 << "Internal error: asked to clone network ID (" << id
<< ") >= num saved networks (" << networkCache.size() << ")"
......@@ -5331,7 +5331,7 @@ BuildBlankImageVector(avtImage_p img)
MPI_Bcast(rcv, PAR_Size(), MPI_INT, src_node, VISIT_MPI_COMM);
data.reserve(PAR_Size());
for(size_t i = 0 ; i < PAR_Size(); ++i)
for(size_t i = 0 ; i < (size_t)PAR_Size(); ++i)
{
data.push_back(rcv[i]);
}
......@@ -5577,7 +5577,7 @@ NetworkManager::PickForIntersection(const int winId, PickAttributes *pa)
bool needRender = false;
for (size_t i = 0; i < ids.size(); i++)
{
if (ids[i] >= networkCache.size())
if ((size_t)ids[i] >= networkCache.size())
{
debug1 << "Internal error: asked to use network ID ("
<< ids[i] << ") >= " << "num saved networks ("
......
......@@ -336,8 +336,9 @@ EngineMain(int argc, char *argv[])
}
}
if (DebugStream::Level1())
if (DebugStream::Level1()) {
debug1 << "ENGINE exited." << endl;
}
engine->Finalize();
#ifdef DEBUG_MEMORY_LEAKS
......
......@@ -471,13 +471,15 @@ EngineMethods::Execute(bool respondWithNull, void (*waitCB)(void *), void *cbDat
int readData = visitTimer->StartTimer();
if(engineP != NULL)
{
if (engineP->GetReadConnection(1)->DirectRead((unsigned char *)buf, size) < 0)
if (engineP->GetReadConnection(1)->DirectRead((unsigned char *)buf, size) < 0) {
debug1 << "Error reading VTK data!!!!\n";
}
}
else if(component != NULL)
{
if (component->GetWriteConnection(1)->DirectRead((unsigned char *)buf, size) < 0)
if (component->GetWriteConnection(1)->DirectRead((unsigned char *)buf, size) < 0) {
debug1 << "Error reading VTK data!!!!\n";
}
}
char msg[128];
......@@ -716,13 +718,15 @@ EngineMethods::Render(bool sendZBuffer, const intVector& networkIDs,
if(engineP != NULL)
{
if (engineP->GetReadConnection(1)->DirectRead((unsigned char *)buf, size) < 0)
if (engineP->GetReadConnection(1)->DirectRead((unsigned char *)buf, size) < 0) {
debug1 << "Error reading VTK data!!!!\n";
}
}
else if(component != NULL)
{
if (component->GetWriteConnection(1)->DirectRead((unsigned char *)buf, size) < 0)
if (component->GetWriteConnection(1)->DirectRead((unsigned char *)buf, size) < 0) {
debug1 << "Error reading VTK data!!!!\n";
}
}
// The data object reader will clean up the memory with buf.
......
......@@ -374,7 +374,7 @@ EngineProxy::ExtractEngineInformation()
// and parse them out so we can query their values in the
// engine proxy.
//
for(int i = 0; i < argv.size(); ++i)
for(size_t i = 0; i < argv.size(); ++i)
{
if(argv[i] == "-np" && (i+1) < argv.size())
{
......@@ -596,12 +596,14 @@ EngineProxy::SendKeepAlive()
unsigned char buf[KEEPALIVE_SIZE];
if(engineP != NULL)
{
if (engineP->GetReadConnection(1)->DirectRead(buf, KEEPALIVE_SIZE) < 0)
if (engineP->GetReadConnection(1)->DirectRead(buf, KEEPALIVE_SIZE) < 0) {
debug1 << "Error reading keep alive data from engine!!!!\n";
}
}
else
{
if (component->GetWriteConnection(1)->DirectRead(buf, KEEPALIVE_SIZE) < 0)
if (component->GetWriteConnection(1)->DirectRead(buf, KEEPALIVE_SIZE) < 0) {
debug1 << "Error reading keep alive data from engine!!!!\n";
}
}
}
......@@ -45,7 +45,7 @@ EngineState::SetupComponentRPCs(Xfer* xfer)
//
// Add RPCs to the transfer object.
//
for(int i = 0; i < GetNumStateObjects(); ++i)
for(size_t i = 0; i < GetNumStateObjects(); ++i)
xfer->Add(GetStateObject(i));
//xfer->Add(&exprList); TODO: PUT THIS BACK when Engine.C xfer->Add(l->GetList()); is fixed..
}
......@@ -59,7 +59,7 @@ EngineState::GetNumStateObjects()
VisItRPC*
EngineState::GetStateObject(int i)
{
return (i >= 0 && i < objVector.size()) ?
return (i >= 0 && (size_t)i < objVector.size()) ?
objVector[i] : 0;
}
......@@ -335,7 +335,7 @@ SetWinAnnotAttsRPC::SetVisualCueList(const VisualCueList* cueList)
void
SetWinAnnotAttsRPC::SetFrameAndState(const int *frameAndState)
{
for (int i = 0; i < sizeof(fands)/sizeof(fands[0]); i++)
for (size_t i = 0; i < sizeof(fands)/sizeof(fands[0]); i++)
fands[i] = frameAndState[i];
Select(5, (void*)fands, sizeof(fands)/sizeof(fands[0]));
}
......@@ -351,7 +351,7 @@ SetWinAnnotAttsRPC::SetFrameAndState(const int *frameAndState)
void
SetWinAnnotAttsRPC::SetViewExtents(const double *viewExtents)
{
for (int i = 0; i < sizeof(vexts)/sizeof(vexts[0]); i++)
for (size_t i = 0; i < sizeof(vexts)/sizeof(vexts[0]); i++)
vexts[i] = viewExtents[i];
Select(6, (void*)vexts, sizeof(vexts)/sizeof(vexts[0]));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment