Skip to content

Commit 1c21cf4

Browse files
att
1 parent 0e12d33 commit 1c21cf4

File tree

6 files changed

+17
-93
lines changed

6 files changed

+17
-93
lines changed

LuaCEmbed.h

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -22960,42 +22960,28 @@ void privateLuaCEmbedTableArray_free(privateLuaCEmbedTableArray *self);
2296022960
#define PRIVATE_LUA_CEMBED_TABLE_PROTECT_VOID \
2296122961
if(!self){ \
2296222962
return; \
22963-
} \
22964-
if(LuaCEmbed_has_errors(self->main_object)){ \
22965-
return; \
2296622963
}
2296722964

2296822965
#define PRIVATE_LUA_CEMBED_TABLE_PROTECT_NUM \
2296922966
if(!self){ \
2297022967
return LUA_CEMBED_GENERIC_ERROR; \
22971-
} \
22972-
if(LuaCEmbed_has_errors(self->main_object)){ \
22973-
return LUA_CEMBED_GENERIC_ERROR; \
2297422968
}
2297522969

2297622970
#define PRIVATE_LUA_CEMBED_TABLE_PROTECT_BOOL \
2297722971
if(!self){ \
2297822972
return false; \
22979-
} \
22980-
if(LuaCEmbed_has_errors(self->main_object)){ \
22981-
return false; \
2298222973
}
2298322974

22984-
2298522975
#define PRIVATE_LUA_CEMBED_TABLE_PROTECT_NULL \
2298622976
if(!self){ \
2298722977
return NULL; \
22988-
} \
22989-
if(LuaCEmbed_has_errors(self->main_object)){ \
22990-
return NULL; \
2299122978
}
2299222979

2299322980

2299422981

2299522982

2299622983

2299722984

22998-
2299922985
int LuaCEmbed_ensure_arg_exist(LuaCEmbed *self, private_lua_cembed_incremented_arg index);
2300022986

2300122987
int LuaCEmbed_ensure_arg_type(LuaCEmbed *self, private_lua_cembed_incremented_arg index, int arg_type);
@@ -23137,41 +23123,27 @@ bool LuaCEmbed_get_evaluation_bool(LuaCEmbed *self,const char *code, ...);
2313723123
#define PRIVATE_LUA_CEMBED_PROTECT_VOID \
2313823124
if(!self){ \
2313923125
return; \
23140-
} \
23141-
if(LuaCEmbed_has_errors(self)){ \
23142-
return; \
2314323126
}
2314423127

23128+
2314523129
#define PRIVATE_LUA_CEMBED_PROTECT_NUM \
2314623130
if(!self){ \
2314723131
return LUA_CEMBED_GENERIC_ERROR; \
23148-
} \
23149-
if(LuaCEmbed_has_errors(self)){ \
23150-
return LUA_CEMBED_GENERIC_ERROR; \
2315123132
}
2315223133

2315323134
#define PRIVATE_LUA_CEMBED_PROTECT_BOOL \
2315423135
if(!self){ \
2315523136
return false; \
23156-
} \
23157-
if(LuaCEmbed_has_errors(self)){ \
23158-
return false; \
2315923137
}
2316023138

23161-
2316223139
#define PRIVATE_LUA_CEMBED_PROTECT_NULL \
2316323140
if(!self){ \
2316423141
return NULL; \
23165-
} \
23166-
if(LuaCEmbed_has_errors(self)){ \
23167-
return NULL; \
2316823142
}
2316923143

2317023144

2317123145

2317223146

23173-
23174-
2317523147
void LuaCEmbed_set_long_lib_prop(LuaCEmbed *self,const char *name,long value);
2317623148

