diff --git a/server/src/lua/error.hpp b/server/src/lua/error.hpp index 75adabd1..46496a07 100644 --- a/server/src/lua/error.hpp +++ b/server/src/lua/error.hpp @@ -3,7 +3,7 @@ * * This file is part of the traintastic source code. * - * Copyright (C) 2021 Reinder Feenstra + * Copyright (C) 2021-2022 Reinder Feenstra * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -29,8 +29,8 @@ namespace Lua { // Note: -// All these functions call abort(), it's just a trick to let the compiler understand it is a noretrun function, -// Lua's error funtions aren't marked as noretrun functions, but they are. +// All these functions call abort(), it's just a trick to let the compiler understand it is a noreturn function, +// Lua's error funtions aren't marked as noreturn functions, but they are. [[noreturn]] inline void errorArgumentOutOfRange(lua_State* L, int arg) { luaL_argerror(L, arg, "out of range"); abort(); } @@ -38,7 +38,6 @@ namespace Lua { [[noreturn]] inline void errorCantSetReadOnlyProperty(lua_State* L) { luaL_error(L, "can't set read only property"); abort(); } [[noreturn]] inline void errorDeadEvent(lua_State* L) { luaL_error(L, "dead event"); abort(); } -[[noreturn]] inline void errorDeadMethod(lua_State* L) { luaL_error(L, "dead method"); abort(); } [[noreturn]] inline void errorDeadObject(lua_State* L) { luaL_error(L, "dead object"); abort(); } [[noreturn]] inline void errorExpectedNArgumentsGotN(lua_State* L, int expected, int got) { luaL_error(L, "expected %d arguments, got %d", expected, got); abort(); } diff --git a/server/src/lua/method.cpp b/server/src/lua/method.cpp index 6e6082c7..4960ef57 100644 --- a/server/src/lua/method.cpp +++ b/server/src/lua/method.cpp @@ -3,7 +3,7 @@ * * This file is part of the traintastic source code. * - * Copyright (C) 2019-2020 Reinder Feenstra + * Copyright (C) 2019-2020,2022 Reinder Feenstra * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -46,7 +46,7 @@ AbstractMethod& Method::check(lua_State* L, int index) if(!data.object.expired()) return data.method; - errorDeadMethod(L); + errorDeadObject(L); } AbstractMethod* Method::test(lua_State* L, int index) @@ -57,7 +57,7 @@ AbstractMethod* Method::test(lua_State* L, int index) if(!(**data).object.expired()) return &(**data).method; - errorDeadMethod(L); + errorDeadObject(L); } void Method::push(lua_State* L, AbstractMethod& value)