Commit 3f67761c authored by hkrishna's avatar hkrishna

warning fixes for common. All except for Variant/MapNode overload warning (TBD)

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@23630 18c085ea-50e0-402c-830e-de6fd14e8384
parent f12028e6
......@@ -58,7 +58,7 @@ FileConnection::FileConnection(const char *filename, bool writeMode_) :
{
fileStream = 0;
fileSize = 0;
writeMode = writeMode;
writeMode = writeMode_;
if(writeMode)
{
......@@ -237,7 +237,7 @@ FileConnection::Size()
// *******************************************************************
void
FileConnection::Append(unsigned char *address, int nChars)
FileConnection::Append(const unsigned char *address, int nChars)
{
if(writeMode)
{
......
......@@ -68,7 +68,7 @@ public:
virtual int Fill();
virtual void Flush();
virtual long Size();
virtual void Append(unsigned char *buf, int count);
virtual void Append(const unsigned char *buf, int count);
virtual long DirectRead(unsigned char *buf, long len);
virtual long DirectWrite(const unsigned char *buf, long len);
protected:
......
......@@ -334,8 +334,9 @@ LaunchService::Launch(const stringVector &origLaunchArgs, bool doBridge,
{
args[i] = new char[launchArgs[i].size() + 1];
strcpy(args[i], launchArgs[i].c_str());
if(i > 0)
if(i > 0) {
debug1 << launchArgs[i].c_str() << " ";
}
}
debug1 << ")" << endl;
......
......@@ -279,7 +279,7 @@ ParentProcess::Connect(int numRead, int numWrite, int *argc, char **argv[],
const char *mName = "ParentProcess::Connect: ";
char **argv2 = *argv;
bool rhostSpecified = false;
bool nWriteSpecified = false, nReadSpecified = false;
//bool nWriteSpecified = false, nReadSpecified = false;
int i, deleteCount = 0, port = 0;
// Log the arguments.
......@@ -290,8 +290,9 @@ ParentProcess::Connect(int numRead, int numWrite, int *argc, char **argv[],
for (i = 0; i < *argc ; ++i)
{
debug5 << argv2[i];
if(i < *argc-1)
if(i < *argc-1) {
debug5 << ", ";
}
}
debug5 << "})" << endl;
......@@ -372,7 +373,7 @@ ParentProcess::Connect(int numRead, int numWrite, int *argc, char **argv[],
if(numRead > 0)
{
debug5 << mName << "Creating read sockets" << endl;
nReadSpecified = true;
//nReadSpecified = true;
writeConnections = new Connection*[numRead];
for(int j = 0; j < numRead; ++j)
{
......@@ -388,7 +389,7 @@ ParentProcess::Connect(int numRead, int numWrite, int *argc, char **argv[],
if(numWrite > 0)
{
debug5 << mName << "Creating write sockets" << endl;
nWriteSpecified = true;
//nWriteSpecified = true;
readConnections = new Connection*[numWrite];
for(int j = 0; j < numWrite; ++j)
{
......
......@@ -2339,7 +2339,7 @@ RemoteProcess::LaunchRemote(const std::string &host, const std::string &remoteUs
stringVector args2;
args2.reserve( args.size() + 2 ); //one more
for(int i = 0; i < args.size(); ++i)
for(size_t i = 0; i < args.size(); ++i)
{
//replace..
std::string var = args[i];
......
......@@ -419,7 +419,7 @@ static int
Listen(int port, struct sockaddr_in &sin)
{
int on = 1;
bool portFound = false;
//bool portFound = false;
// Open a socket.
int listenSock = socket(AF_INET, SOCK_STREAM, 0);
......
......@@ -532,7 +532,7 @@ SocketConnection::WriteToBuffer(MapNode *mapnode,
stringVector names;
mapnode->GetEntryNames(names);
for(int i = 0; i < names.size(); ++i)
for(size_t i = 0; i < names.size(); ++i)
{
//std::cout << "** " << names[i] << std::endl;
std::string& name = names[i];
......@@ -874,7 +874,7 @@ SocketConnection::WriteToBuffer(const JSONNode &node,
const JSONNode::JSONArray& array = node.GetArray();
const JSONNode::JSONArray& marray = metadata.GetArray();
for(int i = 0; i < array.size(); ++i)
for(size_t i = 0; i < array.size(); ++i)
WriteToBuffer(array[i],marray[i],
write,i,totalLen,totalSize);
}
......
......@@ -141,16 +141,16 @@ ExprGrammar::ExprGrammar() : Grammar(D)
// ----------------------------------------------------------------------
// Expression
AddRule(Rule(0, Expr) >> Expr + T_Plus + Expr ); // addition
AddRule(Rule(1, Expr) >> Expr + T_Minus + Expr ); // subtraction
AddRule(Rule(2, Expr) >> Expr + T_Mult + Expr ); // multiplication
AddRule(Rule(3, Expr) >> Expr + T_Slash + Expr ); // division
AddRule(Rule(4, Expr) >> Expr + T_Exp + Expr ); // exponentiation
AddRule(Rule(5, Expr) >> Expr + T_Mod + Expr ); // modulo
AddRule(Rule(15, Expr) >> Expr + T_And + Expr ); // bitwise and
AddRule(Rule(6, Expr) >> Expr + T_LBracket + T_Integer + T_RBracket ); // index
AddRule(Rule(7, Expr) >> T_Minus + Expr, 5); // u-negative, prec=5
AddRule(Rule(8, Expr) >> T_LParen + Expr + T_RParen );
AddRule(Rule(0, Expr) >> (Expr + T_Plus + Expr) ); // addition
AddRule(Rule(1, Expr) >> (Expr + T_Minus + Expr) ); // subtraction
AddRule(Rule(2, Expr) >> (Expr + T_Mult + Expr) ); // multiplication
AddRule(Rule(3, Expr) >> (Expr + T_Slash + Expr) ); // division
AddRule(Rule(4, Expr) >> (Expr + T_Exp + Expr) ); // exponentiation
AddRule(Rule(5, Expr) >> (Expr + T_Mod + Expr) ); // modulo
AddRule(Rule(15, Expr) >> (Expr + T_And + Expr) ); // bitwise and
AddRule(Rule(6, Expr) >> (Expr + T_LBracket + T_Integer + T_RBracket) ); // index
AddRule(Rule(7, Expr) >> (T_Minus + Expr), 5); // u-negative, prec=5
AddRule(Rule(8, Expr) >> (T_LParen + Expr + T_RParen) );
AddRule(Rule(9, Expr) >> Constant );
AddRule(Rule(10, Expr) >> Vector );
AddRule(Rule(11, Expr) >> Function );
......@@ -165,67 +165,67 @@ ExprGrammar::ExprGrammar() : Grammar(D)
AddRule(Rule(3, Constant) >> T_Bool );
// Vector
AddRule(Rule(0, Vector) >> T_LBrace + Expr + T_Comma + Expr + T_RBrace);
AddRule(Rule(1, Vector) >> T_LBrace + Expr + T_Comma + Expr + T_Comma + Expr + T_RBrace);
AddRule(Rule(0, Vector) >> (T_LBrace + Expr + T_Comma + Expr + T_RBrace));
AddRule(Rule(1, Vector) >> (T_LBrace + Expr + T_Comma + Expr + T_Comma + Expr + T_RBrace));
// List
AddRule(Rule(0, List) >> T_LBracket + ListElems + T_RBracket);
AddRule(Rule(0, List) >> (T_LBracket + ListElems + T_RBracket));
// ListElems
AddRule(Rule(0, ListElems) >> ListElems + T_Comma + ListElem);
AddRule(Rule(0, ListElems) >> (ListElems + T_Comma + ListElem));
AddRule(Rule(1, ListElems) >> ListElem);
// ListElem
AddRule(Rule(0, ListElem) >> Expr);
AddRule(Rule(1, ListElem) >> Expr + T_Colon + Expr);
AddRule(Rule(2, ListElem) >> Expr + T_Colon + Expr + T_Colon + Expr);
AddRule(Rule(1, ListElem) >> (Expr + T_Colon + Expr));
AddRule(Rule(2, ListElem) >> (Expr + T_Colon + Expr + T_Colon + Expr));
// Function
AddRule(Rule(0, Function) >> T_Ident + T_LParen + T_RParen);
AddRule(Rule(1, Function) >> T_Ident + T_LParen + Args + T_RParen);
AddRule(Rule(0, Function) >> (T_Ident + T_LParen + T_RParen));
AddRule(Rule(1, Function) >> (T_Ident + T_LParen + Args + T_RParen));
// Args
AddRule(Rule(0, Args) >> Args + T_Comma + Arg);
AddRule(Rule(0, Args) >> (Args + T_Comma + Arg));
AddRule(Rule(1, Args) >> Arg);
// Arg
AddRule(Rule(0, Arg) >> Expr);
AddRule(Rule(1, Arg) >> T_Ident + T_Equal + Expr);
AddRule(Rule(1, Arg) >> (T_Ident + T_Equal + Expr));
AddRule(Rule(2, Arg) >> List);
// PathSpec
AddRule(Rule(0, PathSpec) >> PathSpec + MultiSlash + T_Ident);
AddRule(Rule(1, PathSpec) >> MultiSlash + T_Ident);
AddRule(Rule(0, PathSpec) >> (PathSpec + MultiSlash + T_Ident));
AddRule(Rule(1, PathSpec) >> (MultiSlash + T_Ident));
AddRule(Rule(2, PathSpec) >> T_Ident);
// MultiSlash
AddRule(Rule(0, MultiSlash) >> MultiSlash + T_Slash);
AddRule(Rule(0, MultiSlash) >> (MultiSlash + T_Slash));
AddRule(Rule(1, MultiSlash) >> T_Slash);
AddRule(Rule(2, MultiSlash) >> MultiSlash + T_BackSlash);
AddRule(Rule(2, MultiSlash) >> (MultiSlash + T_BackSlash));
AddRule(Rule(3, MultiSlash) >> T_BackSlash);
// Variable
AddRule(Rule(0, Variable) >> T_Ident );
AddRule(Rule(1, Variable) >> T_LCarat + PathSpec + T_RCarat );
AddRule(Rule(2, Variable) >> T_LCarat + DBSpec + T_Colon + PathSpec + T_RCarat );
AddRule(Rule(1, Variable) >> (T_LCarat + PathSpec + T_RCarat) );
AddRule(Rule(2, Variable) >> (T_LCarat + DBSpec + T_Colon + PathSpec + T_RCarat) );
// Database
AddRule(Rule(0, Database) >> T_LCarat + DBSpec + T_Colon + T_RCarat );
AddRule(Rule(0, Database) >> (T_LCarat + DBSpec + T_Colon + T_RCarat) );
// DBSpec
AddRule(Rule(0, DBSpec) >> PathSpec );
AddRule(Rule(1, DBSpec) >> PathSpec + MachSpec);
AddRule(Rule(1, DBSpec) >> (PathSpec + MachSpec));
AddRule(Rule(2, DBSpec) >> TimeSpec );
AddRule(Rule(3, DBSpec) >> PathSpec + TimeSpec );
AddRule(Rule(4, DBSpec) >> PathSpec + MachSpec + TimeSpec );
AddRule(Rule(3, DBSpec) >> (PathSpec + TimeSpec) );
AddRule(Rule(4, DBSpec) >> (PathSpec + MachSpec + TimeSpec) );
// MachSpec
AddRule(Rule(0, MachSpec) >> T_At + T_Ident );
AddRule(Rule(0, MachSpec) >> (T_At + T_Ident) );
// TimeSpec
AddRule(Rule(0, TimeSpec) >> T_LBracket + ListElems + T_RBracket + T_Ident);
AddRule(Rule(1, TimeSpec) >> T_LBracket + ListElems + T_RBracket);
AddRule(Rule(2, TimeSpec) >> T_LBracket + T_Pound + ListElems + T_RBracket);
AddRule(Rule(0, TimeSpec) >> (T_LBracket + ListElems + T_RBracket + T_Ident));
AddRule(Rule(1, TimeSpec) >> (T_LBracket + ListElems + T_RBracket));
AddRule(Rule(2, TimeSpec) >> (T_LBracket + T_Pound + ListElems + T_RBracket));
// ----------------------------------------------------------------------
......
......@@ -326,7 +326,7 @@ ExprScanner::ScanOneToken()
{
// Get the next character
char lookahead = 0;
if (pos < text.length())
if ((size_t)pos < text.length())
lookahead = text[pos];
// If it was a backslash, just use quoting
......@@ -334,7 +334,7 @@ ExprScanner::ScanOneToken()
if (backslashEscape)
{
lookahead = 0;
if (pos+1 < text.length())
if ((size_t)pos+1 < text.length())
{
lookahead = text[pos+1];
if(lookahead == 'n')
......
......@@ -321,10 +321,11 @@ TimingsManager::SetFilename(const std::string &fname)
{
char currentDir[1024];
#if defined(_WIN32)
_getcwd(currentDir,1023);
char* res = _getcwd(currentDir,1023);
#else
getcwd(currentDir,1023);
char* res = getcwd(currentDir,1023);
#endif
(void) res;
currentDir[1023]='\0';
std::string filenameTmp(currentDir);
if(filenameTmp[filenameTmp.size()-1] != VISIT_SLASH_CHAR)
......@@ -527,11 +528,11 @@ TimingsManager::StartTimer(bool forced)
numCurrentTimings += 1;
int rv = PlatformStartTimer();
if (rv == usedEntry.size())
if ((size_t)rv == usedEntry.size())
{
usedEntry.push_back(true);
}
else if (rv > usedEntry.size())
else if ((size_t)rv > usedEntry.size())
{
debug1 << "TimingsManager::StartTimer: Cannot start timer. "
<< "Returning -1 as if timing was disabled." << std::endl;
......@@ -599,7 +600,7 @@ TimingsManager::StopTimer(int index, const std::string &summary, bool forced)
if (enabled || (forced && !noForcedTiming))
{
if (index >= 0 && index < usedEntry.size())
if (index >= 0 && (size_t)index < usedEntry.size())
usedEntry[index] = false;
t = PlatformStopTimer(index);
if (!neverOutput)
......@@ -959,7 +960,7 @@ SystemTimingsManager::PlatformStartTimer(void)
double
SystemTimingsManager::PlatformStopTimer(int index)
{
if (index < 0 || index >= values.size())
if (index < 0 || (size_t)index >= values.size())
{
debug1 << "Invalid timing index (" << index << ") specified." << endl;
return 0.0;
......@@ -1041,7 +1042,7 @@ MPITimingsManager::PlatformStartTimer(void)
double
MPITimingsManager::PlatformStopTimer(int index)
{
if (index < 0 || index >= values.size())
if (index < 0 || (size_t)index >= values.size())
{
debug1 << "Invalid timing index (" << index << ") specified." << endl;
return 0.0;
......
......@@ -453,7 +453,7 @@ DatabasePluginManager::PluginHasWriter(const string &id)
if(allindexmap.find(id) != allindexmap.end())
{
int index = allindexmap[id];
if(index < names.size())
if((size_t)index < names.size())
retval = haswriter[index];
}
......@@ -480,7 +480,7 @@ DatabasePluginManager::PluginFilePatterns(const string &id)
if(allindexmap.find(id) != allindexmap.end())
{
int index = allindexmap[id];
if(index < names.size())
if((size_t)index < names.size())
retval = filePatterns[index];
}
......@@ -508,7 +508,7 @@ DatabasePluginManager::PluginFilePatternsAreStrict(const string &id)
if(allindexmap.find(id) != allindexmap.end())
{
int index = allindexmap[id];
if(index < names.size())
if((size_t)index < names.size())
retval = filePatternsAreStrict[index];
}
......@@ -536,7 +536,7 @@ DatabasePluginManager::PluginOpensWholeDirectory(const string &id)
if(allindexmap.find(id) != allindexmap.end())
{
int index = allindexmap[id];
if(index < names.size())
if((size_t)index < names.size())
retval = opensWholeDirectory[index];
}
......
......@@ -257,7 +257,7 @@ PluginManager::GetPluginName(const string &id)
if(allindexmap.find(id) != allindexmap.end())
{
int index = allindexmap[id];
if(index < names.size())
if((size_t)index < names.size())
retval = names[index];
}
......@@ -289,7 +289,7 @@ PluginManager::GetPluginVersion(const string &id)
if(allindexmap.find(id) != allindexmap.end())
{
int index = allindexmap[id];
if(index < versions.size())
if((size_t)index < versions.size())
retval = versions[index];
}
......@@ -434,7 +434,7 @@ PluginManager::DisablePlugin(const string &id)
if(allindexmap.find(id) != allindexmap.end())
{
int index = allindexmap[id];
if(index < enabled.size())
if((size_t)index < enabled.size())
enabled[index] = false;
}
}
......@@ -464,7 +464,7 @@ PluginManager::EnablePlugin(const string &id)
if(allindexmap.find(id) != allindexmap.end())
{
int index = allindexmap[id];
if(index < enabled.size())
if((size_t)index < enabled.size())
enabled[index] = true;
}
}
......@@ -544,7 +544,7 @@ PluginManager::GetPluginList(vector<pair<string,string> > &libs)
#define PLUGIN_MAX(A,B) (((A) < (B)) ? (B) : (A))
// Ignore it if it does not end in the correct extension
if (filename.length() < PLUGIN_MAX((1 + prefixLen),extLen) ||
if (filename.length() < (size_t)PLUGIN_MAX((1 + prefixLen),extLen) ||
!(filename.substr(filename.length()-extLen,extLen) == ext))
{
continue;
......@@ -1680,9 +1680,9 @@ PluginManager::PluginSymbol(const string &symbol, bool noError)
#endif
// If the symbol was not found, print the error message if appropriate.
if (retval == 0 && !noError)
if (retval == 0 && !noError) {
debug5 << PluginError() << endl;
}
return retval;
}
......
......@@ -989,7 +989,7 @@ AnnotationObjectList::GetNewObjectName() const
int
AnnotationObjectList::IndexForName(const std::string &name) const
{
int index = -1;
//int index = -1;
for(int i = 0; i < GetNumAnnotations(); ++i)
{
if(GetAnnotation(i).GetObjectName() == name)
......
......@@ -210,7 +210,7 @@ AttributeGroup::IsSelected(int i) const
bool retval = false;
// If the index is valid, check the selected flag.
if(i >= 0 && i < typeMap.size())
if(i >= 0 && (size_t)i < typeMap.size())
{
retval = typeMap[i].selected;
}
......@@ -536,12 +536,12 @@ AttributeGroup::InterpolateLinear(const AttributeGroup *atts1,
AttributeGroupVector &a2 =*(AttributeGroupVector*)addr2;
size_t l0 = out.size();
size_t l1 = a1.size();
int l2 = a2.size();
int lmax = (l1 > l2) ? l1 : l2;
size_t l2 = a2.size();
size_t lmax = (l1 > l2) ? l1 : l2;
out.resize(lmax);
if (lmax > l0)
{
for (int j=l0; j<lmax; j++)
for (size_t j=l0; j<lmax; j++)
{
out[j] = CreateSubAttributeGroup(i);
}
......@@ -2323,7 +2323,7 @@ AttributeGroup::CreateSubAttributeGroup(int)
void
AttributeGroup::Select(int index, void *address, int length)
{
if(index < typeMap.size())
if((size_t)index < typeMap.size())
{
typeMap[index].address = address;
typeMap[index].selected = true;
......@@ -2350,7 +2350,7 @@ AttributeGroup::Select(int index, void *address, int length)
void
AttributeGroup::SelectField(int index)
{
if(index >= 0 && index < typeMap.size())
if(index >= 0 && (size_t)index < typeMap.size())
{
if(typeMap[index].address != 0)
typeMap[index].selected = true;
......@@ -2385,7 +2385,7 @@ AttributeGroup::SelectFields(const std::vector<int> &indices)
for(size_t i = 0; i < indices.size(); ++i)
{
int index = indices[i];
if(index >= 0 && index < typeMap.size())
if(index >= 0 && (size_t)index < typeMap.size())
typeMap[index].selected = true;
}
}
......@@ -2782,7 +2782,7 @@ AttributeGroup::Read(Connection &conn)
// Read the attribute if the attrIndex is valid. Indicate that
// it is selected.
if(attrIndex < typeMap.size())
if((size_t)attrIndex < typeMap.size())
{
ReadType(conn, i, typeMap[attrIndex]);
typeMap[attrIndex].selected = true;
......@@ -3471,7 +3471,7 @@ AttributeGroup::GetFieldTypeName(int index) const
"MapNode"
};
std::string retval("<UNKNOWN type>");
if(index >= 0 && index < typeMap.size())
if(index >= 0 && (size_t)index < typeMap.size())
{
// Get around calling some non-const methods for now.
AttributeGroup *THIS = const_cast<AttributeGroup *>(this);
......
......@@ -865,8 +865,8 @@ AttributeSubjectMap::SetFromNode(DataNode *parentNode,
//
const intVector &iv = indicesNode->AsIntVector();
DataNode **attsObjects = attsNode->GetChildren();
const int numAtts = attsNode->GetNumChildren();
for(int i = 0; i < iv.size(); ++i)
const size_t numAtts = (size_t)attsNode->GetNumChildren();
for(size_t i = 0; i < iv.size(); ++i)
{
if(i < numAtts)
{
......@@ -932,8 +932,8 @@ AttributeSubjectMap::ProcessOldVersions(DataNode *parentNode,
//
const intVector &iv = indicesNode->AsIntVector();
DataNode **attsObjects = attsNode->GetChildren();
const int numAtts = attsNode->GetNumChildren();
for(int i = 0; i < iv.size(); ++i)
const size_t numAtts = (size_t)attsNode->GetNumChildren();
for(size_t i = 0; i < iv.size(); ++i)
{
if(i < numAtts)
obj->ProcessOldVersions(attsObjects[i], configVersion.c_str());
......
......@@ -631,7 +631,7 @@ ClientInformation::GetMethodIndex(const std::string &name) const
std::string
ClientInformation::GetMethod(int i) const
{
if(i >= 0 && i < methodNames.size())
if(i >= 0 && (size_t)i < methodNames.size())
return methodNames[i];
return "";
}
......@@ -639,7 +639,7 @@ ClientInformation::GetMethod(int i) const
std::string
ClientInformation::GetMethodPrototype(int i) const
{
if(i >= 0 && i < methodPrototypes.size())
if(i >= 0 && (size_t)i < methodPrototypes.size())
return methodPrototypes[i];
return "";
}
......
......@@ -1171,7 +1171,7 @@ ColorTableAttributes::GetColorTableIndex(const std::string &name) const
const ColorControlPointList *
ColorTableAttributes::GetColorControlPoints(int index) const
{
if(index >= 0 && index < colorTables.size())
if(index >= 0 && (size_t)index < colorTables.size())
return ((ColorControlPointList *)colorTables[index]);
else
return 0;
......@@ -1204,7 +1204,7 @@ ColorTableAttributes::GetColorControlPoints(const std::string &name) const
{
int index = GetColorTableIndex(name);
if(index >= 0 && index < colorTables.size())
if(index >= 0 && (size_t)index < colorTables.size())
return ((ColorControlPointList *)colorTables[index]);
else
return 0;
......@@ -1324,7 +1324,7 @@ ColorTableAttributes::RemoveColorTable(const std::string &name)
void
ColorTableAttributes::RemoveColorTable(int index)
{
if(index >= 0 && index < names.size())
if(index >= 0 && (size_t)index < names.size())
{
// Determine if the color table is active.
bool isActiveContinuous, isActiveDiscrete;
......
......@@ -1470,7 +1470,7 @@ DBOptionsAttributes::GetNumberOfOptions(void) const
DBOptionsAttributes::OptionType
DBOptionsAttributes::GetType(int index) const
{
if (index < 0 || index >= types.size())
if (index < 0 || (size_t)index >= types.size())
EXCEPTION0(BadDeclareFormatString);
return (DBOptionsAttributes::OptionType) types[index];
......
......@@ -1196,7 +1196,7 @@ DatabaseCorrelation::AddDatabase(const std::string &database, int nStates,
// Add the times and cycles for the new database to the correlation so
// we can access them later and perhaps use them to correlate.
//
for(int i = 0; i < nStates; ++i)
for(size_t i = 0; i < (size_t)nStates; ++i)
{
double t = ((i < times.size()) ? times[i] : 0.);
databaseTimes.push_back(t);
......@@ -1608,7 +1608,7 @@ int
DatabaseCorrelation::GetCondensedCycleForState(int state) const
{
int retval = 0;
if(state >= 0 && state < condensedCycles.size())
if(state >= 0 && (size_t)state < condensedCycles.size())
retval = condensedCycles[state];
return retval;
......@@ -1638,7 +1638,7 @@ double
DatabaseCorrelation::GetCondensedTimeForState(int state) const
{
double retval = 0.;
if(state >= 0 && state < condensedTimes.size())
if(state >= 0 && (size_t)state < condensedTimes.size())
retval = condensedTimes[state];
return retval;
......
......@@ -282,7 +282,7 @@ JSONNode::ToString(const std::string &indent) const
if(type == JSONARRAY)
{
std::string output = "[";
for(int i = 0; i < json.array.size(); ++i)
for(size_t i = 0; i < json.array.size(); ++i)
{
output += json.array[i].ToString();
......@@ -298,7 +298,7 @@ JSONNode::ToString(const std::string &indent) const
{
std::string output = "{";
int index = 0;
size_t index = 0;
for(JSONObject::const_iterator itr = json.object.begin();
itr != json.object.end(); ++itr)
{
......@@ -568,16 +568,18 @@ JSONNode::ParseVariant(std::istream &iss)
std::string
JSONNode::EscapeString(const std::string &val) const
{
// replace with standard JSON entities:
// \"
// \\
// \/
// \b
// \f
// \n
// \r
// \t
// \u four-hex-digits
/*
replace with standard JSON entities:
\"
\\
\/
\b
\f
\n
\r
\t
\u four-hex-digits
*/
std::string res="";
size_t ssize = val.size();
......@@ -775,7 +777,7 @@ JSONNode::convertArray(const T& v) {
json.array.resize(v.size());
for(int i = 0; i < v.size(); ++i)
for(size_t i = 0; i < v.size(); ++i)
json.array[i] = v[i];
return *this;
......@@ -866,7 +868,7 @@ JSONNode::operator[](int index)
if(index < 0) index = 0;
}
if(index < json.array.size())
if((size_t)index < json.array.size())
return json.array[index];
else
{
......@@ -1037,7 +1039,7 @@ JSONNode::AsString() const{
JSONType type = GetType();
if(type == JSONBOOL)
res << GetBool() ? "true" : "false";
res << std::string(GetBool() ? "true" : "false");
else if(type == JSONINTEGER)
res << (double) GetLong();
else if(type == JSONDOUBLE)
......
......@@ -61,6 +61,8 @@
class STATE_API KeepAliveRPC : public BlockingRPC
{
using BlockingRPC::SetValue;
using BlockingRPC::GetValue;
public:
KeepAliveRPC();
virtual ~KeepAliveRPC();
......
......@@ -1975,7 +1975,7 @@ MachineProfile::SetDefaultUserName(const std::string &n)
LaunchProfile *
MachineProfile::GetActiveLaunchProfile() const
{
if (activeProfile<0 || activeProfile>=launchProfiles.size())
if (activeProfile<0 || (size_t)activeProfile>=launchProfiles.size())
return NULL;
return (LaunchProfile*)launchProfiles[activeProfile];
......
......@@ -662,8 +662,8 @@ MapNode::SetValue(const JSONNode& data, const JSONNode& metadata, bool decodeStr
const JSONNode::JSONArray& marray = metadata.GetArray();
char buffer[1024];
for(int i = 0; i < array.size(); ++i) {
sprintf(buffer, "%d", i);
for(size_t i = 0; i < array.size(); ++i) {