aboutsummaryrefslogtreecommitdiff
path: root/src/lanes.cpp
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2024-03-28 12:33:05 +0100
committerBenoit Germain <benoit.germain@ubisoft.com>2024-03-28 12:33:05 +0100
commit2f049249c8d861193e348e042a203a034982adc1 (patch)
treeb183b544fd3904b69bdcb161344f544cf470466f /src/lanes.cpp
parente8d818bf0da2b1b2f296e17112cafe8b9f6f4d8a (diff)
downloadlanes-2f049249c8d861193e348e042a203a034982adc1.tar.gz
lanes-2f049249c8d861193e348e042a203a034982adc1.tar.bz2
lanes-2f049249c8d861193e348e042a203a034982adc1.zip
C++ migration: cleanup usage of lua_error and luaL_error
Diffstat (limited to 'src/lanes.cpp')
-rw-r--r--src/lanes.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/lanes.cpp b/src/lanes.cpp
index a378a88..2f17e6e 100644
--- a/src/lanes.cpp
+++ b/src/lanes.cpp
@@ -1110,7 +1110,7 @@ LUAG_FUNC( lane_new)
1110 if( lua_isnil( L2, -1)) 1110 if( lua_isnil( L2, -1))
1111 { 1111 {
1112 lua_pop( L2, 1); // 1112 lua_pop( L2, 1); //
1113 luaL_error( L, "cannot pre-require modules without loading 'package' library first"); 1113 return luaL_error( L, "cannot pre-require modules without loading 'package' library first");
1114 } 1114 }
1115 else 1115 else
1116 { 1116 {
@@ -1119,7 +1119,7 @@ LUAG_FUNC( lane_new)
1119 { 1119 {
1120 // propagate error to main state if any 1120 // propagate error to main state if any
1121 luaG_inter_move( U, L2, L, 1, eLM_LaneBody); // func libs priority globals package required gc_cb [... args ...] n "modname" error 1121 luaG_inter_move( U, L2, L, 1, eLM_LaneBody); // func libs priority globals package required gc_cb [... args ...] n "modname" error
1122 return lua_error( L); 1122 raise_lua_error(L);
1123 } 1123 }
1124 // after requiring the module, register the functions it exported in our name<->function database 1124 // after requiring the module, register the functions it exported in our name<->function database
1125 populate_func_lookup_table( L2, -1, name); 1125 populate_func_lookup_table( L2, -1, name);
@@ -1538,11 +1538,9 @@ LUAG_FUNC( thread_index)
1538 lua_pushliteral( L, "Unexpected status: "); 1538 lua_pushliteral( L, "Unexpected status: ");
1539 lua_pushstring( L, thread_status_string( s)); 1539 lua_pushstring( L, thread_status_string( s));
1540 lua_concat( L, 2); 1540 lua_concat( L, 2);
1541 lua_error( L); 1541 raise_lua_error(L);
1542 break;
1543 } 1542 }
1544 // fall through if we are killed, as we got nil, "killed" on the stack 1543 [[fallthrough]]; // fall through if we are killed, as we got nil, "killed" on the stack
1545 [[fallthrough]];
1546 1544
1547 case DONE: // got regular return values 1545 case DONE: // got regular return values
1548 { 1546 {