summaryrefslogtreecommitdiffstats
path: root/ctl-lib/ctl-lua.c
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2019-01-16 17:11:04 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2019-01-16 17:30:11 +0100
commit8f7623339beb1ba07a41a016fa0a1507da92a03e (patch)
tree6b37739538dea7b7a20f1c3bc6703c5ec18d13da /ctl-lib/ctl-lua.c
parent08a8d17b9b73f59eaf77e3eff3ed0c56fc6b58e5 (diff)
Remove useless magic number checkguppy_6.99.4guppy/6.99.46.99.4
This check is now deprecated since it complicates the mechanism and is not needed. If the retrieved struct isn't a good pointer then you got a bigger problem and that should fail then. Change-Id: If14b766ad3c96568625209043a6658fc8f17dc5f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'ctl-lib/ctl-lua.c')
-rw-r--r--ctl-lib/ctl-lua.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/ctl-lib/ctl-lua.c b/ctl-lib/ctl-lua.c
index 37db05c..e290ec1 100644
--- a/ctl-lib/ctl-lua.c
+++ b/ctl-lib/ctl-lua.c
@@ -48,12 +48,6 @@ static int CTX_MAGIC = CTX_MAGIC_VALUE;
static int CTX_MAGIC;
#endif
-#if TIMER_MAGIC_VALUE
-static int TIMER_MAGIC = TIMER_MAGIC_VALUE;
-#else
-static int TIMER_MAGIC;
-#endif
-
typedef struct {
char *name;
int count;
@@ -1017,7 +1011,7 @@ static TimerHandleT *LuaTimerPop(lua_State *luaState, int index) {
luaL_checktype(luaState, index, LUA_TLIGHTUSERDATA);
timerHandle = (TimerHandleT *) lua_touserdata(luaState, index);
- if (timerHandle == NULL && timerHandle->magic != TIMER_MAGIC) {
+ if (timerHandle == NULL) {
luaL_error(luaState, "Invalid source handle");
fprintf(stderr, "LuaSourcePop error retrieving afbSource");
return NULL;
@@ -1156,7 +1150,6 @@ static int LuaTimerSet(lua_State* luaState) {
// everything look fine create timer structure
TimerHandleT *timerHandle = malloc(sizeof (TimerHandleT));
- timerHandle->magic = TIMER_MAGIC;
timerHandle->delay = delay;
timerHandle->count = count;
timerHandle->uid = uid;