diff options
author | David Walter Seikel | 2012-04-22 09:19:23 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-04-22 09:19:23 +1000 |
commit | c963d75dfdeec11f82e79e727062fbf89afa2c04 (patch) | |
tree | 895633dbf641110be46f117c29890c49b3ffc0bd /libraries/edje/src/lib/edje_lua2.c | |
parent | Adding the new extantz viewer and grid manager. (diff) | |
download | SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.zip SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.gz SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.bz2 SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.xz |
Update EFL to latest beta.
Diffstat (limited to 'libraries/edje/src/lib/edje_lua2.c')
-rw-r--r-- | libraries/edje/src/lib/edje_lua2.c | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/libraries/edje/src/lib/edje_lua2.c b/libraries/edje/src/lib/edje_lua2.c index 1d167e9..fd88f31 100644 --- a/libraries/edje/src/lib/edje_lua2.c +++ b/libraries/edje/src/lib/edje_lua2.c | |||
@@ -6,11 +6,6 @@ | |||
6 | 6 | ||
7 | #define RASTER_FORGOT_WHY "this is here." | 7 | #define RASTER_FORGOT_WHY "this is here." |
8 | 8 | ||
9 | #ifdef _WIN32 | ||
10 | # define FMT_SIZE_T "%Iu" | ||
11 | #else | ||
12 | # define FMT_SIZE_T "%zu" | ||
13 | #endif | ||
14 | 9 | ||
15 | //--------------------------------------------------------------------------// | 10 | //--------------------------------------------------------------------------// |
16 | #define MAX_LUA_MEM (4 * (1024 * 1024)) | 11 | #define MAX_LUA_MEM (4 * (1024 * 1024)) |
@@ -216,7 +211,7 @@ _elua_alloc(void *ud, void *ptr, size_t osize, size_t nsize) | |||
216 | ela->cur += nsize - osize; | 211 | ela->cur += nsize - osize; |
217 | if (ela->cur > ela->max) | 212 | if (ela->cur > ela->max) |
218 | { | 213 | { |
219 | ERR("Lua memory limit of " FMT_SIZE_T " bytes reached (" FMT_SIZE_T " allocated)", | 214 | ERR("Lua memory limit of %zu bytes reached (%zu allocated)", |
220 | ela->max, ela->cur); | 215 | ela->max, ela->cur); |
221 | return NULL; | 216 | return NULL; |
222 | } | 217 | } |
@@ -228,7 +223,7 @@ _elua_alloc(void *ud, void *ptr, size_t osize, size_t nsize) | |||
228 | 223 | ||
229 | ptr2 = realloc(ptr, nsize); | 224 | ptr2 = realloc(ptr, nsize); |
230 | if (ptr2) return ptr2; | 225 | if (ptr2) return ptr2; |
231 | ERR("Lua cannot re-allocate " FMT_SIZE_T " bytes", nsize); | 226 | ERR("Lua cannot re-allocate %zu bytes", nsize); |
232 | return ptr2; | 227 | return ptr2; |
233 | } | 228 | } |
234 | 229 | ||
@@ -698,7 +693,7 @@ static int | |||
698 | _elua_echo(lua_State *L) // Stack usage [-0, +0, v] | 693 | _elua_echo(lua_State *L) // Stack usage [-0, +0, v] |
699 | { | 694 | { |
700 | const char *string = luaL_checkstring(L, 1); // Stack usage [-0, +0, v] | 695 | const char *string = luaL_checkstring(L, 1); // Stack usage [-0, +0, v] |
701 | LD("%s\n", string); | 696 | LD("%s", string); |
702 | return 0; | 697 | return 0; |
703 | } | 698 | } |
704 | 699 | ||
@@ -2657,16 +2652,16 @@ _elua_edje_file(lua_State *L) // Stack usage [ | |||
2657 | 2652 | ||
2658 | switch (err) | 2653 | switch (err) |
2659 | { | 2654 | { |
2660 | case EDJE_LOAD_ERROR_NONE : LE("Edje file loading errer %s %s - no error happened, but you should not see this.\n", obj->ed->file->path, group); break; | 2655 | case EDJE_LOAD_ERROR_NONE : LE("Edje file loading errer %s %s - no error happened, but you should not see this.", obj->ed->file->path, group); break; |
2661 | case EDJE_LOAD_ERROR_GENERIC : LE("Edje file loading errer %s %s - generic error.\n", obj->ed->file->path, group); break; | 2656 | case EDJE_LOAD_ERROR_GENERIC : LE("Edje file loading errer %s %s - generic error.", obj->ed->file->path, group); break; |
2662 | case EDJE_LOAD_ERROR_DOES_NOT_EXIST : LE("Edje file loading errer %s %s - file does not exist.\n", obj->ed->file->path, group); break; | 2657 | case EDJE_LOAD_ERROR_DOES_NOT_EXIST : LE("Edje file loading errer %s %s - file does not exist.", obj->ed->file->path, group); break; |
2663 | case EDJE_LOAD_ERROR_PERMISSION_DENIED : LE("Edje file loading errer %s %s - permission denied reading the file.\n", obj->ed->file->path, group); break; | 2658 | case EDJE_LOAD_ERROR_PERMISSION_DENIED : LE("Edje file loading errer %s %s - permission denied reading the file.", obj->ed->file->path, group); break; |
2664 | case EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED : LE("Edje file loading errer %s %s - resource allocation failed.\n", obj->ed->file->path, group); break; | 2659 | case EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED : LE("Edje file loading errer %s %s - resource allocation failed.", obj->ed->file->path, group); break; |
2665 | case EDJE_LOAD_ERROR_CORRUPT_FILE : LE("Edje file loading errer %s %s - corrupt file.\n", obj->ed->file->path, group); break; | 2660 | case EDJE_LOAD_ERROR_CORRUPT_FILE : LE("Edje file loading errer %s %s - corrupt file.", obj->ed->file->path, group); break; |
2666 | case EDJE_LOAD_ERROR_UNKNOWN_FORMAT : LE("Edje file loading errer %s %s - unknown file format.\n", obj->ed->file->path, group); break; | 2661 | case EDJE_LOAD_ERROR_UNKNOWN_FORMAT : LE("Edje file loading errer %s %s - unknown file format.", obj->ed->file->path, group); break; |
2667 | case EDJE_LOAD_ERROR_INCOMPATIBLE_FILE : LE("Edje file loading errer %s %s - incompatible file.\n", obj->ed->file->path, group); break; | 2662 | case EDJE_LOAD_ERROR_INCOMPATIBLE_FILE : LE("Edje file loading errer %s %s - incompatible file.", obj->ed->file->path, group); break; |
2668 | case EDJE_LOAD_ERROR_UNKNOWN_COLLECTION : LE("Edje file loading errer %s %s - unknown group.\n", obj->ed->file->path, group); break; | 2663 | case EDJE_LOAD_ERROR_UNKNOWN_COLLECTION : LE("Edje file loading errer %s %s - unknown group.", obj->ed->file->path, group); break; |
2669 | case EDJE_LOAD_ERROR_RECURSIVE_REFERENCE : LE("Edje file loading errer %s %s - recursive reference in group.\n", obj->ed->file->path, group); break; | 2664 | case EDJE_LOAD_ERROR_RECURSIVE_REFERENCE : LE("Edje file loading errer %s %s - recursive reference in group.", obj->ed->file->path, group); break; |
2670 | } | 2665 | } |
2671 | } | 2666 | } |
2672 | } | 2667 | } |
@@ -2865,13 +2860,14 @@ _elua_image_image(lua_State *L) // Stack usage [ | |||
2865 | } | 2860 | } |
2866 | } | 2861 | } |
2867 | 2862 | ||
2868 | /* Sandbox lua - Only allow access to images within the same edje file. I'm not so sure we need this level of sandboxing though. So leaving it here, just in case. | ||
2869 | if (-1 == id) | 2863 | if (-1 == id) |
2870 | { | 2864 | { |
2871 | LI("Image %s not found in our edje file, trying external image file %s.\n", key, file); | 2865 | LE("Image %s not found in our edje file.", key); |
2866 | /* Sandbox lua - Only allow access to images within the same edje file. I'm not so sure we need this level of sandboxing though. So leaving it here, just in case. | ||
2867 | LI("Image %s not found in our edje file, trying external image file %s.", key, file); | ||
2872 | evas_object_image_file_set(elo->evas_obj, file, key); | 2868 | evas_object_image_file_set(elo->evas_obj, file, key); |
2869 | */ | ||
2873 | } | 2870 | } |
2874 | */ | ||
2875 | } | 2871 | } |
2876 | evas_object_image_file_get(elo->evas_obj, &file, &key); | 2872 | evas_object_image_file_get(elo->evas_obj, &file, &key); |
2877 | _elua_ret(L, "$file $key", file, key); | 2873 | _elua_ret(L, "$file $key", file, key); |