Avoid always-true and signed/unsigned comparisons.

Make empty while loops a little more obvious with a {} suffix.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6019 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Soren Jorvang 2010-07-31 19:06:44 +00:00
parent 0e83d52382
commit 3d25197a1c
10 changed files with 3795 additions and 3794 deletions

View File

@ -36,26 +36,26 @@ int clrHasOpenCL() {
}
// Windows-specific DLL code
#if defined _WIN32 && defined CLRUN_DYNAMICLIB
HINSTANCE g_hInstance;
BOOL APIENTRY DllMain(HINSTANCE hinstDLL, // DLL module handle
DWORD dwReason, // reason called
LPVOID lpvReserved) // reserved
{
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
break;
case DLL_PROCESS_DETACH:
break;
default:
break;
}
g_hInstance = hinstDLL;
return TRUE;
}
// Windows-specific DLL code
#if defined _WIN32 && defined CLRUN_DYNAMICLIB
HINSTANCE g_hInstance;
BOOL APIENTRY DllMain(HINSTANCE hinstDLL, // DLL module handle
DWORD dwReason, // reason called
LPVOID lpvReserved) // reserved
{
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
break;
case DLL_PROCESS_DETACH:
break;
default:
break;
}
g_hInstance = hinstDLL;
return TRUE;
}
#endif

File diff suppressed because it is too large Load Diff

View File

@ -271,12 +271,13 @@ static stbi_uc *dds_load(stbi *s, int *x, int *y, int *comp, int req_comp)
stbi_uc *dds_data = NULL;
stbi_uc block[16*4];
stbi_uc compressed[8];
int flags, DXT_family;
unsigned int flags;
int DXT_family;
int has_alpha, has_mipmap;
int is_compressed, cubemap_faces;
int block_pitch, num_blocks;
int block_pitch, cf;
DDS_header header;
int i, sz, cf;
unsigned int i, num_blocks, sz;
// load the header
if( sizeof( DDS_header ) != 128 )
{
@ -335,8 +336,8 @@ static stbi_uc *dds_load(stbi *s, int *x, int *y, int *comp, int req_comp)
{
// where are we?
int bx, by, bw=4, bh=4;
int ref_x = 4 * (i % block_pitch);
int ref_y = 4 * (i / block_pitch);
unsigned int ref_x = 4 * (i % block_pitch);
unsigned int ref_y = 4 * (i / block_pitch);
// get the next block's worth of compressed data, and decompress it
if( DXT_family == 1 )
{

View File

@ -56,7 +56,7 @@ volatile int reader, writer, outstanding, watermark;
@interface SearchBT: NSObject {
@public
int maxDevices;
unsigned int maxDevices;
}
@end

View File

@ -140,8 +140,8 @@ void GenericLogC(int level, int type,
#define _dbg_update_() ;
#ifndef _dbg_assert_
#define _dbg_assert_(_t_, _a_) ;
#define _dbg_assert_msg_(_t_, _a_, _desc_, ...) ;
#define _dbg_assert_(_t_, _a_) {}
#define _dbg_assert_msg_(_t_, _a_, _desc_, ...) {}
#endif // dbg_assert
#endif // MAX_LOGLEVEL DEBUG

View File

@ -522,7 +522,7 @@ std::string GetScheduledEventsSummary()
while (ptr)
{
unsigned int t = ptr->type;
if (t < 0 || t >= event_types.size())
if (t >= event_types.size())
PanicAlert("Invalid event type %i", t);
const char *name = event_types[ptr->type].name;
if (!name)

View File

@ -299,7 +299,7 @@ int CSIDevice_AMBaseboard::RunBuffer(u8* _pBuffer, int _iLength)
msg.addData((void *)"\x00\x00\x00\x00", 4);
break;
case 0x15:
while (*jvs_io++);
while (*jvs_io++) {};
msg.addData(1);
break;
case 0x20:

View File

@ -330,7 +330,7 @@ void FPURegCache::LoadToX64(int i, bool doLoad, bool makeDirty)
{
// Reg is at home in the memory register file. Let's pull it out.
X64Reg xr = GetFreeXReg();
_assert_msg_(DYNA_REC, xr >= 0 && xr < NUMXREGS, "WTF - load - invalid reg");
_assert_msg_(DYNA_REC, xr < NUMXREGS, "WTF - load - invalid reg");
xregs[xr].ppcReg = i;
xregs[xr].free = false;
xregs[xr].dirty = makeDirty;
@ -357,7 +357,7 @@ void FPURegCache::StoreFromX64(int i)
if (regs[i].away)
{
X64Reg xr = regs[i].location.GetSimpleReg();
_assert_msg_(DYNA_REC, xr >= 0 && xr < NUMXREGS, "WTF - store - invalid reg");
_assert_msg_(DYNA_REC, xr < NUMXREGS, "WTF - store - invalid reg");
xregs[xr].free = true;
xregs[xr].dirty = false;
xregs[xr].ppcReg = -1;

View File

@ -169,7 +169,7 @@ void CUCode_Zelda::HandleMail_LightVersion(u32 _uMail)
m_step = 0;
}
if (m_step < 0 || m_step >= sizeof(m_Buffer) / 4)
if (m_step >= sizeof(m_Buffer) / 4)
PanicAlert("m_step out of range");
((u32*)m_Buffer)[m_step] = _uMail;
@ -226,7 +226,7 @@ void CUCode_Zelda::HandleMail_SMSVersion(u32 _uMail)
if (m_bListInProgress)
{
if (m_step < 0 || m_step >= sizeof(m_Buffer) / 4)
if (m_step >= sizeof(m_Buffer) / 4)
PanicAlert("m_step out of range");
((u32*)m_Buffer)[m_step] = _uMail;
@ -349,7 +349,7 @@ void CUCode_Zelda::HandleMail_NormalVersion(u32 _uMail)
if (m_bListInProgress)
{
if (m_step < 0 || m_step >= sizeof(m_Buffer) / 4)
if (m_step >= sizeof(m_Buffer) / 4)
PanicAlert("m_step out of range");
((u32*)m_Buffer)[m_step] = _uMail;

View File

@ -174,7 +174,7 @@ void Wiimote::InterruptChannel(const u16 channel, const void* const data, const
if (0 == m_channel) // first interrupt/control channel sent
{
// clear all msgs, silly maybe
while (wiiuse_io_read(m_wiimote));
while (wiiuse_io_read(m_wiimote)) {};
// request status
wm_request_status rpt = wm_request_status();
@ -251,7 +251,7 @@ void Wiimote::Disconnect()
ClearReports();
// clear out wiiuse queue, or maybe not, silly? idk
while (wiiuse_io_read(m_wiimote));
while (wiiuse_io_read(m_wiimote)) {};
}
Wiimote* g_wiimotes[4];