diff --git a/pcsx2/NakedAsm.h b/pcsx2/NakedAsm.h index 359f95183f..589bdc2957 100644 --- a/pcsx2/NakedAsm.h +++ b/pcsx2/NakedAsm.h @@ -63,4 +63,5 @@ void DispatcherReg(); } #endif -#endif \ No newline at end of file +#endif + diff --git a/pcsx2/SaveState.h b/pcsx2/SaveState.h index d884755a6d..bfe35d415e 100644 --- a/pcsx2/SaveState.h +++ b/pcsx2/SaveState.h @@ -217,4 +217,5 @@ namespace StateRecovery extern void Clear(); } -#endif \ No newline at end of file +#endif + diff --git a/pcsx2/x86/ix86/implement/jmpcall.h b/pcsx2/x86/ix86/implement/jmpcall.h index 4c9d266c87..2986410b10 100644 --- a/pcsx2/x86/ix86/implement/jmpcall.h +++ b/pcsx2/x86/ix86/implement/jmpcall.h @@ -37,7 +37,7 @@ public: // Special form for calling functions. This form automatically resolves the // correct displacement based on the size of the instruction being generated. template< typename T > - __forceinline void operator()( const T* func ) const + __forceinline void operator()( T* func ) const { if( isJmp ) xJccKnownTarget( Jcc_Unconditional, (void*)(uptr)func, false ); // double cast to/from (uptr) needed to appease GCC diff --git a/pcsx2/x86/ix86/ix86_instructions.h b/pcsx2/x86/ix86/ix86_instructions.h index af7ee03622..783adc6435 100644 --- a/pcsx2/x86/ix86/ix86_instructions.h +++ b/pcsx2/x86/ix86/ix86_instructions.h @@ -208,7 +208,7 @@ namespace x86Emitter ////////////////////////////////////////////////////////////////////////////////////////// // JMP / Jcc Instructions! - extern void xJcc( JccComparisonType comparison, void* target ); + extern void xJcc( JccComparisonType comparison, const void* target ); // ------------------------------------------------------------------------ // Conditional jumps to fixed targets. @@ -217,30 +217,30 @@ namespace x86Emitter // the target (efficient!) // - template< typename T > __forceinline void xJE(T* func ) { xJcc( Jcc_Equal, (void*)(uptr)func ); } - template< typename T > __forceinline void xJZ(T* func ) { xJcc( Jcc_Zero, (void*)(uptr)func ); } - template< typename T > __forceinline void xJNE(T* func ) { xJcc( Jcc_NotEqual, (void*)(uptr)func ); } - template< typename T > __forceinline void xJNZ(T* func ) { xJcc( Jcc_NotZero, (void*)(uptr)func ); } + template< typename T > __forceinline void xJE( T* func ) { xJcc( Jcc_Equal, (void*)(uptr)func ); } + template< typename T > __forceinline void xJZ( T* func ) { xJcc( Jcc_Zero, (void*)(uptr)func ); } + template< typename T > __forceinline void xJNE( T* func ) { xJcc( Jcc_NotEqual, (void*)(uptr)func ); } + template< typename T > __forceinline void xJNZ( T* func ) { xJcc( Jcc_NotZero, (void*)(uptr)func ); } - template< typename T > __forceinline void xJO(T* func ) { xJcc( Jcc_Overflow, (void*)(uptr)func ); } - template< typename T > __forceinline void xJNO(T* func ) { xJcc( Jcc_NotOverflow, (void*)(uptr)func ); } - template< typename T > __forceinline void xJC(T* func ) { xJcc( Jcc_Carry, (void*)(uptr)func ); } - template< typename T > __forceinline void xJNC(T* func ) { xJcc( Jcc_NotCarry, (void*)(uptr)func ); } - template< typename T > __forceinline void xJS(T* func ) { xJcc( Jcc_Signed, (void*)(uptr)func ); } - template< typename T > __forceinline void xJNS(T* func ) { xJcc( Jcc_Unsigned, (void*)(uptr)func ); } + template< typename T > __forceinline void xJO( T* func ) { xJcc( Jcc_Overflow, (void*)(uptr)func ); } + template< typename T > __forceinline void xJNO( T* func ) { xJcc( Jcc_NotOverflow, (void*)(uptr)func ); } + template< typename T > __forceinline void xJC( T* func ) { xJcc( Jcc_Carry, (void*)(uptr)func ); } + template< typename T > __forceinline void xJNC( T* func ) { xJcc( Jcc_NotCarry, (void*)(uptr)func ); } + template< typename T > __forceinline void xJS( T* func ) { xJcc( Jcc_Signed, (void*)(uptr)func ); } + template< typename T > __forceinline void xJNS( T* func ) { xJcc( Jcc_Unsigned, (void*)(uptr)func ); } - template< typename T > __forceinline void xJPE(T* func ) { xJcc( Jcc_ParityEven, (void*)(uptr)func ); } - template< typename T > __forceinline void xJPO(T* func ) { xJcc( Jcc_ParityOdd, (void*)(uptr)func ); } + template< typename T > __forceinline void xJPE( T* func ) { xJcc( Jcc_ParityEven, (void*)(uptr)func ); } + template< typename T > __forceinline void xJPO( T* func ) { xJcc( Jcc_ParityOdd, (void*)(uptr)func ); } - template< typename T > __forceinline void xJL(T* func ) { xJcc( Jcc_Less, (void*)(uptr)func ); } - template< typename T > __forceinline void xJLE(T* func ) { xJcc( Jcc_LessOrEqual, (void*)(uptr)func ); } - template< typename T > __forceinline void xJG(T* func ) { xJcc( Jcc_Greater, (void*)(uptr)func ); } - template< typename T > __forceinline void xJGE(T* func ) { xJcc( Jcc_GreaterOrEqual, (void*)(uptr)func ); } + template< typename T > __forceinline void xJL( T* func ) { xJcc( Jcc_Less, (void*)(uptr)func ); } + template< typename T > __forceinline void xJLE( T* func ) { xJcc( Jcc_LessOrEqual, (void*)(uptr)func ); } + template< typename T > __forceinline void xJG( T* func ) { xJcc( Jcc_Greater, (void*)(uptr)func ); } + template< typename T > __forceinline void xJGE( T* func ) { xJcc( Jcc_GreaterOrEqual, (void*)(uptr)func ); } - template< typename T > __forceinline void xJB(T* func ) { xJcc( Jcc_Below, (void*)(uptr)func ); } - template< typename T > __forceinline void xJBE(T* func ) { xJcc( Jcc_BelowOrEqual, (void*)(uptr)func ); } - template< typename T > __forceinline void xJA(T* func ) { xJcc( Jcc_Above, (void*)(uptr)func ); } - template< typename T > __forceinline void xJAE(T* func ) { xJcc( Jcc_AboveOrEqual, (void*)(uptr)func ); } + template< typename T > __forceinline void xJB( T* func ) { xJcc( Jcc_Below, (void*)(uptr)func ); } + template< typename T > __forceinline void xJBE( T* func ) { xJcc( Jcc_BelowOrEqual, (void*)(uptr)func ); } + template< typename T > __forceinline void xJA( T* func ) { xJcc( Jcc_Above, (void*)(uptr)func ); } + template< typename T > __forceinline void xJAE( T* func ) { xJcc( Jcc_AboveOrEqual, (void*)(uptr)func ); } // ------------------------------------------------------------------------ // Forward Jump Helpers (act as labels!) diff --git a/pcsx2/x86/ix86/ix86_jmp.cpp b/pcsx2/x86/ix86/ix86_jmp.cpp index 0954794f8b..ab5611ce9e 100644 --- a/pcsx2/x86/ix86/ix86_jmp.cpp +++ b/pcsx2/x86/ix86/ix86_jmp.cpp @@ -81,7 +81,7 @@ xSmartJump::~xSmartJump() // slideForward - used internally by xSmartJump to indicate that the jump target is going // to slide forward in the event of an 8 bit displacement. // -__emitinline void Internal::xJccKnownTarget( JccComparisonType comparison, void* target, bool slideForward ) +__emitinline void Internal::xJccKnownTarget( JccComparisonType comparison, const void* target, bool slideForward ) { // Calculate the potential j8 displacement first, assuming an instruction length of 2: sptr displacement8 = (sptr)target - ((sptr)xGetPtr() + 2); @@ -115,9 +115,10 @@ __emitinline void Internal::xJccKnownTarget( JccComparisonType comparison, void* // Low-level jump instruction! Specify a comparison type and a target in void* form, and // a jump (either 8 or 32 bit) is generated. -__emitinline void xJcc( JccComparisonType comparison, void* target ) +__emitinline void xJcc( JccComparisonType comparison, const void* target ) { xJccKnownTarget( comparison, target, false ); } -} \ No newline at end of file +} + diff --git a/pcsx2/x86/ix86/ix86_tools.cpp b/pcsx2/x86/ix86/ix86_tools.cpp index 59463ef84e..91a37d1333 100644 --- a/pcsx2/x86/ix86/ix86_tools.cpp +++ b/pcsx2/x86/ix86/ix86_tools.cpp @@ -253,4 +253,5 @@ __forceinline void FreezeXMMRegs_(int save) } #ifndef __INTEL_COMPILER } -#endif \ No newline at end of file +#endif + diff --git a/pcsx2/x86/ix86/ix86_types.h b/pcsx2/x86/ix86/ix86_types.h index 53b664ceb2..78cd2538a5 100644 --- a/pcsx2/x86/ix86/ix86_types.h +++ b/pcsx2/x86/ix86/ix86_types.h @@ -686,7 +686,7 @@ __forceinline void xWrite( T val ) extern void SimdPrefix( u8 prefix, u16 opcode ); extern void EmitSibMagic( uint regfield, const void* address ); extern void EmitSibMagic( uint regfield, const ModSibBase& info ); - extern void xJccKnownTarget( JccComparisonType comparison, void* target, bool slideForward ); + extern void xJccKnownTarget( JccComparisonType comparison, const void* target, bool slideForward ); // Writes a ModRM byte for "Direct" register access forms, which is used for all