diff options
author | Daniel Kolesa <d.kolesa@osg.samsung.com> | 2015-04-24 16:01:24 +0100 |
---|---|---|
committer | Daniel Kolesa <d.kolesa@osg.samsung.com> | 2015-05-06 15:05:23 +0100 |
commit | e73f7f7a40ba3832d743ae4b893940440a38e3d4 (patch) | |
tree | 4e115a67920858cbd16f01dcaa37eec9a3153ccb /src/lib/elua/elua.c | |
parent | e9aadea402f2f533e6d9137171f5bff4eeb4bafc (diff) |
elua lib: use Eina_Bool as return val in some utils
Diffstat (limited to 'src/lib/elua/elua.c')
-rw-r--r-- | src/lib/elua/elua.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/lib/elua/elua.c b/src/lib/elua/elua.c index 9ad15d17f0..6cb2e13d71 100644 --- a/src/lib/elua/elua.c +++ b/src/lib/elua/elua.c | |||
@@ -468,11 +468,11 @@ _elua_getargs(Elua_State *es, int argc, char **argv, int n) | |||
468 | return narg; | 468 | return narg; |
469 | } | 469 | } |
470 | 470 | ||
471 | EAPI int | 471 | EAPI Eina_Bool |
472 | elua_util_require(Elua_State *es, const char *libname) | 472 | elua_util_require(Elua_State *es, const char *libname) |
473 | { | 473 | { |
474 | EINA_SAFETY_ON_NULL_RETURN_VAL(es, -1); | 474 | EINA_SAFETY_ON_NULL_RETURN_VAL(es, EINA_FALSE); |
475 | EINA_SAFETY_ON_NULL_RETURN_VAL(es->luastate, -1); | 475 | EINA_SAFETY_ON_NULL_RETURN_VAL(es->luastate, EINA_FALSE); |
476 | if (!elua_state_require_ref_push(es)) | 476 | if (!elua_state_require_ref_push(es)) |
477 | { | 477 | { |
478 | /* store stuff until things are correctly set up */ | 478 | /* store stuff until things are correctly set up */ |
@@ -480,26 +480,26 @@ elua_util_require(Elua_State *es, const char *libname) | |||
480 | return 0; | 480 | return 0; |
481 | } | 481 | } |
482 | lua_pushstring(es->luastate, libname); | 482 | lua_pushstring(es->luastate, libname); |
483 | return elua_util_error_report(es, lua_pcall(es->luastate, 1, 0, 0)); | 483 | return !elua_util_error_report(es, lua_pcall(es->luastate, 1, 0, 0)); |
484 | } | 484 | } |
485 | 485 | ||
486 | EAPI int | 486 | EAPI Eina_Bool |
487 | elua_util_file_run(Elua_State *es, const char *fname) | 487 | elua_util_file_run(Elua_State *es, const char *fname) |
488 | { | 488 | { |
489 | EINA_SAFETY_ON_NULL_RETURN_VAL(es, -1); | 489 | EINA_SAFETY_ON_NULL_RETURN_VAL(es, EINA_FALSE); |
490 | EINA_SAFETY_ON_NULL_RETURN_VAL(es->luastate, -1); | 490 | EINA_SAFETY_ON_NULL_RETURN_VAL(es->luastate, EINA_FALSE); |
491 | return elua_util_error_report(es, elua_io_loadfile(es, fname) | 491 | return !elua_util_error_report(es, elua_io_loadfile(es, fname) |
492 | || _elua_docall(es, 0, 1)); | 492 | || _elua_docall(es, 0, 1)); |
493 | } | 493 | } |
494 | 494 | ||
495 | EAPI int | 495 | EAPI Eina_Bool |
496 | elua_util_string_run(Elua_State *es, const char *chunk, const char *chname) | 496 | elua_util_string_run(Elua_State *es, const char *chunk, const char *chname) |
497 | { | 497 | { |
498 | EINA_SAFETY_ON_NULL_RETURN_VAL(es, -1); | 498 | EINA_SAFETY_ON_NULL_RETURN_VAL(es, EINA_FALSE); |
499 | EINA_SAFETY_ON_NULL_RETURN_VAL(es->luastate, -1); | 499 | EINA_SAFETY_ON_NULL_RETURN_VAL(es->luastate, EINA_FALSE); |
500 | return elua_util_error_report(es, luaL_loadbuffer(es->luastate, chunk, | 500 | return !elua_util_error_report(es, luaL_loadbuffer(es->luastate, chunk, |
501 | strlen(chunk), chname) | 501 | strlen(chunk), chname) |
502 | || _elua_docall(es, 0, 0)); | 502 | || _elua_docall(es, 0, 0)); |
503 | } | 503 | } |
504 | 504 | ||
505 | EAPI Eina_Bool | 505 | EAPI Eina_Bool |
@@ -519,7 +519,7 @@ elua_util_app_load(Elua_State *es, const char *appname) | |||
519 | return EINA_TRUE; | 519 | return EINA_TRUE; |
520 | } | 520 | } |
521 | 521 | ||
522 | EAPI int | 522 | EAPI Eina_Bool |
523 | elua_util_script_run(Elua_State *es, int argc, char **argv, int n, int *quit) | 523 | elua_util_script_run(Elua_State *es, int argc, char **argv, int n, int *quit) |
524 | { | 524 | { |
525 | int status, narg; | 525 | int status, narg; |
@@ -555,7 +555,7 @@ elua_util_script_run(Elua_State *es, int argc, char **argv, int n, int *quit) | |||
555 | *quit = lua_toboolean(es->luastate, -1); | 555 | *quit = lua_toboolean(es->luastate, -1); |
556 | lua_pop(es->luastate, 1); | 556 | lua_pop(es->luastate, 1); |
557 | } | 557 | } |
558 | return elua_util_error_report(es, status); | 558 | return !elua_util_error_report(es, status); |
559 | } | 559 | } |
560 | 560 | ||
561 | static void | 561 | static void |