Skip to content

Commit 103835d

Browse files
authored
Merge pull request #5590 from ab9rf/develop
add missing `const` qualifiers
2 parents 70bcf32 + a82d35f commit 103835d

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

library/LuaTools.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,7 @@ bool DFHack::Lua::Require(color_ostream &out, lua_State *state,
10771077
}
10781078

10791079
static bool doAssignDFObject(color_ostream *out, lua_State *state,
1080-
type_identity *type, void *target, int val_index,
1080+
const type_identity *type, void *target, int val_index,
10811081
bool exact, bool perr, bool signal)
10821082
{
10831083
if (signal)
@@ -1124,13 +1124,13 @@ static bool doAssignDFObject(color_ostream *out, lua_State *state,
11241124
}
11251125

11261126
bool DFHack::Lua::AssignDFObject(color_ostream &out, lua_State *state,
1127-
type_identity *type, void *target, int val_index,
1127+
const type_identity *type, void *target, int val_index,
11281128
bool exact_type, bool perr)
11291129
{
11301130
return doAssignDFObject(&out, state, type, target, val_index, exact_type, perr, false);
11311131
}
11321132

1133-
void DFHack::Lua::CheckDFAssign(lua_State *state, type_identity *type,
1133+
void DFHack::Lua::CheckDFAssign(lua_State *state, const type_identity *type,
11341134
void *target, int val_index, bool exact_type)
11351135
{
11361136
doAssignDFObject(NULL, state, type, target, val_index, exact_type, false, true);

library/LuaWrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ bool LuaWrapper::LookupTypeInfo(lua_State *state, bool in_method)
132132
return true;
133133
}
134134

135-
void LuaWrapper::LookupInTable(lua_State *state, void *id, LuaToken *tname)
135+
void LuaWrapper::LookupInTable(lua_State *state, const void *id, LuaToken *tname)
136136
{
137137
lua_rawgetp(state, LUA_REGISTRYINDEX, tname);
138138
lua_rawgetp(state, -1, id);

library/include/DataDefs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ namespace DFHack
257257
};
258258

259259
struct struct_field_info_extra {
260-
enum_identity *index_enum;
261-
type_identity *ref_target;
260+
const enum_identity *index_enum;
261+
const type_identity *ref_target;
262262
const char *union_tag_field;
263263
const char *union_tag_attr;
264264
const char *original_name;

library/include/LuaTools.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,14 @@ namespace DFHack::Lua {
140140
* Return behavior is of SafeCall below.
141141
*/
142142
DFHACK_EXPORT bool AssignDFObject(color_ostream &out, lua_State *state,
143-
type_identity *type, void *target, int val_index,
143+
const type_identity *type, void *target, int val_index,
144144
bool exact_type = false, bool perr = true);
145145

146146
/**
147147
* Assign the value at val_index to the target of given identity using df.assign().
148148
* Otherwise throws an error.
149149
*/
150-
DFHACK_EXPORT void CheckDFAssign(lua_State *state, type_identity *type,
150+
DFHACK_EXPORT void CheckDFAssign(lua_State *state, const type_identity *type,
151151
void *target, int val_index, bool exact_type = false);
152152

153153
template<typename T> concept df_object = requires()

library/include/LuaWrapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ namespace LuaWrapper {
167167
const char *ctx, bool allow_type = false,
168168
bool keep_metatable = false);
169169

170-
void LookupInTable(lua_State *state, void *id, LuaToken *tname);
170+
void LookupInTable(lua_State *state, const void *id, LuaToken *tname);
171171
void SaveInTable(lua_State *state, void *node, LuaToken *tname);
172172
void SaveTypeInfo(lua_State *state, void *node);
173173

0 commit comments

Comments
 (0)