Commit 1bef87fd authored by hkrishna's avatar hkrishna

warning fixes for mdserver directory

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@23637 18c085ea-50e0-402c-830e-de6fd14e8384
parent 43f55dc3
......@@ -1018,7 +1018,7 @@ std::string
MDServerConnection::FilteredPath(const std::string &path) const
{
// Remove multiple slashes in a row.
int i, state = 0;
size_t i, state = 0;
std::string filteredPath;
for(i = 0; i < path.length(); ++i)
{
......@@ -1344,7 +1344,7 @@ MDServerConnection::ReadCWD()
#if defined(_WIN32)
_getcwd(tmpcwd,1023);
#else
getcwd(tmpcwd,1023);
char* res = getcwd(tmpcwd,1023); (void) res;
#endif
tmpcwd[1023]='\0';
......@@ -1723,7 +1723,7 @@ MDServerConnection::FileMatchesFilterList(const std::string &fileName) const
// Try the filename against all the filters in the list until
// it matches or we've tested all the filters.
bool match = false;
for(int i = 0; i < filterList.size() && !match; ++i)
for(size_t i = 0; i < filterList.size() && !match; ++i)
{
match = WildcardStringMatch(filterList[i], fileName);
}
......@@ -1783,7 +1783,7 @@ bool
MDServerConnection::GetPattern(const std::string &file, std::string &p,
int &digitLength) const
{
int i, isave = 0, ipat = 0;
size_t i, isave = 0, ipat = 0;
char pattern[256];
for(i = 0; i < 256; ++i) pattern[i] = '\0';
......@@ -1813,7 +1813,7 @@ MDServerConnection::GetPattern(const std::string &file, std::string &p,
while (excludedCompressionTypeExtensions[currExtIdx])
{
int extLen = strlen(excludedCompressionTypeExtensions[currExtIdx]);
if (searchstring.size() > extLen &&
if (searchstring.size() > (size_t)extLen &&
searchstring.substr(
searchstring.size()-extLen, searchstring.size()-1
) == excludedCompressionTypeExtensions[currExtIdx])
......@@ -1828,7 +1828,7 @@ MDServerConnection::GetPattern(const std::string &file, std::string &p,
while (excludedFileTypeExtensions[currExtIdx])
{
int extLen = strlen(excludedFileTypeExtensions[currExtIdx]);
if (searchstring.size() > extLen &&
if (searchstring.size() > (size_t)extLen &&
searchstring.substr(
searchstring.size()-extLen, searchstring.size()-1
) == excludedFileTypeExtensions[currExtIdx])
......@@ -1843,7 +1843,7 @@ MDServerConnection::GetPattern(const std::string &file, std::string &p,
while (excludedDimensionExtensions[currExtIdx])
{
int extLen = strlen(excludedDimensionExtensions[currExtIdx]);
if (searchstring.size() > extLen &&
if (searchstring.size() > (size_t)extLen &&
searchstring.substr(
searchstring.size()-extLen, searchstring.size()-1
) == excludedDimensionExtensions[currExtIdx])
......@@ -2151,7 +2151,7 @@ MDServerConnection::GetFilteredFileList(GetFileListRPC::FileList &files)
{
std::string listName(*it);
apos = listName.find("_abort_");
if(apos != -1)
if(apos != std::string::npos)
listName.replace(apos, 7, "_");
if(listName >= altName)
......@@ -2266,7 +2266,7 @@ MDServerConnection::GetFilteredFileList(GetFileListRPC::FileList &files)
// Create virtual databases using the information stored in the
// newVirtualFiles map.
//
int fileIndex, stage3 = visitTimer->StartTimer();
size_t fileIndex, stage3 = visitTimer->StartTimer();
GetFileListRPC::FileList virtualFilesToCheck;
for(fileIndex = 0; fileIndex < files.names.size(); ++fileIndex)
{
......@@ -2336,7 +2336,7 @@ MDServerConnection::GetFilteredFileList(GetFileListRPC::FileList &files)
// The virtual database is not of files so it cannot be a virtual
// database. Put the rest of its files back into the files list.
for(int i = 1; i < pos->second.files.size(); ++i)
for(size_t i = 1; i < pos->second.files.size(); ++i)
{
debug5 << "\t" << pos->second.files[i].c_str() << endl;
......@@ -2362,7 +2362,7 @@ MDServerConnection::GetFilteredFileList(GetFileListRPC::FileList &files)
int stage7 = visitTimer->StartTimer();
if(newVirtualFiles.size() > 0)
{
for(int fileIndex = 0; fileIndex < files.names.size(); ++fileIndex)
for(size_t fileIndex = 0; fileIndex < files.names.size(); ++fileIndex)
{
pos = newVirtualFiles.find(files.names[fileIndex]);
if(pos == newVirtualFiles.end())
......@@ -2493,7 +2493,7 @@ MDServerConnection::ConsolidateVirtualDatabases(
for(it = newVirtualFiles.begin(); it != newVirtualFiles.end(); ++it)
{
std::string key(it->first.name);
int starpos = key.find("*");
size_t starpos = key.find("*");
bool lastCharIsStar = starpos == key.size()-1;
bool secondLastCharIsStarWithZ = starpos == key.size()-2 &&
......@@ -2546,7 +2546,7 @@ MDServerConnection::ConsolidateVirtualDatabases(
long vdb_sizes;
bool vdb_info_set = false;
for(int s = 0; s < it->second.files.size(); ++s)
for(size_t s = 0; s < it->second.files.size(); ++s)
{
VirtualFileInformationMap::iterator ci =
newVirtualFiles.find(it->second.files[s]);
......@@ -2569,7 +2569,7 @@ MDServerConnection::ConsolidateVirtualDatabases(
virtualDBNames += (ci->first.name + " ");
consolidatedInfo.path = ci->second.path;
for(int index = 0; index < ci->second.files.size(); ++index)
for(size_t index = 0; index < ci->second.files.size(); ++index)
consolidatedInfo.files.push_back(ci->second.files[index]);
// Get the file access information.
......@@ -2577,7 +2577,7 @@ MDServerConnection::ConsolidateVirtualDatabases(
intVector::iterator vdb_access_it = files.access.begin();
intVector::iterator vdb_types_it = files.types.begin();
longVector::iterator vdb_sizes_it = files.sizes.begin();
for(int fileIndex = 0; fileIndex < files.names.size(); ++fileIndex)
for(size_t fileIndex = 0; fileIndex < files.names.size(); ++fileIndex)
{
if(files.names[fileIndex] == ci->first.name)
{
......@@ -2723,11 +2723,12 @@ MDServerConnection::GetVirtualFileDefinition(const std::string &file)
"it before but it was closed and its definition "
"(list of files) was erased. Try and re-read its "
"definition using the filter that we've saved for it (";
for(int i = 0; i < virtualFile->second.filterList.size(); ++i)
for(size_t i = 0; i < virtualFile->second.filterList.size(); ++i)
{
debug2 << virtualFile->second.filterList[i].c_str();
if(i < virtualFile->second.filterList.size()-1)
if(i < virtualFile->second.filterList.size()-1) {
debug2 << ", ";
}
}
debug2 << ")." << endl;
......@@ -2897,7 +2898,7 @@ MDServerConnection::GetDatabase(std::string file, int timeState,
const stringVector &fileNames = virtualFile->second.files;
const std::string &path = virtualFile->second.path;
char **names = new char *[fileNames.size()];
int i;
size_t i;
debug3 << "New virtual database: " << file.c_str()
<< ", path=" << path.c_str() << endl;
for(i = 0; i < fileNames.size(); ++i)
......
......@@ -181,7 +181,7 @@ MDServerMethods::GetFileList(const std::string &filter,
#endif
int vfIndex = 0; int fileIndex = 0;
for (int i = 0; i < fl->names.size(); ++i)
for (size_t i = 0; i < fl->names.size(); ++i)
{
FileEntry tmpentry;
tmpentry.name = fl->names[i];
......
......@@ -73,9 +73,9 @@ public:
int size;
bool CanAccess() const { return (flag & 1) == 1; }
void SetAccess(bool val) { flag = (flag & 0xfe | (val?1:0)); }
void SetAccess(bool val) { flag = ((flag & 0xfe) | (val?1:0)); }
bool IsVirtual() const { return (flag & 2) == 2; }
void SetVirtual(bool val) { flag = (flag & 0xfd | (val?2:0)); }
void SetVirtual(bool val) { flag = ((flag & 0xfd) | (val?2:0)); }
private:
// Access is bit 0
// Virtual is bit 1
......
......@@ -47,7 +47,7 @@ MDServerState::DetermineSeparator()
std::string d = getDirectoryRPC();
// Determine the separator to use in filenames.
for(int i = 0; i < d.length(); ++i)
for(size_t i = 0; i < d.length(); ++i)
{
if(d[i] == '/')
{
......@@ -69,7 +69,7 @@ MDServerState::SetupComponentRPCs(Xfer* xfer)
// Connect the RPCs to the xfer object.
//
for(int i = 0; i < GetNumStateObjects(); ++i)
for(size_t i = 0; i < GetNumStateObjects(); ++i)
xfer->Add(GetStateObject(i));
}
......@@ -83,6 +83,6 @@ MDServerState::GetNumStateObjects()
VisItRPC*
MDServerState::GetStateObject(int i)
{
return (i >= 0 && i < objVector.size()) ?
return (i >= 0 && (size_t)i < objVector.size()) ?
objVector[i] : 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