1
0
Fork 0
mirror of https://github.com/ctruLua/ctruLua.git synced 2025-10-28 00:39:30 +00:00

Removed some "(lua_Integer)", Fixed some pointers-related stuff

This commit is contained in:
Firew0lf 2015-08-18 19:30:53 +02:00
parent 12a315b738
commit 79f4086cf0
2 changed files with 26 additions and 26 deletions

View file

@ -80,8 +80,8 @@ static int hid_touch(lua_State *L) {
touchPosition pos; touchPosition pos;
hidTouchRead(&pos); hidTouchRead(&pos);
lua_pushinteger(L, (lua_Integer)pos.px); lua_pushinteger(L, pos.px);
lua_pushinteger(L, (lua_Integer)pos.py); lua_pushinteger(L, pos.py);
return 2; return 2;
} }
@ -92,8 +92,8 @@ static int hid_circle(lua_State *L) {
circlePosition pos; circlePosition pos;
hidCircleRead(&pos); hidCircleRead(&pos);
lua_pushinteger(L, (lua_Integer)pos.dx); lua_pushinteger(L, pos.dx);
lua_pushinteger(L, (lua_Integer)pos.dy); lua_pushinteger(L, pos.dy);
return 2; return 2;
} }
@ -104,9 +104,9 @@ static int hid_accel(lua_State *L) {
accelVector pos; accelVector pos;
hidAccelRead(&pos); hidAccelRead(&pos);
lua_pushinteger(L, (lua_Integer)pos.x); lua_pushinteger(L, pos.x);
lua_pushinteger(L, (lua_Integer)pos.y); lua_pushinteger(L, pos.y);
lua_pushinteger(L, (lua_Integer)pos.z); lua_pushinteger(L, pos.z);
return 3; return 3;
} }
@ -117,9 +117,9 @@ static int hid_gyro(lua_State *L) {
angularRate pos; angularRate pos;
hidGyroRead(&pos); hidGyroRead(&pos);
lua_pushinteger(L, (lua_Integer)pos.x); lua_pushinteger(L, pos.x);
lua_pushinteger(L, (lua_Integer)pos.y); lua_pushinteger(L, pos.y);
lua_pushinteger(L, (lua_Integer)pos.z); lua_pushinteger(L, pos.z);
return 3; return 3;
} }
@ -128,7 +128,7 @@ static int hid_volume(lua_State *L) {
u8 volume = 0; u8 volume = 0;
HIDUSER_GetSoundVolume(&volume); HIDUSER_GetSoundVolume(&volume);
lua_pushinteger(L, (lua_Integer)volume); lua_pushinteger(L, volume);
return 1; return 1;
} }

View file

@ -19,46 +19,46 @@ static int ptm_shutdown(lua_State *L) {
} }
static int ptm_getShellState(lua_State *L) { static int ptm_getShellState(lua_State *L) {
u8 *out = 0; u8 out = 0;
PTMU_GetShellState(ptmHandle, out); PTMU_GetShellState(ptmHandle, &out);
lua_pushinteger(L, (lua_Integer)out); lua_pushinteger(L, out);
return 1; return 1;
} }
static int ptm_getBatteryLevel(lua_State *L) { static int ptm_getBatteryLevel(lua_State *L) {
u8 *out = 0; u8 out = 0;
PTMU_GetBatteryLevel(ptmHandle, out); PTMU_GetBatteryLevel(ptmHandle, &out);
lua_pushinteger(L, (lua_Integer)out); lua_pushinteger(L, out);
return 1; return 1;
} }
static int ptm_getBatteryChargeState(lua_State *L) { static int ptm_getBatteryChargeState(lua_State *L) {
u8 *out = 0; u8 out = 0;
PTMU_GetBatteryChargeState(ptmHandle, out); PTMU_GetBatteryChargeState(ptmHandle, &out);
lua_pushinteger(L, (lua_Integer)out); lua_pushinteger(L, out);
return 1; return 1;
} }
static int ptm_getPedometerState(lua_State *L) { static int ptm_getPedometerState(lua_State *L) {
u8 *out = 0; u8 out = 0;
PTMU_GetPedometerState(ptmHandle, out); PTMU_GetPedometerState(ptmHandle, &out);
lua_pushinteger(L, (lua_Integer)out); lua_pushinteger(L, out);
return 1; return 1;
} }
static int ptm_getTotalStepCount(lua_State *L) { static int ptm_getTotalStepCount(lua_State *L) {
u32 *steps = 0; u32 steps = 0;
PTMU_GetTotalStepCount(ptmHandle, steps); PTMU_GetTotalStepCount(ptmHandle, &steps);
lua_pushinteger(L, (lua_Integer)steps); lua_pushinteger(L, steps);
return 1; return 1;
} }