Duktape compilation warings
This commit is contained in:
parent
dd333baf38
commit
ce2974e5ea
21
src/jsapi.c
21
src/jsapi.c
|
@ -250,11 +250,7 @@ static s32 duk_key(duk_context* duk)
|
||||||
|
|
||||||
if(key < tic_key_escape)
|
if(key < tic_key_escape)
|
||||||
duk_push_boolean(duk, tic->api.key(tic, key));
|
duk_push_boolean(duk, tic->api.key(tic, key));
|
||||||
else
|
else return duk_error(duk, DUK_ERR_ERROR, "unknown keyboard code\n");
|
||||||
{
|
|
||||||
duk_error(duk, DUK_ERR_ERROR, "unknown keyboard code\n");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -275,8 +271,7 @@ static s32 duk_keyp(duk_context* duk)
|
||||||
|
|
||||||
if(key >= tic_key_escape)
|
if(key >= tic_key_escape)
|
||||||
{
|
{
|
||||||
duk_error(duk, DUK_ERR_ERROR, "unknown keyboard code\n");
|
return duk_error(duk, DUK_ERR_ERROR, "unknown keyboard code\n");
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -325,8 +320,7 @@ static duk_ret_t duk_sfx(duk_context* duk)
|
||||||
|
|
||||||
if(!tic_tool_parse_note(noteStr, ¬e, &octave))
|
if(!tic_tool_parse_note(noteStr, ¬e, &octave))
|
||||||
{
|
{
|
||||||
duk_error(duk, DUK_ERR_ERROR, "invalid note, should be like C#4\n");
|
return duk_error(duk, DUK_ERR_ERROR, "invalid note, should be like C#4\n");
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -340,8 +334,7 @@ static duk_ret_t duk_sfx(duk_context* duk)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
duk_error(duk, DUK_ERR_ERROR, "unknown sfx index\n");
|
return duk_error(duk, DUK_ERR_ERROR, "unknown sfx index\n");
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 duration = duk_is_null_or_undefined(duk, 2) ? -1 : duk_to_int(duk, 2);
|
s32 duration = duk_is_null_or_undefined(duk, 2) ? -1 : duk_to_int(duk, 2);
|
||||||
|
@ -356,7 +349,7 @@ static duk_ret_t duk_sfx(duk_context* duk)
|
||||||
memory->api.sfx_stop(memory, channel);
|
memory->api.sfx_stop(memory, channel);
|
||||||
memory->api.sfx_ex(memory, index, note, octave, duration, channel, volume & 0xf, speed);
|
memory->api.sfx_ex(memory, index, note, octave, duration, channel, volume & 0xf, speed);
|
||||||
}
|
}
|
||||||
else duk_error(duk, DUK_ERR_ERROR, "unknown channel\n");
|
else return duk_error(duk, DUK_ERR_ERROR, "unknown channel\n");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -577,7 +570,7 @@ static duk_ret_t duk_pmem(duk_context* duk)
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else duk_error(duk, DUK_ERR_ERROR, "invalid persistent memory index\n");
|
else return duk_error(duk, DUK_ERR_ERROR, "invalid persistent memory index\n");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -762,7 +755,7 @@ static duk_ret_t duk_sync(duk_context* duk)
|
||||||
if(bank >= 0 && bank < TIC_BANKS)
|
if(bank >= 0 && bank < TIC_BANKS)
|
||||||
memory->api.sync(memory, mask, bank, toCart);
|
memory->api.sync(memory, mask, bank, toCart);
|
||||||
else
|
else
|
||||||
duk_error(duk, DUK_ERR_ERROR, "sync() error, invalid bank");
|
return duk_error(duk, DUK_ERR_ERROR, "sync() error, invalid bank");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue