Merge pull request #956 from PCSX2/gcc-warning

Gcc warning
This commit is contained in:
Gregory Hainaut 2015-11-12 12:11:59 +01:00
commit a658609ae3
18 changed files with 31 additions and 26 deletions

View File

@ -241,7 +241,7 @@ extern "C" {
// basic funcs // basic funcs
s32 CALLBACK GSinit(); s32 CALLBACK GSinit();
s32 CALLBACK GSopen(void *pDsp, char *Title, int multithread); s32 CALLBACK GSopen(void *pDsp, const char *Title, int multithread);
void CALLBACK GSclose(); void CALLBACK GSclose();
void CALLBACK GSshutdown(); void CALLBACK GSshutdown();
void CALLBACK GSsetSettingsDir( const char* dir ); void CALLBACK GSsetSettingsDir( const char* dir );
@ -572,7 +572,7 @@ typedef void (CALLBACK* _PS2EsetEmuVersion)(const char* emuId, u32 version); //
// GS // GS
// NOTE: GSreadFIFOX/GSwriteCSR functions CANNOT use XMM/MMX regs // NOTE: GSreadFIFOX/GSwriteCSR functions CANNOT use XMM/MMX regs
// If you want to use them, need to save and restore current ones // If you want to use them, need to save and restore current ones
typedef s32 (CALLBACK* _GSopen)(void *pDsp, char *Title, int multithread); typedef s32 (CALLBACK* _GSopen)(void *pDsp, const char *Title, int multithread);
typedef s32 (CALLBACK* _GSopen2)( void *pDsp, u32 flags ); typedef s32 (CALLBACK* _GSopen2)( void *pDsp, u32 flags );
typedef void (CALLBACK* _GSvsync)(int field); typedef void (CALLBACK* _GSvsync)(int field);
typedef void (CALLBACK* _GSgifTransfer)(const u32 *pMem, u32 size); typedef void (CALLBACK* _GSgifTransfer)(const u32 *pMem, u32 size);

View File

@ -197,8 +197,10 @@ void x86capabilities::Identify()
u32 cmds; u32 cmds;
//AMD 64 STUFF //AMD 64 STUFF
#ifdef __x86_64__
u32 x86_64_8BITBRANDID; u32 x86_64_8BITBRANDID;
u32 x86_64_12BITBRANDID; u32 x86_64_12BITBRANDID;
#endif
memzero( VendorName ); memzero( VendorName );
__cpuid( regs, 0 ); __cpuid( regs, 0 );
@ -227,7 +229,9 @@ void x86capabilities::Identify()
Model = (regs[ 0 ] >> 4) & 0xf; Model = (regs[ 0 ] >> 4) & 0xf;
FamilyID = (regs[ 0 ] >> 8) & 0xf; FamilyID = (regs[ 0 ] >> 8) & 0xf;
TypeID = (regs[ 0 ] >> 12) & 0x3; TypeID = (regs[ 0 ] >> 12) & 0x3;
#ifdef __x86_64__
x86_64_8BITBRANDID = regs[ 1 ] & 0xff; x86_64_8BITBRANDID = regs[ 1 ] & 0xff;
#endif
Flags = regs[ 3 ]; Flags = regs[ 3 ];
Flags2 = regs[ 2 ]; Flags2 = regs[ 2 ];
} }
@ -238,7 +242,9 @@ void x86capabilities::Identify()
{ {
__cpuid( regs, 0x80000001 ); __cpuid( regs, 0x80000001 );
#ifdef __x86_64__
x86_64_12BITBRANDID = regs[1] & 0xfff; x86_64_12BITBRANDID = regs[1] & 0xfff;
#endif
EFlags2 = regs[ 2 ]; EFlags2 = regs[ 2 ];
EFlags = regs[ 3 ]; EFlags = regs[ 3 ];
} }

View File

