fix some compiler warnings

This commit is contained in:
Menche 2015-02-12 16:27:13 -08:00 committed by darkrose
parent fc55e24aef
commit 3b6af78945
2 changed files with 4 additions and 8 deletions

View File

@ -81,14 +81,12 @@ public:
int overflow(int c) int overflow(int c)
{ {
size_t sz;
for(int i=0; i<DEBUGSTREAM_COUNT; i++) for(int i=0; i<DEBUGSTREAM_COUNT; i++)
{ {
if(g_debugstreams[i] == stderr && m_disable_stderr) if(g_debugstreams[i] == stderr && m_disable_stderr)
continue; continue;
if(g_debugstreams[i] != NULL) if(g_debugstreams[i] != NULL)
if ((sz = fwrite(&c, 1, 1, g_debugstreams[i])) < 0) fwrite(&c, 1, 1, g_debugstreams[i]);
continue;
//TODO: Is this slow? //TODO: Is this slow?
fflush(g_debugstreams[i]); fflush(g_debugstreams[i]);
} }
@ -97,14 +95,12 @@ public:
} }
std::streamsize xsputn(const char *s, std::streamsize n) std::streamsize xsputn(const char *s, std::streamsize n)
{ {
size_t sz;
for(int i=0; i<DEBUGSTREAM_COUNT; i++) for(int i=0; i<DEBUGSTREAM_COUNT; i++)
{ {
if(g_debugstreams[i] == stderr && m_disable_stderr) if(g_debugstreams[i] == stderr && m_disable_stderr)
continue; continue;
if(g_debugstreams[i] != NULL) if(g_debugstreams[i] != NULL)
if ((sz = fwrite(s, 1, n, g_debugstreams[i])) < 0) fwrite(s, 1, n, g_debugstreams[i]);
continue;
//TODO: Is this slow? //TODO: Is this slow?
fflush(g_debugstreams[i]); fflush(g_debugstreams[i]);
} }

View File

@ -124,13 +124,13 @@ public:
// Whether it can be cooked // Whether it can be cooked
virtual bool isCookable() const {return false;} virtual bool isCookable() const {return false;}
// Time of cooking // Time of cooking
virtual float getCookTime(){return 3.0;} virtual float getCookTime() const {return 3.0;}
// Result of cooking (can randomize) // Result of cooking (can randomize)
virtual InventoryItem *createCookResult() const {return NULL;} virtual InventoryItem *createCookResult() const {return NULL;}
// Whether it can be used as fuel // Whether it can be used as fuel
virtual bool isFuel() const {return false;} virtual bool isFuel() const {return false;}
// the fuel time value // the fuel time value
virtual float getFuelTime() {return 0.0;} virtual float getFuelTime() const {return 0.0;}
// Eat, press, activate, whatever. // Eat, press, activate, whatever.
// Called when item is right-clicked when lying on ground. // Called when item is right-clicked when lying on ground.