diff options
author | SmallJoker <SmallJoker@users.noreply.github.com> | 2020-10-05 09:07:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-05 09:07:33 +0200 |
commit | f46509d5e2c681b6da2abdeb27779be3c36a6916 (patch) | |
tree | df654ae11cb73825e071e8222f37a73a1a604707 /src/script/common | |
parent | 81c66d6efb9fb0ab8a03b40e2bc22aa49eff9a04 (diff) | |
download | minetest-f46509d5e2c681b6da2abdeb27779be3c36a6916.tar.gz minetest-f46509d5e2c681b6da2abdeb27779be3c36a6916.tar.bz2 minetest-f46509d5e2c681b6da2abdeb27779be3c36a6916.zip |
Remove unused functions reported by cppcheck (#10463)
Run unused functions reported by cppcheck
This change removes a few (but not all) unused functions.
Some unused helper functions were not removed due to their complexity and potential of future use.
Diffstat (limited to 'src/script/common')
-rw-r--r-- | src/script/common/c_converter.cpp | 45 | ||||
-rw-r--r-- | src/script/common/c_converter.h | 2 |
2 files changed, 0 insertions, 47 deletions
diff --git a/src/script/common/c_converter.cpp b/src/script/common/c_converter.cpp index eb6ab5331..c00401b58 100644 --- a/src/script/common/c_converter.cpp +++ b/src/script/common/c_converter.cpp @@ -679,48 +679,3 @@ size_t write_array_slice_float( return elem_index - 1; } - - -size_t write_array_slice_u16( - lua_State *L, - int table_index, - u16 *data, - v3u16 data_size, - v3u16 slice_offset, - v3u16 slice_size) -{ - v3u16 pmin, pmax(data_size); - - if (slice_offset.X > 0) { - slice_offset.X--; - pmin.X = slice_offset.X; - pmax.X = MYMIN(slice_offset.X + slice_size.X, data_size.X); - } - - if (slice_offset.Y > 0) { - slice_offset.Y--; - pmin.Y = slice_offset.Y; - pmax.Y = MYMIN(slice_offset.Y + slice_size.Y, data_size.Y); - } - - if (slice_offset.Z > 0) { - slice_offset.Z--; - pmin.Z = slice_offset.Z; - pmax.Z = MYMIN(slice_offset.Z + slice_size.Z, data_size.Z); - } - - const u32 ystride = data_size.X; - const u32 zstride = data_size.X * data_size.Y; - - u32 elem_index = 1; - for (u32 z = pmin.Z; z != pmax.Z; z++) - for (u32 y = pmin.Y; y != pmax.Y; y++) - for (u32 x = pmin.X; x != pmax.X; x++) { - u32 i = z * zstride + y * ystride + x; - lua_pushinteger(L, data[i]); - lua_rawseti(L, table_index, elem_index); - elem_index++; - } - - return elem_index - 1; -} diff --git a/src/script/common/c_converter.h b/src/script/common/c_converter.h index a4a7079fd..6ad6f3212 100644 --- a/src/script/common/c_converter.h +++ b/src/script/common/c_converter.h @@ -136,5 +136,3 @@ void warn_if_field_exists(lua_State *L, int table, size_t write_array_slice_float(lua_State *L, int table_index, float *data, v3u16 data_size, v3u16 slice_offset, v3u16 slice_size); -size_t write_array_slice_u16(lua_State *L, int table_index, u16 *data, - v3u16 data_size, v3u16 slice_offset, v3u16 slice_size); |