From e2101268952c12fbf7ce425853a7b1147d3edfc6 Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Sun, 16 Feb 2025 16:11:44 -0500 Subject: [PATCH] lint: reformat --- common/formatter/formatter_tree.h | 2 +- common/global_profiler/GlobalProfiler.h | 2 +- common/goos/TextDB.h | 2 +- common/repl/config.h | 2 +- .../config/jak3/ntsc_v1/type_casts.jsonc | 12 +++--------- decompiler/config/jak3/ntsc_v1/var_names.jsonc | 18 +++++++++--------- decompiler/util/data_decompile.h | 2 +- game/system/hid/devices/input_device.h | 2 +- game/system/hid/devices/keyboard.h | 2 +- game/system/hid/devices/mouse.h | 2 +- game/system/hid/input_bindings.h | 8 ++++---- lsp/protocol/common_types.h | 2 +- lsp/state/workspace.cpp | 4 ++-- lsp/state/workspace.h | 8 ++++---- test/offline/framework/file_management.h | 4 ++-- test/offline/framework/orchestration.h | 2 +- 16 files changed, 34 insertions(+), 40 deletions(-) diff --git a/common/formatter/formatter_tree.h b/common/formatter/formatter_tree.h index 40fc908430..fe280b53a8 100644 --- a/common/formatter/formatter_tree.h +++ b/common/formatter/formatter_tree.h @@ -46,7 +46,7 @@ class FormatterTreeNode { FormatterTreeNode() = default; FormatterTreeNode(const std::string& source, const TSNode& node); - FormatterTreeNode(const Metadata& _metadata) : metadata(_metadata){}; + FormatterTreeNode(const Metadata& _metadata) : metadata(_metadata) {}; bool is_list() const { return !token.has_value(); } std::string token_str() const { diff --git a/common/global_profiler/GlobalProfiler.h b/common/global_profiler/GlobalProfiler.h index fdf903f8fb..85a9dde198 100644 --- a/common/global_profiler/GlobalProfiler.h +++ b/common/global_profiler/GlobalProfiler.h @@ -47,7 +47,7 @@ class GlobalProfiler { }; struct ScopedEvent { - ScopedEvent(GlobalProfiler* _prof) : prof(_prof){}; + ScopedEvent(GlobalProfiler* _prof) : prof(_prof) {}; ScopedEvent(const ScopedEvent&) = delete; ScopedEvent& operator=(const ScopedEvent&) = delete; GlobalProfiler* prof = nullptr; diff --git a/common/goos/TextDB.h b/common/goos/TextDB.h index 57e7668b63..c8775edd1a 100644 --- a/common/goos/TextDB.h +++ b/common/goos/TextDB.h @@ -41,7 +41,7 @@ class SourceText { // want virtual bool terminate_compiler_error() { return true; } - virtual ~SourceText(){}; + virtual ~SourceText() {}; protected: void build_offsets(); diff --git a/common/repl/config.h b/common/repl/config.h index c0a5334ffa..9684b2c07e 100644 --- a/common/repl/config.h +++ b/common/repl/config.h @@ -29,7 +29,7 @@ void from_json(const json& j, KeyBind& obj); // TODO - per-game config struct Config { GameVersion game_version; - Config(GameVersion _game_version) : game_version(_game_version){}; + Config(GameVersion _game_version) : game_version(_game_version) {}; // this is the default REPL configuration int nrepl_port = 8181; diff --git a/decompiler/config/jak3/ntsc_v1/type_casts.jsonc b/decompiler/config/jak3/ntsc_v1/type_casts.jsonc index bc53861a7a..cb17a5c348 100644 --- a/decompiler/config/jak3/ntsc_v1/type_casts.jsonc +++ b/decompiler/config/jak3/ntsc_v1/type_casts.jsonc @@ -3160,9 +3160,7 @@ [27, "a0", "process-focusable"], [30, "a0", "process-focusable"] ], - "(method 20 enemy)": [ - [[0, 30], "v0", "search-info-flag"] - ], + "(method 20 enemy)": [[[0, 30], "v0", "search-info-flag"]], "(method 59 enemy)": [ [57, "a0", "process-focusable"], [60, "a0", "process-focusable"] @@ -3217,9 +3215,7 @@ [67, "s3", "process-drawable"], [68, "a1", "collide-shape"] ], - "(method 68 enemy)": [ - [[0, 50], "v0", "enemy-aware"] - ], + "(method 68 enemy)": [[[0, 50], "v0", "enemy-aware"]], "(method 82 enemy)": [ [80, "v1", "process-drawable"], [122, "v1", "attack-info"], @@ -9798,9 +9794,7 @@ [229, "v1", "ff-squad-control"], [319, "a1", "ff-squad-control"] ], - "(method 252 crimson-guard)": [ - [[0, 223], "s5", "process-focusable"] - ], + "(method 252 crimson-guard)": [[[0, 223], "s5", "process-focusable"]], "(method 51 ff-squad-control)": [ [13, "v1", "connection"], [14, "v1", "collide-shape"], diff --git a/decompiler/config/jak3/ntsc_v1/var_names.jsonc b/decompiler/config/jak3/ntsc_v1/var_names.jsonc index 40a1d26eab..3fee9e6df4 100644 --- a/decompiler/config/jak3/ntsc_v1/var_names.jsonc +++ b/decompiler/config/jak3/ntsc_v1/var_names.jsonc @@ -175,14 +175,14 @@ }, "(method 9 align-control)": { "vars": { - "s5-0":"num-chans", - "s4-0":"chan-idx", - "a0-4":"chan", - "v1-7":"frame-group", - "a0-9":"root-chan", - "v1-18":"root-frame-group", - "f0-0":"root-frame-num", - "a0-10":"disable?" + "s5-0": "num-chans", + "s4-0": "chan-idx", + "a0-4": "chan", + "v1-7": "frame-group", + "a0-9": "root-chan", + "v1-18": "root-frame-group", + "f0-0": "root-frame-num", + "a0-10": "disable?" } }, "(method 9 process)": { @@ -192,7 +192,7 @@ "args": ["this", "ent"] }, "(method 106 bot)": { - "vars": {"v1-3": ["v1-3", "process-focusable"]} + "vars": { "v1-3": ["v1-3", "process-focusable"] } }, "(method 0 clock)": { "args": ["allocation", "type-to-make", "index"] diff --git a/decompiler/util/data_decompile.h b/decompiler/util/data_decompile.h index 6dd5eae820..b64da2920f 100644 --- a/decompiler/util/data_decompile.h +++ b/decompiler/util/data_decompile.h @@ -135,7 +135,7 @@ struct ArrayFieldDecompMeta { ArrayFieldDecompMeta(TypeSpec _element_type, int _bytes_per_element, Kind _kind = Kind::REF_TO_INLINE_ARR) - : element_type(_element_type), bytes_per_element(_bytes_per_element), kind(_kind){}; + : element_type(_element_type), bytes_per_element(_bytes_per_element), kind(_kind) {}; }; extern const std::unordered_map< diff --git a/game/system/hid/devices/input_device.h b/game/system/hid/devices/input_device.h index 2c4ba78b5b..b51e32478e 100644 --- a/game/system/hid/devices/input_device.h +++ b/game/system/hid/devices/input_device.h @@ -14,7 +14,7 @@ class InputDevice { std::shared_ptr m_settings; public: - virtual ~InputDevice(){}; + virtual ~InputDevice() {}; virtual void process_event(const SDL_Event& event, const CommandBindingGroups& commands, diff --git a/game/system/hid/devices/keyboard.h b/game/system/hid/devices/keyboard.h index 117358d876..028f39a4ca 100644 --- a/game/system/hid/devices/keyboard.h +++ b/game/system/hid/devices/keyboard.h @@ -20,7 +20,7 @@ struct ActiveKeyboardAction { class KeyboardDevice : public InputDevice { public: - KeyboardDevice(){}; + KeyboardDevice() {}; KeyboardDevice(std::shared_ptr settings); ~KeyboardDevice() {} diff --git a/game/system/hid/devices/mouse.h b/game/system/hid/devices/mouse.h index 1ff60ada96..15f3ab5be1 100644 --- a/game/system/hid/devices/mouse.h +++ b/game/system/hid/devices/mouse.h @@ -21,7 +21,7 @@ class MouseDevice : public InputDevice { bool mouse5 = false; }; - MouseDevice(){}; + MouseDevice() {}; MouseDevice(std::shared_ptr settings); ~MouseDevice() {} diff --git a/game/system/hid/input_bindings.h b/game/system/hid/input_bindings.h index d169933718..193e423a7c 100644 --- a/game/system/hid/input_bindings.h +++ b/game/system/hid/input_bindings.h @@ -183,14 +183,14 @@ void from_json(const json& j, InputModifiers& obj); /// should make him move towards the camera. struct InputBinding { InputBinding() = default; - InputBinding(int index) : pad_data_index(index){}; + InputBinding(int index) : pad_data_index(index) {}; InputBinding(int index, const std::optional _modifiers) : pad_data_index(index) { if (_modifiers) { modifiers = _modifiers.value(); } }; InputBinding(int index, bool _minimum_in_range) - : pad_data_index(index), minimum_in_range(_minimum_in_range){}; + : pad_data_index(index), minimum_in_range(_minimum_in_range) {}; InputBinding(int index, bool _minimum_in_range, const std::optional _modifiers) : pad_data_index(index), minimum_in_range(_minimum_in_range) { if (_modifiers) { @@ -262,7 +262,7 @@ struct InputBindingGroups { : device_type(_device_type), analog_axii(_analog_axii), button_axii(_button_axii), - buttons(_buttons){}; + buttons(_buttons) {}; // TODO - make these private InputDeviceType device_type; @@ -345,7 +345,7 @@ struct CommandBinding { enum Source { CONTROLLER, KEYBOARD, MOUSE }; CommandBinding(const u32 _host_key, std::function _command) - : host_key(_host_key), command(_command){}; + : host_key(_host_key), command(_command) {}; u32 host_key; std::function command; InputModifiers modifiers; diff --git a/lsp/protocol/common_types.h b/lsp/protocol/common_types.h index 3d73279d16..4486d703dc 100644 --- a/lsp/protocol/common_types.h +++ b/lsp/protocol/common_types.h @@ -29,7 +29,7 @@ struct Range { Position m_start; Position m_end; - Range(){}; + Range() {}; Range(Position start, Position end); // point constructor Range(uint32_t line, uint32_t character); diff --git a/lsp/state/workspace.cpp b/lsp/state/workspace.cpp index 4b1e24fa25..f957d0a11f 100644 --- a/lsp/state/workspace.cpp +++ b/lsp/state/workspace.cpp @@ -19,8 +19,8 @@ extern const TSLanguage* tree_sitter_opengoal(); const TSLanguage* g_opengoalLang = tree_sitter_opengoal(); -Workspace::Workspace(){}; -Workspace::~Workspace(){}; +Workspace::Workspace() {}; +Workspace::~Workspace() {}; bool Workspace::is_initialized() { return m_initialized; diff --git a/lsp/state/workspace.h b/lsp/state/workspace.h index 826129f214..59a89e3937 100644 --- a/lsp/state/workspace.h +++ b/lsp/state/workspace.h @@ -37,7 +37,7 @@ struct OGGlobalIndex { class WorkspaceOGFile { public: - WorkspaceOGFile(){}; + WorkspaceOGFile() {}; WorkspaceOGFile(const LSPSpec::DocumentUri& uri, const std::string& content, const GameVersion& game_version); @@ -62,7 +62,7 @@ class WorkspaceOGFile { class WorkspaceIRFile { public: - WorkspaceIRFile(){}; + WorkspaceIRFile() {}; WorkspaceIRFile(const std::string& content); // TODO - make private int32_t version; @@ -91,14 +91,14 @@ class WorkspaceIRFile { class WorkspaceAllTypesFile { public: WorkspaceAllTypesFile() - : m_dts(std::make_unique(GameVersion::Jak1)){}; + : m_dts(std::make_unique(GameVersion::Jak1)) {}; WorkspaceAllTypesFile(const LSPSpec::DocumentUri& uri, const GameVersion version, const fs::path file_path) : m_game_version(version), m_uri(uri), m_dts(std::make_unique(m_game_version)), - m_file_path(file_path){}; + m_file_path(file_path) {}; GameVersion m_game_version; LSPSpec::DocumentUri m_uri; diff --git a/test/offline/framework/file_management.h b/test/offline/framework/file_management.h index be529434ae..fb47c441cb 100644 --- a/test/offline/framework/file_management.h +++ b/test/offline/framework/file_management.h @@ -13,7 +13,7 @@ struct OfflineTestSourceFile { : path(_path), containing_dgo(_containing_dgo), name_in_dgo(_name_in_dgo), - unique_name(_unique_name){}; + unique_name(_unique_name) {}; fs::path path; std::string containing_dgo; std::string name_in_dgo; @@ -24,7 +24,7 @@ struct OfflineTestArtFile { OfflineTestArtFile(std::string _containing_dgo, std::string _name_in_dgo, std::string _unique_name) - : containing_dgo(_containing_dgo), name_in_dgo(_name_in_dgo), unique_name(_unique_name){}; + : containing_dgo(_containing_dgo), name_in_dgo(_name_in_dgo), unique_name(_unique_name) {}; std::string containing_dgo; std::string name_in_dgo; std::string unique_name; diff --git a/test/offline/framework/orchestration.h b/test/offline/framework/orchestration.h index be865e9efc..3692b8ed1a 100644 --- a/test/offline/framework/orchestration.h +++ b/test/offline/framework/orchestration.h @@ -81,7 +81,7 @@ class OfflineTestThreadStatus { public: enum class Stage { IDLE, PREPARING, DECOMPILING, COMPARING, COMPILING, FAILED, FINISHED }; - OfflineTestThreadStatus(const OfflineTestConfig& _config) : config(_config){}; + OfflineTestThreadStatus(const OfflineTestConfig& _config) : config(_config) {}; Stage stage = Stage::IDLE; uint32_t total_steps = 0;