|
Lines 1-130
Link Here
|
| 1 |
--- include/tolua++.h.orig 2006-04-27 05:33:40.000000000 +0200 |
|
|
| 2 |
+++ include/tolua++.h 2008-03-13 23:20:12.000000000 +0100 |
| 3 |
@@ -53,7 +53,7 @@ |
| 4 |
#define TOLUA_NOPEER LUA_REGISTRYINDEX /* for lua 5.1 */ |
| 5 |
|
| 6 |
TOLUA_API const char* tolua_typename (lua_State* L, int lo); |
| 7 |
-TOLUA_API void tolua_error (lua_State* L, char* msg, tolua_Error* err); |
| 8 |
+TOLUA_API void tolua_error (lua_State* L, const char* msg, tolua_Error* err); |
| 9 |
TOLUA_API int tolua_isnoobj (lua_State* L, int lo, tolua_Error* err); |
| 10 |
TOLUA_API int tolua_isvalue (lua_State* L, int lo, int def, tolua_Error* err); |
| 11 |
TOLUA_API int tolua_isboolean (lua_State* L, int lo, int def, tolua_Error* err); |
| 12 |
@@ -84,16 +84,15 @@ |
| 13 |
TOLUA_API int tolua_register_gc (lua_State* L, int lo); |
| 14 |
TOLUA_API int tolua_default_collect (lua_State* tolua_S); |
| 15 |
|
| 16 |
-TOLUA_API void tolua_usertype (lua_State* L, char* type); |
| 17 |
-TOLUA_API void tolua_beginmodule (lua_State* L, char* name); |
| 18 |
+TOLUA_API void tolua_usertype (lua_State* L, const char* type); |
| 19 |
+TOLUA_API void tolua_beginmodule (lua_State* L, const char* name); |
| 20 |
TOLUA_API void tolua_endmodule (lua_State* L); |
| 21 |
-TOLUA_API void tolua_module (lua_State* L, char* name, int hasvar); |
| 22 |
-TOLUA_API void tolua_class (lua_State* L, char* name, char* base); |
| 23 |
-TOLUA_API void tolua_cclass (lua_State* L, char* lname, char* name, char* base, lua_CFunction col); |
| 24 |
-TOLUA_API void tolua_function (lua_State* L, char* name, lua_CFunction func); |
| 25 |
-TOLUA_API void tolua_constant (lua_State* L, char* name, double value); |
| 26 |
-TOLUA_API void tolua_variable (lua_State* L, char* name, lua_CFunction get, lua_CFunction set); |
| 27 |
-TOLUA_API void tolua_array (lua_State* L,char* name, lua_CFunction get, lua_CFunction set); |
| 28 |
+TOLUA_API void tolua_module (lua_State* L, const char* name, int hasvar); |
| 29 |
+TOLUA_API void tolua_cclass (lua_State* L, const char* lname, const char* name, const char* base, lua_CFunction col); |
| 30 |
+TOLUA_API void tolua_function (lua_State* L, const char* name, lua_CFunction func); |
| 31 |
+TOLUA_API void tolua_constant (lua_State* L, const char* name, double value); |
| 32 |
+TOLUA_API void tolua_variable (lua_State* L, const char* name, lua_CFunction get, lua_CFunction set); |
| 33 |
+TOLUA_API void tolua_array (lua_State* L, const char* name, lua_CFunction get, lua_CFunction set); |
| 34 |
|
| 35 |
/* TOLUA_API void tolua_set_call_event(lua_State* L, lua_CFunction func, char* type); */ |
| 36 |
/* TOLUA_API void tolua_addbase(lua_State* L, char* name, char* base); */ |
| 37 |
--- src/lib/tolua_is.c.orig 2005-12-19 02:13:05.000000000 +0100 |
| 38 |
+++ src/lib/tolua_is.c 2008-03-13 23:11:27.000000000 +0100 |
| 39 |
@@ -85,7 +85,7 @@ |
| 40 |
return lua_tostring(L,-1); |
| 41 |
} |
| 42 |
|
| 43 |
-TOLUA_API void tolua_error (lua_State* L, char* msg, tolua_Error* err) |
| 44 |
+TOLUA_API void tolua_error (lua_State* L, const char* msg, tolua_Error* err) |
| 45 |
{ |
| 46 |
if (msg[0] == '#') |
| 47 |
{ |
| 48 |
--- src/lib/tolua_map.c.orig 2006-03-13 23:37:49.000000000 +0100 |
| 49 |
+++ src/lib/tolua_map.c 2008-03-13 23:21:58.000000000 +0100 |
| 50 |
@@ -389,7 +389,7 @@ |
| 51 |
* It creates the correspoding metatable in the registry, for both 'type' and 'const type'. |
| 52 |
* It maps 'const type' as being also a 'type' |
| 53 |
*/ |
| 54 |
-TOLUA_API void tolua_usertype (lua_State* L, char* type) |
| 55 |
+TOLUA_API void tolua_usertype (lua_State* L, const char* type) |
| 56 |
{ |
| 57 |
char ctype[128] = "const "; |
| 58 |
strncat(ctype,type,120); |
| 59 |
@@ -403,7 +403,7 @@ |
| 60 |
/* Begin module |
| 61 |
* It pushes the module (or class) table on the stack |
| 62 |
*/ |
| 63 |
-TOLUA_API void tolua_beginmodule (lua_State* L, char* name) |
| 64 |
+TOLUA_API void tolua_beginmodule (lua_State* L, const char* name) |
| 65 |
{ |
| 66 |
if (name) |
| 67 |
{ |
| 68 |
@@ -426,7 +426,7 @@ |
| 69 |
* It creates a new module |
| 70 |
*/ |
| 71 |
#if 1 |
| 72 |
-TOLUA_API void tolua_module (lua_State* L, char* name, int hasvar) |
| 73 |
+TOLUA_API void tolua_module (lua_State* L, const char* name, int hasvar) |
| 74 |
{ |
| 75 |
if (name) |
| 76 |
{ |
| 77 |
@@ -462,7 +462,7 @@ |
| 78 |
lua_pop(L,1); /* pop module */ |
| 79 |
} |
| 80 |
#else |
| 81 |
-TOLUA_API void tolua_module (lua_State* L, char* name, int hasvar) |
| 82 |
+TOLUA_API void tolua_module (lua_State* L, const char* name, int hasvar) |
| 83 |
{ |
| 84 |
if (name) |
| 85 |
{ |
| 86 |
@@ -518,7 +518,7 @@ |
| 87 |
/* Map C class |
| 88 |
* It maps a C class, setting the appropriate inheritance and super classes. |
| 89 |
*/ |
| 90 |
-TOLUA_API void tolua_cclass (lua_State* L, char* lname, char* name, char* base, lua_CFunction col) |
| 91 |
+TOLUA_API void tolua_cclass (lua_State* L, const char* lname, const char* name, const char* base, lua_CFunction col) |
| 92 |
{ |
| 93 |
char cname[128] = "const "; |
| 94 |
char cbase[128] = "const "; |
| 95 |
@@ -577,7 +577,7 @@ |
| 96 |
/* Map function |
| 97 |
* It assigns a function into the current module (or class) |
| 98 |
*/ |
| 99 |
-TOLUA_API void tolua_function (lua_State* L, char* name, lua_CFunction func) |
| 100 |
+TOLUA_API void tolua_function (lua_State* L, const char* name, lua_CFunction func) |
| 101 |
{ |
| 102 |
lua_pushstring(L,name); |
| 103 |
lua_pushcfunction(L,func); |
| 104 |
@@ -600,7 +600,7 @@ |
| 105 |
/* Map constant number |
| 106 |
* It assigns a constant number into the current module (or class) |
| 107 |
*/ |
| 108 |
-TOLUA_API void tolua_constant (lua_State* L, char* name, double value) |
| 109 |
+TOLUA_API void tolua_constant (lua_State* L, const char* name, double value) |
| 110 |
{ |
| 111 |
lua_pushstring(L,name); |
| 112 |
tolua_pushnumber(L,value); |
| 113 |
@@ -611,7 +611,7 @@ |
| 114 |
/* Map variable |
| 115 |
* It assigns a variable into the current module (or class) |
| 116 |
*/ |
| 117 |
-TOLUA_API void tolua_variable (lua_State* L, char* name, lua_CFunction get, lua_CFunction set) |
| 118 |
+TOLUA_API void tolua_variable (lua_State* L, const char* name, lua_CFunction get, lua_CFunction set) |
| 119 |
{ |
| 120 |
/* get func */ |
| 121 |
lua_pushstring(L,".get"); |
| 122 |
@@ -663,7 +663,7 @@ |
| 123 |
/* Map an array |
| 124 |
* It assigns an array into the current module (or class) |
| 125 |
*/ |
| 126 |
-TOLUA_API void tolua_array (lua_State* L, char* name, lua_CFunction get, lua_CFunction set) |
| 127 |
+TOLUA_API void tolua_array (lua_State* L, const char* name, lua_CFunction get, lua_CFunction set) |
| 128 |
{ |
| 129 |
lua_pushstring(L,".get"); |
| 130 |
lua_rawget(L,-2); |