Commit 43903430 authored by loring's avatar loring

clean up warnings in databases


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@23792 18c085ea-50e0-402c-830e-de6fd14e8384
parent b14d0c7d
......@@ -176,7 +176,7 @@ FichierU::FichierU(const string& fileName, ifstream* istr, long offset, long tai
if(_nbMat==-1) _nbMat = (int)_matNames.size();
else if( _nbMat!= (int) _matNames.size() )
{
cerr<<"Attention! "<<_nbMat<<"materiaux annoncs, mais seulement "<<_matNames.size()<<" dcris"<<endl;
cerr<<"Attention! "<<_nbMat<<"materiaux annonces, mais seulement "<<_matNames.size()<<" decris"<<endl;
}
}
else if(field=="EXIST_GD_CENTREES")
......
This diff is collapsed.
......@@ -1139,7 +1139,7 @@ avtFVCOMReader::PopulateDatabaseMetaData(avtDatabaseMetaData *md,
if (mesh3==true)
{
avtMeshMetaData *md_2D;
avtMeshMetaData *md_2D = NULL;
if(IsGeoRef)
md_2D = new avtMeshMetaData(TWOD_Mesh,
......
......@@ -271,8 +271,6 @@ avtPICS_TesterFileFormat::GetMesh(int timestate, int domain, const char *meshnam
EXCEPTION1(VisItException, "Invalid mesh requested!");
}
int i;
double sizePerBlock = 1.0/numBlocks[timestate];
int xOff = domain % numBlocks[timestate];
int yOff = (domain/numBlocks[timestate]) % numBlocks[timestate];
......@@ -407,7 +405,6 @@ avtPICS_TesterFileFormat::GetVar(int timestate, int domain, const char *varname)
vtkDataArray *
avtPICS_TesterFileFormat::GetVectorVar(int timestate, int domain,const char *varname)
{
int ncomps = 3;
int dims[3] = { numCells[timestate]+1, numCells[timestate]+1, numCells[timestate]+1 };
if (! is3D)
dims[2] = 1;
......
......@@ -1183,18 +1183,14 @@ int vtkVisItPLOT3DReader::ReadGridDimensions(FILE *fp,
int vtkVisItPLOT3DReader::FindNumberOfGrids(FILE *fp)
{
int numGrids;
if (this->GridType == MULTI_GRID || this->Compression == COMPRESSED_ASCII)
int numGrids = 1;
if ((this->GridType == MULTI_GRID) || (this->Compression == COMPRESSED_ASCII))
{
int error = ReadNumbers(fp,1,&numGrids);
if (error)
if (ReadNumbers(fp,1,&numGrids))
{
return 1;
}
}
else
numGrids = 1;
return numGrids;
}
......@@ -1203,7 +1199,6 @@ int vtkVisItPLOT3DReader::ReadSolution(FILE *fp,vtkStructuredGrid *output)
{
vtkFloatArray *newDensity, *newEnergy;
vtkFloatArray *newMomentum;
int i, gridFound, offset;
float m[3], params[4];
int numGrids, numPts = 0;
......@@ -1218,7 +1213,7 @@ int vtkVisItPLOT3DReader::ReadSolution(FILE *fp,vtkStructuredGrid *output)
}
// If first time reading soluton file then find the initial offset
// If first time reading soluton file then find the initial offset
// as well as find the gridsize(s) and Dmensions.
//
if (SolutionOffsets == NULL)
......@@ -1227,7 +1222,7 @@ int vtkVisItPLOT3DReader::ReadSolution(FILE *fp,vtkStructuredGrid *output)
GridSizes = new int [this->NumberOfGrids];
GridDimensions = new int [3*this->NumberOfGrids];
for (int i = 0; i < this->NumberOfGrids; i++)
for (int i = 0; i < this->NumberOfGrids; ++i)
{
SolutionOffsets[i] = -1;
}
......@@ -1252,35 +1247,35 @@ int vtkVisItPLOT3DReader::ReadSolution(FILE *fp,vtkStructuredGrid *output)
}
for (i =0; i < this->NumberOfGrids; i++)
for (int i =0; i < this->NumberOfGrids; ++i)
{
if (this->Dimension == THREE)
{
GridSizes[i] = GridDimensions[3 * i] * GridDimensions[1 + 3 * i]
* GridDimensions[2 + 3 * i];
}
}
else if (this->Dimension == TWO)
{
{
GridSizes[i] = GridDimensions[2 * i] * GridDimensions[1 + 2 * i];
}
}
if (0 <= this->GridNumber && this->GridNumber < this->NumberOfGrids)
int gridFound = 0;
if ((this->GridNumber >= 0) && (this->GridNumber < this->NumberOfGrids))
{
gridFound = 1;
numPts = GridSizes[this->GridNumber];
if (this->Dimension == THREE)
{
output->SetDimensions(GridDimensions[3 * GridNumber],
GridDimensions[1 + 3 * GridNumber],
GridDimensions[2 + 3 * GridNumber]);
output->SetDimensions(GridDimensions[3 * GridNumber],
GridDimensions[1 + 3 * GridNumber],
GridDimensions[2 + 3 * GridNumber]);
}
else if (this->Dimension == TWO)
{
output->SetDimensions(GridDimensions[2 * GridNumber],
GridDimensions[1 + 2 * GridNumber], 1);
output->SetDimensions(GridDimensions[2 * GridNumber],
GridDimensions[1 + 2 * GridNumber], 1);
}
}
......@@ -1299,7 +1294,7 @@ int vtkVisItPLOT3DReader::ReadSolution(FILE *fp,vtkStructuredGrid *output)
//seek to correct spot and read solution
offset = ComputeSolutionOffset(fp);
int offset = ComputeSolutionOffset(fp);
fseek (fp, (long)(offset), SEEK_SET);
//read solution parameters
......@@ -1328,7 +1323,7 @@ int vtkVisItPLOT3DReader::ReadSolution(FILE *fp,vtkStructuredGrid *output)
error = ReadNumbers(fp,numPts,this->TempStorage);
if (error)
if (error)
{
newDensity->Delete();
newMomentum->Delete();
......@@ -1338,7 +1333,7 @@ int vtkVisItPLOT3DReader::ReadSolution(FILE *fp,vtkStructuredGrid *output)
}
else //successful read
{
for (i=0; i < this->NumberOfPoints; i++)
for (int i=0; i < this->NumberOfPoints; ++i)
{
newDensity->SetValue(i,this->TempStorage[i]);
}
......@@ -1352,8 +1347,8 @@ int vtkVisItPLOT3DReader::ReadSolution(FILE *fp,vtkStructuredGrid *output)
{
error = ReadNumbers(fp,2*this->NumberOfPoints,this->TempStorage);
}
if (error)
if (error)
{
newDensity->Delete();
newMomentum->Delete();
......@@ -1363,7 +1358,7 @@ int vtkVisItPLOT3DReader::ReadSolution(FILE *fp,vtkStructuredGrid *output)
}
else //successful read, load coordinates into vector object
{
for (i=0; i < this->NumberOfPoints; i++)
for (int i=0; i < this->NumberOfPoints; ++i)
{
m[0] = this->TempStorage[i];
m[1] = this->TempStorage[this->NumberOfPoints+i];
......@@ -1374,13 +1369,13 @@ int vtkVisItPLOT3DReader::ReadSolution(FILE *fp,vtkStructuredGrid *output)
else
{
m[2] = 0;
}
}
newMomentum->SetTuple(i,m);
}
}
error = ReadNumbers(fp,numPts,this->TempStorage);
if (error)
if (error)
{
newDensity->Delete();
newMomentum->Delete();
......@@ -1394,7 +1389,7 @@ int vtkVisItPLOT3DReader::ReadSolution(FILE *fp,vtkStructuredGrid *output)
{
SolutionOffsets[this->GridNumber + 1] = ftell(fp);
}
for (i=0; i < this->NumberOfPoints; i++)
for (int i=0; i < this->NumberOfPoints; ++i)
{
newEnergy->SetValue(i,this->TempStorage[i]);
}
......@@ -1423,11 +1418,8 @@ int vtkVisItPLOT3DReader::ReadSolution(FILE *fp,vtkStructuredGrid *output)
int vtkVisItPLOT3DReader::ReadFunctionFile(FILE *fp,vtkStructuredGrid *output)
{
int numGrids;
output = output; // what is this for?
numGrids = this->FindNumberOfGrids(fp);
int numGrids = this->FindNumberOfGrids(fp);
if (numGrids != this->NumberOfGrids)
{
vtkErrorMacro(<<"Data mismatch in function file!");
......@@ -1441,9 +1433,8 @@ int vtkVisItPLOT3DReader::ReadFunctionFile(FILE *fp,vtkStructuredGrid *output)
int vtkVisItPLOT3DReader::ReadVectorFunctionFile(FILE *fp,
vtkStructuredGrid *output)
{
int numGrids= this->FindNumberOfGrids(fp);
int numGrids = this->FindNumberOfGrids(fp);
output = output;
if (numGrids != this->NumberOfGrids)
{
vtkErrorMacro(<<"Data mismatch in vector function file!");
......
......@@ -111,8 +111,6 @@ private: // helper functions
private: // class data members
int mResolution; // current resolution
int mNumFiles; // number of files
int mFirstTimeStep; // time value of first step
int mTimeStepIncrement; // stride between steps
std::string mCurrentVarName;
int mCurrentTimeState;
std::string mFilename; // name of metadata file
......
......@@ -68,7 +68,6 @@ private:
int jj_ntk;
Token* jj_scanpos, *jj_lastpos;
int jj_la;
bool jj_semLA;
int jj_gen;
int* jj_la1;
......
......@@ -21,7 +21,7 @@ class SimpleSymbolTable : public SymbolTable
public:
SimpleSymbolTable(std::string* symbols, int symbolCount, ValueProxy** valueProxies=0);
//SimpleSymbolTable(std::string* symbols, NameScope* namescopeVal);
~SimpleSymbolTable(void);
virtual ~SimpleSymbolTable();
SymbolTableEntry* getEntry(std::string identifier);
SymbolTableEntry* getLocalEntry(std::string identifier);
......
......@@ -17,7 +17,7 @@ class SimpleSymbolTableEntry : public SymbolTableEntry
{
public:
SimpleSymbolTableEntry(std::string& nameValue, int indexVal, NameScope* namescopeVal, ValueProxy* proxyVal);
~SimpleSymbolTableEntry(void);
virtual ~SimpleSymbolTableEntry();
double getConstantValue();
VCell::Expression* getExpression();
int getIndex();
......
......@@ -22,12 +22,14 @@
#include <iostream>
#include <algorithm>
#include <string>
#include <sstream>
using std::cout;
using std::endl;
using std::max;
using std::min;
using std::string;
using std::vector;
using std::ostringstream;
using namespace VCell;
......@@ -384,8 +386,10 @@ double StackMachine::evaluate(double* values){
}
*tos = MathUtil::factorial(*tos);
break;
default:
throw Exception("StackMachine: unknown stack element type " + token->type);
default:
ostringstream oss;
oss << "StackMachine: unknown stack element type " << token->type;
throw Exception(oss.str().c_str());
}
if (tos >= workingStack) {
if (MathUtil::double_infinity == -*tos || MathUtil::double_infinity == *tos) {
......
......@@ -20,7 +20,8 @@ class Expression;
class NameScope;
class SymbolTableEntry {
public:
public:
virtual ~SymbolTableEntry(){}
virtual double getConstantValue()=0;
virtual VCell::Expression* getExpression()=0;
virtual int getIndex()=0;
......
......@@ -1989,8 +1989,9 @@ void avtVCellMTMDFileFormat::calcUCDMembraneQuads(){
membrQuadNodes[i*4+3] = coordIndex0.x+1 +((coordIndex0.y)*xNodeCount) +(zBase*xyNodeCount);
}else{
string temp = "No boundary found for MembraneElement "+i;
throw temp.c_str();
ostringstream oss;
oss << "No boundary found for MembraneElement " << i;
throw oss.str().c_str();
}
}
}
......
......@@ -1418,15 +1418,12 @@ int UZ_EXP UzpMessageNull(pG, buf, size, flag)
/* Function UzpInput() */ /* GRR: this is a placeholder for now */
/***********************/
int UZ_EXP UzpInput(zvoid *pG, uch *buf, int *size, int flag)
int UZ_EXP UzpInput(zvoid *, uch *, int *size, int)
//zvoid *pG; /* globals struct: always passed */
//uch *buf; /* preformatted string to be printed */
//int *size; /* (address of) size of buf and of returned string */
//int flag; /* flag bits (bit 0: no echo) */
{
/* tell picky compilers to shut up about "unused variable" warnings */
pG = pG; buf = buf; flag = flag;
*size = 0;
return 0;
......
......@@ -941,8 +941,8 @@ static int inflate_dynamic(__G)
unsigned l; /* last length */
unsigned m; /* mask for bit lengths table */
unsigned n; /* number of lengths to get */
struct huft *tl; /* literal/length code table */
struct huft *td; /* distance code table */
struct huft *tl=NULL; /* literal/length code table */
struct huft *td=NULL; /* distance code table */
int bl; /* lookup bits for tl */
int bd; /* lookup bits for td */
unsigned nb; /* number of bit length codes */
......
......@@ -100,7 +100,7 @@ using std::string;
int AllocateSocket(std::string hostname, int port) {
struct sockaddr_in sn;
int s, cnt = 0, bindStatus = -1;
int s, bindStatus = -1;
struct hostent *he;
bzero((char*)&sn, sizeof(sn));
......@@ -143,7 +143,7 @@ int RequestConnection(char *host, int port) {
}
int InvokeRemoteCall(std::string host, int port, int call) {
int conn, value;
int conn;
char in_buffer[4], out_buffer[4];
char *server = (char *)host.c_str();
......@@ -500,6 +500,7 @@ void *avtVLIFileFormat::threadPacer(void *in) {
}
sleep(30);
}
return NULL;
}
// ****************************************************************************
......@@ -882,7 +883,7 @@ vtkObject *avtVLIFileFormat::Query(int timestate, int domain, const char *varnam
int nservers = procCount;
int diff = -1;
int indx = -1;
int run;
int run = 0;
for(i = 0; i < nattr; ++i) {
int d_i = bounds[2*i+1] - bounds[2*i] + 1;
if (d_i > diff) diff = d_i, indx = i;
......
......@@ -105,7 +105,6 @@ class avtVLIFileFormat : public avtMTMDFileFormat
int *eport;
void *ptid;
volatile int socket;
int *scount;
std::vector<avtDataSelection_p> selList;
std::vector<bool> *selsApplied;
std::vector<int> registeredVars;
......
......@@ -3119,6 +3119,8 @@ avtVisItXdmfFileFormat::PopulateCellInformation(vtkUnstructuredGrid *ugrid,
cellCount = 20;
break;
default:
vtkCellType = 0;
cellCount = 0;
avtCallback::IssueWarning("GetMesh: Invalid GeometryType.");
break;
}
......@@ -3246,8 +3248,6 @@ avtVisItXdmfFileFormat::GetUnstructuredMesh(MeshInfo *meshInfo)
//
// Create the cell structures.
//
int iCell = 0;
int index = 0;
switch (meshInfo->cellType)
{
case MeshInfo::CELL_POLYVERTEX:
......
......@@ -80,7 +80,6 @@ avtWavefrontOBJWriter : public avtDatabaseWriter
private:
std::vector<vtkPolyData *> pds;
bool doBinary;
#ifdef PARALLEL
void SendPolyDataToRank0();
......
......@@ -469,7 +469,7 @@ avtZipWrapperFileFormatInterface::Finalize()
avtZipWrapperFileFormatInterface::avtZipWrapperFileFormatInterface(
const char *const *list, int nl, int nb, const DBOptionsAttributes *rdopts,
CommonDatabasePluginInfo *zwinfo) :
inputFileListSize(nl), inputFileBlockCount(nb),
inputFileBlockCount(nb),
decompressedFilesCache(FreeUpCacheSlot)
{
procNum = 0;
......
......@@ -192,7 +192,6 @@ class avtZipWrapperFileFormatInterface : public avtFileFormatInterface
DatabasePluginManager *pluginManager;
std::vector<std::vector<std::string> > inputFileList;
int inputFileListSize;
int inputFileBlockCount;
int nTimesteps;
int dbType;
......
......@@ -1652,11 +1652,19 @@ int avtunvFileFormat::getNbfreeSets ()
#endif
// Outer boundary is not the first one:
if (imax != iorder)
{
for (itre = freeelts.begin(); itre != freeelts.end(); itre++)
{
if (itre->matid == iorder)
{
itre->matid = imax;
}
else if (itre->matid == imax)
{
itre->matid = iorder;
}
}
}
}
// Paints the matid array:
......
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