avoid warning in g++

This commit is contained in:
wyy 2014-06-05 19:29:57 +08:00
parent 16e6ac0819
commit 12d3741562
3 changed files with 4 additions and 4 deletions

View File

@ -28,7 +28,7 @@ namespace Limonp
to.resize(from_size * 2); // iconv failed, may be you can raise this 2 to bigger number. to.resize(from_size * 2); // iconv failed, may be you can raise this 2 to bigger number.
char * pto = (char*)to.c_str(); char * pto = (char*)to.c_str();
size_t to_size = to.size(); size_t to_size = to.size();
if(-1 == iconv(_iconv_handle, &pfrom, &from_size, &pto, &to_size)) if(size_t(-1) == iconv(_iconv_handle, &pfrom, &from_size, &pto, &to_size))
{ {
to.clear(); to.clear();
return false; return false;

View File

@ -49,7 +49,7 @@ namespace Limonp
#ifdef LOGGER_LEVEL #ifdef LOGGER_LEVEL
if(level < LOGGER_LEVEL) return; if(level < LOGGER_LEVEL) return;
#endif #endif
size_t size = 256; int size = 256;
string msg; string msg;
va_list ap; va_list ap;
while (1) { while (1) {

View File

@ -29,7 +29,7 @@ namespace Limonp
inline void string_format(string& res, const char* fmt, ...) inline void string_format(string& res, const char* fmt, ...)
{ {
size_t size = 256; int size = 256;
va_list ap; va_list ap;
res.clear(); res.clear();
while (1) { while (1) {
@ -49,7 +49,7 @@ namespace Limonp
} }
inline string string_format(const char* fmt, ...) inline string string_format(const char* fmt, ...)
{ {
size_t size = 256; int size = 256;
std::string str; std::string str;
va_list ap; va_list ap;
while (1) { while (1) {