Commit 522e6ef4 authored by bonnell's avatar bonnell

Warning cleanup, windows.

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@23716 18c085ea-50e0-402c-830e-de6fd14e8384
parent 29760afd
......@@ -86,8 +86,8 @@ using std::vector;
void
ConvertSlashes(char *str)
{
int len = strlen(str);
for (int i = 0; i < len; i++)
size_t len = strlen(str);
for (size_t i = 0; i < len; i++)
{
#ifndef WIN32
if (str[i] == '\\')
......@@ -2371,7 +2371,7 @@ avtDatabase::GetFileListFromTextFile(const char *textfile,
{
str_auto[0] = '\0';
ifile.getline(str_auto, 1024, '\n');
int str_auto_len = strlen(str_auto);
size_t str_auto_len = strlen(str_auto);
if (str_auto_len > 0 && str_auto[str_auto_len-1] == '\r')
str_auto[str_auto_len-1] = '\0';
......
......@@ -563,8 +563,6 @@ Transform(vtkDataSet *in_ds,
pts->Delete();
newPts->Delete();
int dstype = rv->GetDataObjectType();
return rv;
}
......@@ -758,8 +756,6 @@ avtCoordSystemConvert::ExecuteData(vtkDataSet *in_ds, int, std::string)
vtkDataSet *cur_ds = in_ds;
vtkDataSet *new_ds;
int dstype = in_ds->GetDataObjectType();
if( ct_current == CARTESIAN && outputSys == CYLINDRICAL )
new_ds = Transform(cur_ds,
continuousPhi, vectorTransformMethod,
......@@ -794,8 +790,6 @@ avtCoordSystemConvert::ExecuteData(vtkDataSet *in_ds, int, std::string)
deleteList.push_back(new_ds);
cur_ds = new_ds;
dstype = cur_ds->GetDataObjectType();
if (outputSys == SPHERICAL)
{
cur_ds = FixWraparounds(cur_ds, 1);
......@@ -809,8 +803,6 @@ avtCoordSystemConvert::ExecuteData(vtkDataSet *in_ds, int, std::string)
deleteList.push_back(cur_ds);
}
dstype = cur_ds->GetDataObjectType();
ManageMemory(cur_ds);
for (unsigned int i = 0 ; i < deleteList.size() ; i++)
......
......@@ -299,7 +299,11 @@ avtWPPImageFileFormat::GetVar(int domain, const char *varname)
arr = vtkFloatArray::New();
arr->SetNumberOfTuples(npts);
float* data = (float *)arr->GetVoidPointer(0);
#ifdef WIN32
nr = _read(fd, data, (unsigned int)(sizeof(float)*npts));
#else
nr = READ(fd,data,sizeof(float)*npts);
#endif
if( (size_t)nr != sizeof(float)*npts )
{
CLOSE(fd);
......@@ -313,7 +317,11 @@ avtWPPImageFileFormat::GetVar(int domain, const char *varname)
arr = vtkDoubleArray::New();
arr->SetNumberOfTuples(npts);
double* data = (double *)arr->GetVoidPointer(0);
#ifdef WIN32
nr = _read(fd, data, (unsigned int)(sizeof(double)*npts));
#else
nr = READ(fd,data,sizeof(double)*npts);
#endif
if( (size_t)nr != sizeof(double)*npts )
{
CLOSE(fd);
......
......@@ -145,7 +145,7 @@ avtWellLogsFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md)
*/
string matname = "wellID";
int nmats = wellNames.size();
int nmats = (int)wellNames.size();
AddMaterialToMetaData(md, matname, meshname, nmats, wellNames);
}
......@@ -268,7 +268,7 @@ avtWellLogsFileFormat::ReadFile(void)
if (wellId == idx)
{
wellNames.push_back(s);
wellIds.push_back(wellNames.size()-1);
wellIds.push_back((int)wellNames.size()-1);
}
else if (utm83EId == idx)
X.push_back(atof(s));
......@@ -330,7 +330,7 @@ avtWellLogsFileFormat::ReadFile(void)
char buffer[1024];
sprintf(buffer,"DEP_%d",(int)prevtD);
wellNames.push_back(buffer);
id = wellNames.size() - 1;
id = (int)wellNames.size() - 1;
idmap[prevtD] = id;
}
......@@ -382,7 +382,7 @@ avtWellLogsFileFormat::ReadFile(void)
char buffer[1024];
sprintf(buffer,"DEP_%d",(int)prevtD);
wellNames.push_back(buffer);
id = wellNames.size() - 1;
id = (int)wellNames.size() - 1;
idmap[prevtD] = id;
}
......@@ -427,7 +427,7 @@ avtWellLogsFileFormat::GetMesh(const char *meshname)
vtkUnstructuredGrid *ugrid = vtkUnstructuredGrid::New();
vtkPoints *pts = vtkPoints::New();
int nWells = X.size();
int nWells = (int)X.size();
int pointsPerWell = 2;
pts->SetNumberOfPoints(nWells*pointsPerWell);
......@@ -512,8 +512,8 @@ avtWellLogsFileFormat::GetAuxiliaryData(const char *var, const char *type,
EXCEPTION1(InvalidVariableException, var);
}
int nWells = wellIds.size();
int numberOfSegments = wellIds.size(); // may be different in future
int nWells = (int)wellIds.size();
int numberOfSegments = (int)wellIds.size(); // may be different in future
avtMaterial *mat = new avtMaterial(nWells, wellNames, numberOfSegments,
&(wellIds[0]), 0, NULL, NULL, NULL, NULL);
df = avtMaterial::Destruct;
......
......@@ -462,7 +462,6 @@ XdmfAttribute * avtXdmfFileFormat::GetAttributeFromName(XdmfGrid * grid, const c
name = name.substr(name.rfind("/") + 1, name.length());
}
//XdmfAttribute * attribute = NULL;
for (int i = 0; i < grid->GetNumberOfAttributes(); ++i) {
if (strcmp(name.c_str(), grid->GetAttribute(i)->GetName()) == 0) {
return grid->GetAttribute(i);
......@@ -768,8 +767,6 @@ vtkDataSet * avtXdmfFileFormat::GetMesh(int timestate, int domain, const char *m
int avtXdmfFileFormat::GetMeshDataType(XdmfGrid* grid)
{
//XdmfInt32 gridType = grid->GetGridType();
if (grid->GetTopology()->GetClass() == XDMF_UNSTRUCTURED) {
return VTK_UNSTRUCTURED_GRID;
}
......
......@@ -231,8 +231,6 @@ avtXmdvFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md)
vtkDataSet *
avtXmdvFileFormat::GetMesh(const char *meshname)
{
int i;
if (!readInData)
if (!ReadXmdvFile(true))
EXCEPTION1(InvalidFilesException, filename);
......@@ -240,8 +238,8 @@ avtXmdvFileFormat::GetMesh(const char *meshname)
vtkUnstructuredGrid *ugrid = vtkUnstructuredGrid::New();
vtkPoints *pts = vtkPoints::New();
pts->SetNumberOfPoints(ncells);
int nvars = varnames.size();
for (i = 0 ; i < ncells ; i++)
size_t nvars = varnames.size();
for (int i = 0 ; i < ncells ; i++)
{
float pt[3];
pt[0] = (nvars > 0 ? values[nvars*i] : 0.);
......@@ -251,7 +249,7 @@ avtXmdvFileFormat::GetMesh(const char *meshname)
}
ugrid->Allocate(2*ncells);
vtkIdType onevertex[1];
for (i = 0 ; i < ncells ; i++)
for (int i = 0 ; i < ncells ; i++)
{
onevertex[0] = i;
ugrid->InsertNextCell(VTK_VERTEX, 1, onevertex);
......@@ -283,15 +281,13 @@ avtXmdvFileFormat::GetMesh(const char *meshname)
vtkDataArray *
avtXmdvFileFormat::GetVar(const char *varname)
{
int i;
if (!readInData)
if (!ReadXmdvFile(true))
EXCEPTION1(InvalidFilesException, filename);
int varIdx = -1;
int nvars = varnames.size();
for (i = 0 ; i < nvars ; i++)
int nvars = (int)varnames.size();
for (int i = 0 ; i < nvars ; i++)
if (varnames[i] == varname)
varIdx = i;
......@@ -300,7 +296,7 @@ avtXmdvFileFormat::GetVar(const char *varname)
vtkFloatArray *rv = vtkFloatArray::New();
rv->SetNumberOfTuples(ncells);
for (i = 0 ; i < ncells ; i++)
for (int i = 0 ; i < ncells ; i++)
{
rv->SetTuple1(i, values[i*nvars + varIdx]);
}
......
......@@ -134,8 +134,6 @@ avtXmdvWriter::WriteHeaders(const avtDatabaseMetaData *md,
vector<string> &s, vector<string> &v,
vector<string> &materials)
{
size_t i;
scalars = s;
vectors = v;
if (materials.size() != 0)
......@@ -143,7 +141,7 @@ avtXmdvWriter::WriteHeaders(const avtDatabaseMetaData *md,
bool haveCentering = false;
varCentering = AVT_UNKNOWN_CENT;
for (i = 0 ; i < s.size() ; i++)
for (size_t i = 0 ; i < s.size() ; i++)
{
if (md->GetScalar(s[i]) != NULL)
{
......@@ -163,7 +161,7 @@ avtXmdvWriter::WriteHeaders(const avtDatabaseMetaData *md,
debug1 << "Cannot check centering of " << s[i].c_str()
<< ", probably an expression. Hoping for the best."<< endl;
}
for (i = 0 ; i < v.size() ; i++)
for (size_t i = 0 ; i < v.size() ; i++)
{
if (md->GetVector(v[i]) != NULL)
{
......@@ -230,7 +228,6 @@ avtXmdvWriter::WriteHeaders(const avtDatabaseMetaData *md,
void
avtXmdvWriter::WriteChunk(vtkDataSet *ds, int chunk)
{
size_t i, j;
size_t npts = ds->GetNumberOfPoints();
size_t ncells = ds->GetNumberOfCells();
if (varCentering == AVT_UNKNOWN_CENT)
......@@ -279,11 +276,11 @@ avtXmdvWriter::WriteChunk(vtkDataSet *ds, int chunk)
ofile << nScalars << " " << nvals << " 1" << endl;
if (writeOutCoordinates)
ofile << "x\ny\nz\n";
for (i = 0 ; i < scalars.size() ; i++)
for (size_t i = 0 ; i < scalars.size() ; i++)
{
ofile << scalars[i].c_str() << endl;
}
for (i = 0 ; i < vectors.size() ; i++)
for (size_t i = 0 ; i < vectors.size() ; i++)
{
ofile << vectors[i].c_str() << "[0]" << endl;
ofile << vectors[i].c_str() << "[1]" << endl;
......@@ -292,7 +289,7 @@ avtXmdvWriter::WriteChunk(vtkDataSet *ds, int chunk)
vtkDataArray **arrays_sca = new vtkDataArray*[scalars.size()];
vtkDataArray **arrays_vec = new vtkDataArray*[vectors.size()];
for (i = 0 ; i < scalars.size() ; i++)
for (size_t i = 0 ; i < scalars.size() ; i++)
{
arrays_sca[i] = (varsAreNodal
? ds->GetPointData()->GetArray(scalars[i].c_str())
......@@ -304,7 +301,7 @@ avtXmdvWriter::WriteChunk(vtkDataSet *ds, int chunk)
EXCEPTION1(InvalidVariableException, scalars[i].c_str());
}
}
for (i = 0 ; i < vectors.size() ; i++)
for (size_t i = 0 ; i < vectors.size() ; i++)
{
arrays_vec[i] = (varsAreNodal
? ds->GetPointData()->GetArray(vectors[i].c_str())
......@@ -326,11 +323,11 @@ avtXmdvWriter::WriteChunk(vtkDataSet *ds, int chunk)
ofile << bounds[4] << "\t" << bounds[5] << "\t10" << endl;
}
for (i = 0 ; i < scalars.size() ; i++)
for (size_t i = 0 ; i < scalars.size() ; i++)
{
float min = arrays_sca[i]->GetTuple1(0);
float max = arrays_sca[i]->GetTuple1(0);
for (j = 0 ; j < nvals ; j++)
for (size_t j = 0 ; j < nvals ; j++)
{
float v = arrays_sca[i]->GetTuple1(j);
min = (min < v ? min : v);
......@@ -338,7 +335,7 @@ avtXmdvWriter::WriteChunk(vtkDataSet *ds, int chunk)
}
ofile << min << "\t" << max << "\t10" << endl;
}
for (i = 0 ; i < vectors.size() ; i++)
for (size_t i = 0 ; i < vectors.size() ; i++)
{
double vec[3];
arrays_vec[i]->GetTuple(i, vec);
......@@ -348,7 +345,7 @@ avtXmdvWriter::WriteChunk(vtkDataSet *ds, int chunk)
float maxJ = vec[1];
float minK = vec[2];
float maxK = vec[2];
for (j = 0 ; j < nvals ; j++)
for (size_t j = 0 ; j < nvals ; j++)
{
arrays_vec[i]->GetTuple(j, vec);
minI = (minI < vec[0] ? minI : vec[0]);
......@@ -364,7 +361,7 @@ avtXmdvWriter::WriteChunk(vtkDataSet *ds, int chunk)
}
ofile << std::scientific << std::setprecision(16);
for (j = 0 ; j < nvals ; j++)
for (size_t j = 0 ; j < nvals ; j++)
{
if (writeOutCoordinates)
{
......@@ -375,7 +372,7 @@ avtXmdvWriter::WriteChunk(vtkDataSet *ds, int chunk)
vtkVisItUtility::GetCellCenter(ds->GetCell(j), pt);
ofile << pt[0] << "\t" << pt[1] << "\t" << pt[2] << "\t";
}
for (i = 0 ; i < scalars.size() ; i++)
for (size_t i = 0 ; i < scalars.size() ; i++)
{
float v = arrays_sca[i]->GetTuple1(j);
ofile << v;
......@@ -387,7 +384,7 @@ avtXmdvWriter::WriteChunk(vtkDataSet *ds, int chunk)
if (needTab)
ofile << "\t";
}
for (i = 0 ; i < vectors.size() ; i++)
for (size_t i = 0 ; i < vectors.size() ; i++)
{
double vec[3];
arrays_vec[i]->GetTuple(j, vec);
......
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