void *lua_tointegerp(lua_State *L, int idx)
{
- int *num = XCALLOC(MTYPE_TMP, sizeof(int));
+ int *num = XCALLOC(MTYPE_SCRIPT_RES, sizeof(int));
lua_decode_integerp(L, idx, num);
return num;
void *lua_tolonglongp(lua_State *L, int idx)
{
- long long *num = XCALLOC(MTYPE_TMP, sizeof(long long));
+ long long *num = XCALLOC(MTYPE_SCRIPT_RES, sizeof(long long));
lua_decode_longlongp(L, idx, num);
return num;
assert(result == 0);
result = frrscript_call(fs, "bar", ("a", &a), ("b", &b));
assert(result == 0);
- long long *cptr = frrscript_get_result(fs, "bar", "c", lua_tointegerp);
+ long long *cptr = frrscript_get_result(fs, "bar", "c", lua_tolonglongp);
/* a should not occur in the returned table in script */
assert(a == 100);
result = frrscript_call(fs, "fact", ("n", &n));
assert(result == 0);
long long *ansptr =
- frrscript_get_result(fs, "fact", "ans", lua_tointegerp);
+ frrscript_get_result(fs, "fact", "ans", lua_tolonglongp);
assert(*ansptr == 120);
/* check consecutive call + get_result without re-loading */