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.
char * pto = (char*)to.c_str();
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();
return false;

View File

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

View File

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