* Fix a couple of GCC warning
* Fix build with gcc4.8 (issue 1392)


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5618 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gregory.hainaut 2013-04-14 10:48:50 +00:00
parent cd7c24895c
commit 86a2f5a8ec
4 changed files with 10 additions and 7 deletions

View File

@ -144,20 +144,18 @@ struct PluginConf
int ReadInt(const std::string& item, int defval) int ReadInt(const std::string& item, int defval)
{ {
int value = defval; int value = defval;
int err = 0;
std::string buf = item + " = %d\n"; std::string buf = item + " = %d\n";
if (ConfFile) err=fscanf(ConfFile, buf.c_str(), &value); if (ConfFile) fscanf(ConfFile, buf.c_str(), &value);
return value; return value;
} }
void WriteInt(std::string item, int value) void WriteInt(std::string item, int value)
{ {
int err = 0;
std::string buf = item + " = %d\n"; std::string buf = item + " = %d\n";
if (ConfFile) err=fprintf(ConfFile, buf.c_str(), value); if (ConfFile) fprintf(ConfFile, buf.c_str(), value);
} }
}; };

View File

@ -807,7 +807,8 @@ REG_END2
if(PSM == PSM_PSMT4) return TW > 7 || TH > 7; if(PSM == PSM_PSMT4) return TW > 7 || TH > 7;
} }
return (TBW << 6) < (1u << TW); // The recast of TBW seems useless but it avoid tons of warning from GCC...
return ((uint32)TBW << 6u) < (1u << TW);
} }
REG_END2 REG_END2

View File

@ -50,7 +50,7 @@ bool GSDeviceSW::Reset(int w, int h)
GSTexture* GSDeviceSW::CreateSurface(int type, int w, int h, bool msaa, int format) GSTexture* GSDeviceSW::CreateSurface(int type, int w, int h, bool msaa, int format)
{ {
if(format != 0) return false; // there is only one format if(format != 0) return NULL; // there is only one format
return new GSTextureSW(type, w, h); return new GSTextureSW(type, w, h);
} }

View File

@ -434,7 +434,11 @@ struct aligned_free_second {template<class T> void operator()(T& p) {_aligned_fr
#ifdef __GNUC__ #ifdef __GNUC__
__forceinline unsigned long long __rdtsc() // gcc 4.8 define __rdtsc but unfortunately the compiler crash...
// The redefine allow to skip the gcc __rdtsc version -- Gregory
#define __rdtsc _lnx_rdtsc
//__forceinline unsigned long long __rdtsc()
__forceinline unsigned long long _lnx_rdtsc()
{ {
#if defined(__amd64__) || defined(__x86_64__) #if defined(__amd64__) || defined(__x86_64__)
unsigned long long low, high; unsigned long long low, high;