@@ -746,7 +746,7 @@ static int emu_addgamegenie(lua_State *L) {
746
746
747
747
while (FCEUI_GetCheat (i,NULL ,&Caddr,&Cval,&Ccompare,NULL ,&Ctype)) {
748
748
749
- if ((GGaddr == Caddr) && (GGval == Cval) && (GGcomp == Ccompare) && (Ctype == 1 )) {
749
+ if ((static_cast <uint32>( GGaddr) == Caddr) && (GGval == static_cast < int >( Cval) ) && (GGcomp == Ccompare) && (Ctype == 1 )) {
750
750
// Already Added, so consider it a success
751
751
lua_pushboolean (L, true );
752
752
return 1 ;
@@ -789,7 +789,7 @@ static int emu_delgamegenie(lua_State *L) {
789
789
790
790
while (FCEUI_GetCheat (i,&Cname,&Caddr,&Cval,&Ccompare,NULL ,&Ctype)) {
791
791
792
- if ((Cname == msg) && (GGaddr == Caddr) && (GGval == Cval) && (GGcomp == Ccompare) && (Ctype == 1 )) {
792
+ if ((Cname == msg) && (static_cast <uint32>( GGaddr) == Caddr) && (GGval == static_cast < int >( Cval) ) && (GGcomp == Ccompare) && (Ctype == 1 )) {
793
793
// Delete cheat code
794
794
if (FCEUI_DelCheat (i)) {
795
795
lua_pushboolean (L, true );
@@ -1997,7 +1997,7 @@ static int memory_getregister(lua_State *L)
1997
1997
{
1998
1998
const char * qualifiedRegisterName = luaL_checkstring (L,1 );
1999
1999
lua_settop (L,0 );
2000
- for (int cpu = 0 ; cpu < sizeof (cpuToRegisterMaps)/sizeof (*cpuToRegisterMaps); cpu++)
2000
+ for (size_t cpu = 0 ; cpu < sizeof (cpuToRegisterMaps)/sizeof (*cpuToRegisterMaps); cpu++)
2001
2001
{
2002
2002
cpuToRegisterMap ctrm = cpuToRegisterMaps[cpu];
2003
2003
int cpuNameLen = strlen (ctrm.cpuName );
@@ -2031,7 +2031,7 @@ static int memory_setregister(lua_State *L)
2031
2031
const char * qualifiedRegisterName = luaL_checkstring (L,1 );
2032
2032
unsigned long value = (unsigned long )(luaL_checkinteger (L,2 ));
2033
2033
lua_settop (L,0 );
2034
- for (int cpu = 0 ; cpu < sizeof (cpuToRegisterMaps)/sizeof (*cpuToRegisterMaps); cpu++)
2034
+ for (size_t cpu = 0 ; cpu < sizeof (cpuToRegisterMaps)/sizeof (*cpuToRegisterMaps); cpu++)
2035
2035
{
2036
2036
cpuToRegisterMap ctrm = cpuToRegisterMaps[cpu];
2037
2037
int cpuNameLen = strlen (ctrm.cpuName );
@@ -2247,7 +2247,7 @@ static void CallRegisteredLuaMemHook_LuaMatch(unsigned int address, int size, un
2247
2247
#endif
2248
2248
lua_settop (L, 0 );
2249
2249
lua_getfield (L, LUA_REGISTRYINDEX, luaMemHookTypeStrings[hookType]);
2250
- for (int i = address; i != address+size; i++)
2250
+ for (unsigned int i = address; i != address+size; i++)
2251
2251
{
2252
2252
lua_rawgeti (L, -1 , i);
2253
2253
if (lua_isfunction (L, -1 ))
@@ -3854,7 +3854,7 @@ static inline bool str2colour(uint32 *colour, lua_State *L, const char *str) {
3854
3854
*colour = ((rand ()*255 /RAND_MAX) << 8 ) | ((rand ()*255 /RAND_MAX) << 16 ) | ((rand ()*255 /RAND_MAX) << 24 ) | 0xFF ;
3855
3855
return true ;
3856
3856
}
3857
- for (int i = 0 ; i < sizeof (s_colorMapping)/sizeof (*s_colorMapping); i++) {
3857
+ for (size_t i = 0 ; i < sizeof (s_colorMapping)/sizeof (*s_colorMapping); i++) {
3858
3858
if (!stricmp (str,s_colorMapping[i].name )) {
3859
3859
*colour = s_colorMapping[i].value ;
3860
3860
return true ;
0 commit comments