From 79f4086cf090c35cece858054c66041e4ab222d0 Mon Sep 17 00:00:00 2001 From: Firew0lf Date: Tue, 18 Aug 2015 19:30:53 +0200 Subject: [PATCH] Removed some "(lua_Integer)", Fixed some pointers-related stuff --- source/hid.c | 22 +++++++++++----------- source/ptm.c | 30 +++++++++++++++--------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/source/hid.c b/source/hid.c index a8de874..3af63c0 100644 --- a/source/hid.c +++ b/source/hid.c @@ -80,8 +80,8 @@ static int hid_touch(lua_State *L) { touchPosition pos; hidTouchRead(&pos); - lua_pushinteger(L, (lua_Integer)pos.px); - lua_pushinteger(L, (lua_Integer)pos.py); + lua_pushinteger(L, pos.px); + lua_pushinteger(L, pos.py); return 2; } @@ -92,8 +92,8 @@ static int hid_circle(lua_State *L) { circlePosition pos; hidCircleRead(&pos); - lua_pushinteger(L, (lua_Integer)pos.dx); - lua_pushinteger(L, (lua_Integer)pos.dy); + lua_pushinteger(L, pos.dx); + lua_pushinteger(L, pos.dy); return 2; } @@ -104,9 +104,9 @@ static int hid_accel(lua_State *L) { accelVector pos; hidAccelRead(&pos); - lua_pushinteger(L, (lua_Integer)pos.x); - lua_pushinteger(L, (lua_Integer)pos.y); - lua_pushinteger(L, (lua_Integer)pos.z); + lua_pushinteger(L, pos.x); + lua_pushinteger(L, pos.y); + lua_pushinteger(L, pos.z); return 3; } @@ -117,9 +117,9 @@ static int hid_gyro(lua_State *L) { angularRate pos; hidGyroRead(&pos); - lua_pushinteger(L, (lua_Integer)pos.x); - lua_pushinteger(L, (lua_Integer)pos.y); - lua_pushinteger(L, (lua_Integer)pos.z); + lua_pushinteger(L, pos.x); + lua_pushinteger(L, pos.y); + lua_pushinteger(L, pos.z); return 3; } @@ -128,7 +128,7 @@ static int hid_volume(lua_State *L) { u8 volume = 0; HIDUSER_GetSoundVolume(&volume); - lua_pushinteger(L, (lua_Integer)volume); + lua_pushinteger(L, volume); return 1; } diff --git a/source/ptm.c b/source/ptm.c index 83bc32f..886b30c 100644 --- a/source/ptm.c +++ b/source/ptm.c @@ -19,46 +19,46 @@ static int ptm_shutdown(lua_State *L) { } static int ptm_getShellState(lua_State *L) { - u8 *out = 0; - PTMU_GetShellState(ptmHandle, out); + u8 out = 0; + PTMU_GetShellState(ptmHandle, &out); - lua_pushinteger(L, (lua_Integer)out); + lua_pushinteger(L, out); return 1; } static int ptm_getBatteryLevel(lua_State *L) { - u8 *out = 0; - PTMU_GetBatteryLevel(ptmHandle, out); + u8 out = 0; + PTMU_GetBatteryLevel(ptmHandle, &out); - lua_pushinteger(L, (lua_Integer)out); + lua_pushinteger(L, out); return 1; } static int ptm_getBatteryChargeState(lua_State *L) { - u8 *out = 0; - PTMU_GetBatteryChargeState(ptmHandle, out); + u8 out = 0; + PTMU_GetBatteryChargeState(ptmHandle, &out); - lua_pushinteger(L, (lua_Integer)out); + lua_pushinteger(L, out); return 1; } static int ptm_getPedometerState(lua_State *L) { - u8 *out = 0; - PTMU_GetPedometerState(ptmHandle, out); + u8 out = 0; + PTMU_GetPedometerState(ptmHandle, &out); - lua_pushinteger(L, (lua_Integer)out); + lua_pushinteger(L, out); return 1; } static int ptm_getTotalStepCount(lua_State *L) { - u32 *steps = 0; - PTMU_GetTotalStepCount(ptmHandle, steps); + u32 steps = 0; + PTMU_GetTotalStepCount(ptmHandle, &steps); - lua_pushinteger(L, (lua_Integer)steps); + lua_pushinteger(L, steps); return 1; }