Remove namespaces

This commit is contained in:
Pieter-Jan Briers
2026-09-12 20:20:50 +02:00
parent 6049b49592
commit 03390b807e
10 changed files with 10 additions and 15 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
#pragma once
namespace dusk::helpers::alignment {
namespace dusk::helpers {
/**
* Read data from an address that may not be aligned properly.
+2 -2
View File
@@ -14,12 +14,12 @@
*/
#define DEFINE_STRING_ENUM(type, names) \
Result Stack<type>::push(lua_State* L, type value) { \
return Stack<std::string_view>::push(L, ::luau_runtime::lua_helpers::enum_value_to_str(L, value, names)); \
return Stack<std::string_view>::push(L, ::luau_runtime::enum_value_to_str(L, value, names)); \
} \
\
TypeResult<type> Stack<type>::get(lua_State* L, int index) { \
const char* str = lua_tolstring(L, index, nullptr); \
return ::luau_runtime::lua_helpers::enum_str_to_value(L, str, names); \
return ::luau_runtime::enum_str_to_value(L, str, names); \
}
/**
+1 -1
View File
@@ -2,7 +2,7 @@
#include <cmath>
namespace luau_runtime::lua_helpers {
namespace luau_runtime {
bool get_optional_bool(lua_State* state, int table, const char* field, bool fallback) {
lua_getfield(state, table, field);
+1 -1
View File
@@ -10,7 +10,7 @@
* Helper functions for API bound between Lua <-> C++
*/
namespace luau_runtime::lua_helpers {
namespace luau_runtime {
bool get_optional_bool(lua_State* state, int table, const char* field, bool fallback);
double get_optional_number(lua_State* state, int table, const char* field, double fallback);
@@ -100,7 +100,7 @@ namespace {
using namespace std::string_view_literals;
constexpr luau_runtime::lua_helpers::EnumName<SoundEffectCategory> kSoundEffectCategoryNames[] = {
constexpr luau_runtime::EnumName<SoundEffectCategory> kSoundEffectCategoryNames[] = {
// clang-format off
{ SE_CATEGORY_SYSTEM_SE, "system_se"sv },
{ SE_CATEGORY_PLAYER_VOICE, "player_voice"sv },
@@ -115,7 +115,7 @@ constexpr luau_runtime::lua_helpers::EnumName<SoundEffectCategory> kSoundEffectC
// clang-format on
};
constexpr luau_runtime::lua_helpers::EnumName<StreamPan> kStreamPanNames[] = {
constexpr luau_runtime::EnumName<StreamPan> kStreamPanNames[] = {
// clang-format off
{ STREAM_PAN_CENTER, "center"sv },
{ STREAM_PAN_LEFT, "left"sv },
@@ -117,14 +117,14 @@ namespace {
using namespace std::string_view_literals;
constexpr luau_runtime::lua_helpers::EnumName<AudioWaveFormat> kWaveFormatNames[] = {
constexpr luau_runtime::EnumName<AudioWaveFormat> kWaveFormatNames[] = {
{ AUDIO_WAVE_FORMAT_ADPCM4, "adpcm4"sv },
{ AUDIO_WAVE_FORMAT_ADPCM2, "adpcm2"sv },
{ AUDIO_WAVE_FORMAT_PCM8, "pcm8"sv },
{ AUDIO_WAVE_FORMAT_PCM16, "pcm16"sv },
};
constexpr luau_runtime::lua_helpers::EnumName<AudioWaveBank> kWaveBankNames[] = {
constexpr luau_runtime::EnumName<AudioWaveBank> kWaveBankNames[] = {
{ AUDIO_WAVE_BANK_SOUND_EFFECTS, "sound_effects"sv } ,
{ AUDIO_WAVE_BANK_MUSIC_SAMPLES, "music_samples"sv } ,
};
@@ -8,8 +8,6 @@
namespace luau_runtime::services {
namespace {
using namespace luau_runtime::lua_helpers;
constexpr char kOverlayMetatable[] = "dusklight.overlay_handle";
constexpr char kTextureMetatable[] = "dusklight.texture_handle";
@@ -9,8 +9,6 @@
namespace luau_runtime::services {
namespace {
using namespace luau_runtime::lua_helpers;
constexpr char kConfigVarMetatable[] = "dusklight.config_var";
constexpr char kConfigSubscriptionMetatable[] = "dusklight.config_subscription";
-1
View File
@@ -12,7 +12,6 @@
namespace luau_runtime::services {
namespace {
using namespace luau_runtime::lua_helpers;
using namespace std::string_view_literals;
constexpr char kUiWindowMetatable[] = "dusklight.ui_window";
+1 -1
View File
@@ -40,7 +40,7 @@ bool check_four_cc(char const (&field)[4], char const (&expected)[5]) {
namespace dusk::mods::svc::audio_res::wsys {
ModResult load_wav(LoadedMod const& mod, RuntimeWaveReplacementSlot& slot, std::span<u8 const> fileData) {
using namespace helpers::alignment;
using namespace helpers;
if (fileData.size() < sizeof(RiffChunk)) {
return MOD_UNSUPPORTED;