aboutsummaryrefslogtreecommitdiff
path: root/src/tools.h
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2024-04-10 09:48:59 +0200
committerBenoit Germain <benoit.germain@ubisoft.com>2024-04-10 09:48:59 +0200
commit408f8a5bf7934e7a5aa113fd3a55899db70dd73a (patch)
treeaf1a63c4d5c81fe8b2f97ee32842fe89d2c457fe /src/tools.h
parent8f75e0ff26645ced3669f600aa5e9133bb7b49af (diff)
downloadlanes-408f8a5bf7934e7a5aa113fd3a55899db70dd73a.tar.gz
lanes-408f8a5bf7934e7a5aa113fd3a55899db70dd73a.tar.bz2
lanes-408f8a5bf7934e7a5aa113fd3a55899db70dd73a.zip
C++ migration: luaG_inter_copy_* now return an enum class instead of an anonymous int
Diffstat (limited to 'src/tools.h')
-rw-r--r--src/tools.h23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/tools.h b/src/tools.h
index f0de7ec..dce7378 100644
--- a/src/tools.h
+++ b/src/tools.h
@@ -1,8 +1,6 @@
1#pragma once 1#pragma once
2 2
3#include "threading.h"
4#include "deep.h" 3#include "deep.h"
5
6#include "macros_and_utils.h" 4#include "macros_and_utils.h"
7 5
8// forwards 6// forwards
@@ -11,13 +9,13 @@ class Universe;
11// ################################################################################################ 9// ################################################################################################
12 10
13#ifdef _DEBUG 11#ifdef _DEBUG
14void luaG_dump( lua_State* L); 12void luaG_dump(lua_State* L);
15#endif // _DEBUG 13#endif // _DEBUG
16 14
17// ################################################################################################ 15// ################################################################################################
18 16
19void push_registry_subtable_mode( lua_State* L, UniqueKey key_, const char* mode_); 17void push_registry_subtable_mode(lua_State* L, UniqueKey key_, const char* mode_);
20void push_registry_subtable( lua_State* L, UniqueKey key_); 18void push_registry_subtable(lua_State* L, UniqueKey key_);
21 19
22enum class VT 20enum class VT
23{ 21{
@@ -25,14 +23,21 @@ enum class VT
25 KEY, 23 KEY,
26 METATABLE 24 METATABLE
27}; 25};
26
27enum class InterCopyResult
28{
29 Success,
30 NotEnoughValues,
31 Error
32};
33
28[[nodiscard]] bool inter_copy_one(Universe* U, Dest L2, int L2_cache_i, Source L, int i, VT vt_, LookupMode mode_, char const* upName_); 34[[nodiscard]] bool inter_copy_one(Universe* U, Dest L2, int L2_cache_i, Source L, int i, VT vt_, LookupMode mode_, char const* upName_);
29 35
30// ################################################################################################ 36// ################################################################################################
31 37
32[[nodiscard]] int luaG_inter_copy_package(Universe* U, Source L, Dest L2, int package_idx_, LookupMode mode_); 38[[nodiscard]] InterCopyResult luaG_inter_copy_package(Universe* U, Source L, Dest L2, int package_idx_, LookupMode mode_);
33 39[[nodiscard]] InterCopyResult luaG_inter_copy(Universe* U, Source L, Dest L2, int n, LookupMode mode_);
34[[nodiscard]] int luaG_inter_copy(Universe* U, Source L, Dest L2, int n, LookupMode mode_); 40[[nodiscard]] InterCopyResult luaG_inter_move(Universe* U, Source L, Dest L2, int n, LookupMode mode_);
35[[nodiscard]] int luaG_inter_move(Universe* U, Source L, Dest L2, int n, LookupMode mode_);
36 41
37[[nodiscard]] int luaG_nameof(lua_State* L); 42[[nodiscard]] int luaG_nameof(lua_State* L);
38 43