Skip to content

Commit 92a10fb

Browse files
committed
Applied source code semantic modification.
Removed unusable function.
1 parent a35a1e6 commit 92a10fb

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/lapi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,7 @@ LUA_API int lua_load (lua_State *L, lua_Reader reader, void *data,
898898
}
899899

900900

901+
#ifdef WITH_STRING_DUMP
901902
LUA_API int lua_dump (lua_State *L, lua_Writer writer, void *data) {
902903
int status;
903904
TValue *o;
@@ -911,7 +912,7 @@ LUA_API int lua_dump (lua_State *L, lua_Writer writer, void *data) {
911912
lua_unlock(L);
912913
return status;
913914
}
914-
915+
#endif
915916

916917
LUA_API int lua_status (lua_State *L) {
917918
return L->status;

src/ldump.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "lobject.h"
1515
#include "lstate.h"
1616
#include "lundump.h"
17+
#ifdef WITH_STRING_DUMP
1718

1819
typedef struct {
1920
lua_State* L;
@@ -162,3 +163,5 @@ int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip
162163
DumpFunction(f,NULL,&D);
163164
return D.status;
164165
}
166+
167+
#endif // WITH_STRING_DUMP

src/lstrlib.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ static int writer (lua_State *L, const void* b, size_t size, void* B) {
144144
}
145145

146146

147+
#ifdef WITH_STRING_DUMP
147148
static int str_dump (lua_State *L) {
148149
luaL_Buffer b;
149150
luaL_checktype(L, 1, LUA_TFUNCTION);
@@ -154,7 +155,7 @@ static int str_dump (lua_State *L) {
154155
luaL_pushresult(&b);
155156
return 1;
156157
}
157-
158+
#endif
158159

159160

160161
/*
@@ -827,7 +828,9 @@ static int str_format (lua_State *L) {
827828
static const luaL_Reg strlib[] = {
828829
{"byte", str_byte},
829830
{"char", str_char},
831+
#ifdef WITH_STRING_DUMP
830832
{"dump", str_dump},
833+
#endif
831834
{"find", str_find},
832835
{"format", str_format},
833836
{"gfind", gfind_nodef},

0 commit comments

Comments
 (0)