fixed some warnings on Windows
git-svn-id: http://find-object.googlecode.com/svn/trunk/find_object@425 620bd6b2-0a58-f614-fd9a-1bd335dccda9
This commit is contained in:
@@ -155,7 +155,7 @@ std::string uBytes2Hex(const char * bytes, unsigned int bytesLen)
|
||||
|
||||
std::vector<char> uHex2Bytes(const std::string & hex)
|
||||
{
|
||||
return uHex2Bytes(&hex[0], hex.length());
|
||||
return uHex2Bytes(&hex[0], (int)hex.length());
|
||||
}
|
||||
|
||||
std::vector<char> uHex2Bytes(const char * hex, int hexLen)
|
||||
@@ -270,7 +270,12 @@ std::string uFormatv (const char *fmt, va_list args)
|
||||
#endif
|
||||
|
||||
// Try to vsnprintf into our buffer.
|
||||
int needed = vsnprintf (buf, size, fmt, argsTmp);
|
||||
#ifdef _MSC_VER
|
||||
int needed = (int)vsnprintf_s(buf, size, _TRUNCATE, fmt, argsTmp);
|
||||
#else
|
||||
int needed = (int)vsnprintf(buf, size, fmt, argsTmp);
|
||||
#endif
|
||||
|
||||
va_end(argsTmp);
|
||||
// NB. C99 (which modern Linux and OS X follow) says vsnprintf
|
||||
// failure returns the length it would have needed. But older
|
||||
|
||||
@@ -262,7 +262,7 @@ bool UDirectory::exists(const std::string & dirPath)
|
||||
std::string UDirectory::getDir(const std::string & filePath)
|
||||
{
|
||||
std::string dir = filePath;
|
||||
int i=dir.size()-1;
|
||||
int i=(int)dir.size()-1;
|
||||
for(; i>=0; --i)
|
||||
{
|
||||
if(dir[i] == '/' || dir[i] == '\\')
|
||||
|
||||
@@ -65,14 +65,14 @@ int UFile::erase(const std::string &filePath)
|
||||
int UFile::rename(const std::string &oldFilePath,
|
||||
const std::string &newFilePath)
|
||||
{
|
||||
return rename(oldFilePath.c_str(), newFilePath.c_str());
|
||||
return ::rename(oldFilePath.c_str(), newFilePath.c_str());
|
||||
}
|
||||
|
||||
std::string UFile::getName(const std::string & filePath)
|
||||
{
|
||||
std::string fullPath = filePath;
|
||||
std::string name;
|
||||
for(int i=fullPath.size()-1; i>=0; --i)
|
||||
for(int i=(int)fullPath.size()-1; i>=0; --i)
|
||||
{
|
||||
if(fullPath[i] == '/' || fullPath[i] == '\\')
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user