fix some compiler warnings

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

View File

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