2317723149
void LuaCEmbed_set_double_lib_prop(LuaCEmbed *self,const char *name,double value);
@@ -23631,10 +23603,11 @@ void * privateLuaCEmbed_get_current_table_array(LuaCEmbed *self){
2363123603
return self->global_tables;
2363223604
}
2363323605
void privateLuaCEmbed_raise_error_not_jumping(LuaCEmbed *self, const char *error, ...){
23634-
if(!self){
23606+
23607+
if(LuaCEmbed_has_errors(self)){
2363523608
return;
2363623609
}
23637-
LuaCEmbed_clear_errors(self);
23610+
2363823611
va_list args;
2363923612
va_start(args,error);
2364023613
self->error_msg = private_LuaCembed_format_vaarg(error, args);

main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#include "src/one.c"
2+
3+
int main(){
4+
5+
}

src/LuaCEmbed/basic/basic.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,11 @@ void * privateLuaCEmbed_get_current_table_array(LuaCEmbed *self){
9898
return self->global_tables;
9999
}
100100
void privateLuaCEmbed_raise_error_not_jumping(LuaCEmbed *self, const char *error, ...){
101-
if(!self){
101+
102+
if(LuaCEmbed_has_errors(self)){
102103
return;
103104
}
104-
LuaCEmbed_clear_errors(self);
105+
105106
va_list args;
106107
va_start(args,error);
107108
self->error_msg = private_LuaCembed_format_vaarg(error, args);

src/LuaCEmbed/protection_macros.h

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,20 @@
11
#define PRIVATE_LUA_CEMBED_PROTECT_VOID \
22
if(!self){ \
33
return; \
4-
} \
5-
if(LuaCEmbed_has_errors(self)){ \
6-
return; \
74
}
85

6+
97
#define PRIVATE_LUA_CEMBED_PROTECT_NUM \
108
if(!self){ \
119
return LUA_CEMBED_GENERIC_ERROR; \
12-
} \
13-
if(LuaCEmbed_has_errors(self)){ \
14-
return LUA_CEMBED_GENERIC_ERROR; \
1510
}
1611

1712
#define PRIVATE_LUA_CEMBED_PROTECT_BOOL \
1813
if(!self){ \
1914
return false; \
20-
} \
21-
if(LuaCEmbed_has_errors(self)){ \
22-
return false; \
2315
}
2416

25-
2617
#define PRIVATE_LUA_CEMBED_PROTECT_NULL \
2718
if(!self){ \
2819
return NULL; \
29-
} \
30-
if(LuaCEmbed_has_errors(self)){ \
31-
return NULL; \
3220
}
33-
34-
Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,19 @@
11
#define PRIVATE_LUA_CEMBED_TABLE_PROTECT_VOID \
22
if(!self){ \
33
return; \
4-
} \
5-
if(LuaCEmbed_has_errors(self->main_object)){ \
6-
return; \
74
}
85

96
#define PRIVATE_LUA_CEMBED_TABLE_PROTECT_NUM \
107
if(!self){ \
118
return LUA_CEMBED_GENERIC_ERROR; \
12-
} \
13-
if(LuaCEmbed_has_errors(self->main_object)){ \
14-
return LUA_CEMBED_GENERIC_ERROR; \
159
}
1610

1711
#define PRIVATE_LUA_CEMBED_TABLE_PROTECT_BOOL \
1812
if(!self){ \
1913
return false; \
20-
} \
21-
if(LuaCEmbed_has_errors(self->main_object)){ \
22-
return false; \
2314
}
2415

25-
2616
#define PRIVATE_LUA_CEMBED_TABLE_PROTECT_NULL \
2717
if(!self){ \
2818
return NULL; \
29-
} \
30-
if(LuaCEmbed_has_errors(self->main_object)){ \
31-
return NULL; \
3219
}
33-

tests/LuaCEmbed.h

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -22960,42 +22960,28 @@ void privateLuaCEmbedTableArray_free(privateLuaCEmbedTableArray *self);
2296022960
#define PRIVATE_LUA_CEMBED_TABLE_PROTECT_VOID \
2296122961
if(!self){ \
2296222962
return; \
22963-
} \
22964-
if(LuaCEmbed_has_errors(self->main_object)){ \
22965-
return; \
2296622963
}
2296722964

2296822965
#define PRIVATE_LUA_CEMBED_TABLE_PROTECT_NUM \
2296922966
if(!self){ \
2297022967
return LUA_CEMBED_GENERIC_ERROR; \
22971-
} \
22972-
if(LuaCEmbed_has_errors(self->main_object)){ \
22973-
return LUA_CEMBED_GENERIC_ERROR; \
2297422968
}
2297522969

2297622970
#define PRIVATE_LUA_CEMBED_TABLE_PROTECT_BOOL \
2297722971
if(!self){ \
2297822972
return false; \
22979-
} \
22980-
if(LuaCEmbed_has_errors(self->main_object)){ \
22981-
return false; \
2298222973
}
2298322974

22984-
2298522975
#define PRIVATE_LUA_CEMBED_TABLE_PROTECT_NULL \
2298622976
if(!self){ \
2298722977
return NULL; \
22988-
} \
22989-
if(LuaCEmbed_has_errors(self->main_object)){ \
22990-
return NULL; \
2299122978
}
2299222979

2299322980

2299422981

2299522982

2299622983

2299722984

22998-
2299922985
int LuaCEmbed_ensure_arg_exist(LuaCEmbed *self, private_lua_cembed_incremented_arg index);
2300022986

2300122987
int LuaCEmbed_ensure_arg_type(LuaCEmbed *self, private_lua_cembed_incremented_arg index, int arg_type);
@@ -23137,41 +23123,27 @@ bool LuaCEmbed_get_evaluation_bool(LuaCEmbed *self,const char *code, ...);
2313723123
#define PRIVATE_LUA_CEMBED_PROTECT_VOID \
2313823124
if(!self){ \
2313923125
return; \
23140-
} \
23141-
if(LuaCEmbed_has_errors(self)){ \
23142-
return; \
2314323126
}
2314423127

23128+
2314523129
#define PRIVATE_LUA_CEMBED_PROTECT_NUM \
2314623130
if(!self){ \
2314723131
return LUA_CEMBED_GENERIC_ERROR; \
23148-
} \
23149-
if(LuaCEmbed_has_errors(self)){ \
23150-
return LUA_CEMBED_GENERIC_ERROR; \
2315123132
}
2315223133

2315323134
#define PRIVATE_LUA_CEMBED_PROTECT_BOOL \
2315423135
if(!self){ \
2315523136
return false; \
23156-
} \
23157-
if(LuaCEmbed_has_errors(self)){ \
23158-
return false; \
2315923137
}
2316023138

23161-
2316223139
#define PRIVATE_LUA_CEMBED_PROTECT_NULL \
2316323140
if(!self){ \
2316423141
return NULL; \
23165-
} \
23166-
if(LuaCEmbed_has_errors(self)){ \
23167-
return NULL; \
2316823142
}
2316923143

2317023144

2317123145

2317223146

23173-
23174-
2317523147
void LuaCEmbed_set_long_lib_prop(LuaCEmbed *self,const char *name,long value);
2317623148

2317723149
void LuaCEmbed_set_double_lib_prop(LuaCEmbed *self,const char *name,double value);
@@ -23631,10 +23603,11 @@ void * privateLuaCEmbed_get_current_table_array(LuaCEmbed *self){
2363123603
return self->global_tables;
2363223604
}
2363323605
void privateLuaCEmbed_raise_error_not_jumping(LuaCEmbed *self, const char *error, ...){
23634-
if(!self){
23606+
23607+
if(LuaCEmbed_has_errors(self)){
2363523608
return;
2363623609
}
23637-
LuaCEmbed_clear_errors(self);
23610+
2363823611
va_list args;
2363923612
va_start(args,error);
2364023613
self->error_msg = private_LuaCembed_format_vaarg(error, args);

0 commit comments

Comments
 (0)