@ -100,12 +100,10 @@ remove_not_yet_free_plugin()
remove_remaining_non_free_file() remove_remaining_non_free_file()
{ {
echo "Remove remaining non free file. TODO UPSTREAM" echo "Remove remaining non free file. TODO UPSTREAM"
rm -fr $LOCAL_REPO/unfree
rm -fr $LOCAL_REPO/plugins/GSdx/baseclasses rm -fr $LOCAL_REPO/plugins/GSdx/baseclasses
rm -f $LOCAL_REPO/plugins/zzogl-pg/opengl/Win32/aviUtil.h rm -f $LOCAL_REPO/plugins/zzogl-pg/opengl/Win32/aviUtil.h
rm -f $LOCAL_REPO/plugins/spu2-x/src/Windows/Hyperlinks.h
rm -f $LOCAL_REPO/plugins/spu2-x/src/Windows/Hyperlinks.cpp
rm -f $LOCAL_REPO/common/src/Utilities/x86/MemcpyFast.cpp rm -f $LOCAL_REPO/common/src/Utilities/x86/MemcpyFast.cpp
rm -f $LOCAL_REPO/common/include/comptr.h
} }
remove_dot_git() remove_dot_git()
{ {

View File

@ -691,6 +691,8 @@ void CMipsInstruction::encodeNormal()
switch (immediateType) switch (immediateType)
{ {
case MIPS_NOIMMEDIATE:
break;
case MIPS_IMMEDIATE5: case MIPS_IMMEDIATE5:
case MIPS_IMMEDIATE20: case MIPS_IMMEDIATE20:
encoding |= immediate.value << 6; encoding |= immediate.value << 6;

View File

@ -93,9 +93,8 @@ void SysThreadBase::Suspend( bool isBlocking )
switch( m_ExecMode ) switch( m_ExecMode )
{ {
// FIXME what to do for this case // Invalid thread state, nothing to suspend
// case ExecMode_NoThreadYet: case ExecMode_NoThreadYet:
// Check again -- status could have changed since above. // Check again -- status could have changed since above.
case ExecMode_Closed: return; case ExecMode_Closed: return;

View File

@ -279,7 +279,7 @@ int _allocX86reg(int x86reg, int type, int reg, int mode)
if( x86reg >= 0 ) { if( x86reg >= 0 ) {
// requested specific reg, so return that instead // requested specific reg, so return that instead
if( i != x86reg ) { if( i != (uint)x86reg ) {
if( x86regs[i].mode & MODE_READ ) readfromreg = i; if( x86regs[i].mode & MODE_READ ) readfromreg = i;
mode |= x86regs[i].mode&MODE_WRITE; mode |= x86regs[i].mode&MODE_WRITE;
x86regs[i].inuse = 0; x86regs[i].inuse = 0;

View File

@ -179,7 +179,7 @@ EXPORT_C GSclose()
} }
} }
static int _GSopen(void** dsp, char* title, GSRendererType renderer, int threads = -1) static int _GSopen(void** dsp, const char* title, GSRendererType renderer, int threads = -1)
{ {
GSDevice* dev = NULL; GSDevice* dev = NULL;
@ -528,7 +528,7 @@ EXPORT_C_(int) GSopen2(void** dsp, uint32 flags)
} }
stored_toggle_state = toggle_state; stored_toggle_state = toggle_state;
int retval = _GSopen(dsp, NULL, renderer); int retval = _GSopen(dsp, "", renderer);
if (s_gs != NULL) if (s_gs != NULL)
s_gs->SetAspectRatio(0); // PCSX2 manages the aspect ratios s_gs->SetAspectRatio(0); // PCSX2 manages the aspect ratios
@ -538,7 +538,7 @@ EXPORT_C_(int) GSopen2(void** dsp, uint32 flags)
return retval; return retval;
} }
EXPORT_C_(int) GSopen(void** dsp, char* title, int mt) EXPORT_C_(int) GSopen(void** dsp, const char* title, int mt)
{ {
/* /*
if(!XInitThreads()) return -1; if(!XInitThreads()) return -1;

View File

@ -1449,7 +1449,7 @@ bool GSRendererSW::GetScanlineGlobalData(SharedData* data)
{ {
gd.sel.zpsm = GSLocalMemory::m_psm[context->ZBUF.PSM].fmt; gd.sel.zpsm = GSLocalMemory::m_psm[context->ZBUF.PSM].fmt;
gd.sel.ztst = ztest ? context->TEST.ZTST : ZTST_ALWAYS; gd.sel.ztst = ztest ? context->TEST.ZTST : ZTST_ALWAYS;
gd.sel.zoverflow = GSVector4i(m_vt.m_max.p).z == 0x80000000; gd.sel.zoverflow = (uint32)GSVector4i(m_vt.m_max.p).z == 0x80000000U;
} }
#if _M_SSE >= 0x501 #if _M_SSE >= 0x501

View File

@ -121,7 +121,7 @@ EXPORT_C_(void) GSshutdown()
GSLog::Close(); GSLog::Close();
} }
EXPORT_C_(s32) GSopen(void *pDsp, char *Title, int multithread) EXPORT_C_(s32) GSopen(void *pDsp, const char *Title, int multithread)
{ {
int err = 0; int err = 0;
GSLog::WriteLn("GS open."); GSLog::WriteLn("GS open.");

View File

@ -20,7 +20,7 @@ Display *display;
int screen; int screen;
GtkScrolledWindow *win; GtkScrolledWindow *win;
int GSOpenWindow(void *pDsp, char *Title) int GSOpenWindow(void *pDsp, const char *Title)
{ {
display = XOpenDisplay(0); display = XOpenDisplay(0);
screen = DefaultScreen(display); screen = DefaultScreen(display);

View File

@ -20,7 +20,7 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/keysym.h> #include <X11/keysym.h>
extern int GSOpenWindow(void *pDsp, char *Title); extern int GSOpenWindow(void *pDsp, const char *Title);
extern int GSOpenWindow2(void *pDsp, u32 flags); extern int GSOpenWindow2(void *pDsp, u32 flags);
extern void GSCloseWindow(); extern void GSCloseWindow();
extern void GSProcessMessages(); extern void GSProcessMessages();

View File

@ -34,7 +34,7 @@ LRESULT CALLBACK MsgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return 0; return 0;
} }
int GSOpenWindow(void *pDsp, char *Title) int GSOpenWindow(void *pDsp, const char *Title)
{ {
WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, MsgProc, 0L, 0L, WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, MsgProc, 0L, 0L,
GetModuleHandle(NULL), NULL, NULL, NULL, NULL, GetModuleHandle(NULL), NULL, NULL, NULL, NULL,

View File

@ -18,7 +18,7 @@
#include <windows.h> #include <windows.h>
#include <windowsx.h> #include <windowsx.h>
extern int GSOpenWindow(void *pDsp, char *Title); extern int GSOpenWindow(void *pDsp, const char *Title);
extern void GSCloseWindow(); extern void GSCloseWindow();
extern void GSProcessMessages(); extern void GSProcessMessages();
extern void HandleKeyEvent(keyEvent *ev); extern void HandleKeyEvent(keyEvent *ev);

View File

@ -77,7 +77,7 @@ int windowThreadId = 0;
int updateQueued = 0; int updateQueued = 0;
#endif #endif
int bufSize = 0; u32 bufSize = 0;
unsigned char outBuf[50]; unsigned char outBuf[50];
unsigned char inBuf[50]; unsigned char inBuf[50];
@ -126,7 +126,7 @@ void DEBUG_NEW_SET() {
if (config.debug && bufSize>1) { if (config.debug && bufSize>1) {
HANDLE hFile = CreateFileA("logs\\padLog.txt", FILE_APPEND_DATA, FILE_SHARE_READ, 0, OPEN_ALWAYS, 0, 0); HANDLE hFile = CreateFileA("logs\\padLog.txt", FILE_APPEND_DATA, FILE_SHARE_READ, 0, OPEN_ALWAYS, 0, 0);
if (hFile != INVALID_HANDLE_VALUE) { if (hFile != INVALID_HANDLE_VALUE) {
int i; u32 i;
char temp[1500]; char temp[1500];
char *end = temp; char *end = temp;
sprintf(end, "%02X (%02X) ", inBuf[0], inBuf[1]); sprintf(end, "%02X (%02X) ", inBuf[0], inBuf[1]);

View File

@ -168,7 +168,7 @@ int BindCommand(Device *dev, unsigned int uid, unsigned int port, unsigned int s
if (!config.multipleBinding) { if (!config.multipleBinding) {
for (int port2=0; port2<2; port2++) { for (int port2=0; port2<2; port2++) {
for (int slot2=0; slot2<4; slot2++) { for (int slot2=0; slot2<4; slot2++) {
if (port2==port && slot2 == slot) continue; if (port2==(int)port && slot2 == (int)slot) continue;
PadBindings *p = dev->pads[port2]+slot2; PadBindings *p = dev->pads[port2]+slot2;
for (int i=0; i < p->numBindings; i++) { for (int i=0; i < p->numBindings; i++) {
Binding *b = p->bindings+i; Binding *b = p->bindings+i;
@ -220,7 +220,7 @@ void CALLBACK PADsetSettingsDir( const char *dir )
int SaveSettings(wchar_t *file=0) { int SaveSettings(wchar_t *file=0) {
CfgHelper cfg; CfgHelper cfg;
for (int i=0; i<sizeof(BoolOptionsInfo)/sizeof(BoolOptionsInfo[0]); i++) { for (size_t i=0; i<sizeof(BoolOptionsInfo)/sizeof(BoolOptionsInfo[0]); i++) {
cfg.WriteBool(L"General Settings", BoolOptionsInfo[i].name, config.bools[i]); cfg.WriteBool(L"General Settings", BoolOptionsInfo[i].name, config.bools[i]);
} }
cfg.WriteInt(L"General Settings", L"Close Hacks", config.closeHacks); cfg.WriteInt(L"General Settings", L"Close Hacks", config.closeHacks);
@ -305,7 +305,7 @@ int LoadSettings(int force, wchar_t *file) {
CfgHelper cfg; CfgHelper cfg;
for (int i=0; i<sizeof(BoolOptionsInfo)/sizeof(BoolOptionsInfo[0]); i++) { for (size_t i=0; i<sizeof(BoolOptionsInfo)/sizeof(BoolOptionsInfo[0]); i++) {
config.bools[i] = cfg.ReadBool(L"General Settings", BoolOptionsInfo[i].name, BoolOptionsInfo[i].defaultValue); config.bools[i] = cfg.ReadBool(L"General Settings", BoolOptionsInfo[i].name, BoolOptionsInfo[i].defaultValue);
} }

View File

@ -47,7 +47,7 @@ protected:
fprintf(stderr,"* SPU2-X:Iz in your internal callback.\n"); fprintf(stderr,"* SPU2-X:Iz in your internal callback.\n");
avail = snd_pcm_avail_update( handle ); avail = snd_pcm_avail_update( handle );
while (avail >= period_time ) while (avail >= (int)period_time )
{ {
StereoOut16 buff[PacketsPerBuffer * SndOutPacketSize]; StereoOut16 buff[PacketsPerBuffer * SndOutPacketSize];
StereoOut16* p1 = buff; StereoOut16* p1 = buff;

View File

@ -358,7 +358,7 @@ LRESULT WINAPI MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
return DefWindowProc( hWnd, msg, wParam, lParam ); return DefWindowProc( hWnd, msg, wParam, lParam );
} }
s32 CALLBACK GSopen(void *pDsp, char *Title, int multithread) { s32 CALLBACK GSopen(void *pDsp, const char *Title, int multithread) {
g_GSMultiThreaded = multithread; g_GSMultiThreaded = multithread;

View File

@ -282,7 +282,7 @@ __forceinline void InitMisc()
ResetRegs(); ResetRegs();
} }
EXPORT_C_(s32) GSopen(void *pDsp, char *Title, int multithread) EXPORT_C_(s32) GSopen(void *pDsp, const char *Title, int multithread)
{ {
FUNCLOG FUNCLOG