Skip to content

Commit

Permalink
Clang-Format cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
oneup03 committed Mar 16, 2024
1 parent c2d784d commit 769d858
Show file tree
Hide file tree
Showing 136 changed files with 1,011 additions and 1,006 deletions.
4 changes: 3 additions & 1 deletion src/android/app/src/main/jni/camera/ndk_camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ struct CaptureSession final {

#define MEMBER(type, name, func) \
struct type##Deleter { \
void operator()(type* ptr) { type##_##func(ptr); } \
void operator()(type* ptr) { \
type##_##func(ptr); \
} \
}; \
std::unique_ptr<type, type##Deleter> name

Expand Down
4 changes: 2 additions & 2 deletions src/android/app/src/main/jni/emu_window/emu_window_gl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class SharedContext_Android : public Frontend::GraphicsContext {
public:
SharedContext_Android(EGLDisplay egl_display, EGLConfig egl_config,
EGLContext egl_share_context)
: egl_display{egl_display}, egl_surface{eglCreatePbufferSurface(egl_display, egl_config,
egl_empty_attribs.data())},
: egl_display{egl_display},
egl_surface{eglCreatePbufferSurface(egl_display, egl_config, egl_empty_attribs.data())},
egl_context{eglCreateContext(egl_display, egl_config, egl_share_context,
egl_context_attribs.data())} {
ASSERT_MSG(egl_surface, "eglCreatePbufferSurface() failed!");
Expand Down
4 changes: 2 additions & 2 deletions src/android/app/src/main/jni/input_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ Joystick::~Joystick() {
}

ButtonFactory::ButtonFactory()
: button_list{std::make_shared<ButtonList>()}, analog_button_list{
std::make_shared<AnalogButtonList>()} {}
: button_list{std::make_shared<ButtonList>()},
analog_button_list{std::make_shared<AnalogButtonList>()} {}

std::unique_ptr<Input::ButtonDevice> ButtonFactory::Create(const Common::ParamPackage& params) {
if (params.Has("axis")) {
Expand Down
10 changes: 5 additions & 5 deletions src/audio_core/hle/hle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ struct DspHle::Impl final {

template <class Archive>
void serialize(Archive& ar, const unsigned int) {
ar& dsp_state;
ar& pipe_data;
ar& dsp_memory.raw_memory;
ar& sources;
ar& mixers;
ar & dsp_state;
ar & pipe_data;
ar & dsp_memory.raw_memory;
ar & sources;
ar & mixers;
// interrupt_handler is reregistered when loading state from DSP_DSP
}
friend class boost::serialization::access;
Expand Down
10 changes: 5 additions & 5 deletions src/audio_core/hle/mixers.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ class Mixers final {

template <class Archive>
void serialize(Archive& ar, const unsigned int) {
ar& current_frame;
ar& state.intermediate_mixer_volume;
ar& state.aux_bus_enable;
ar& state.intermediate_mix_buffer;
ar& state.output_format;
ar & current_frame;
ar & state.intermediate_mixer_volume;
ar & state.aux_bus_enable;
ar & state.intermediate_mix_buffer;
ar & state.output_format;
}
friend class boost::serialization::access;
};
Expand Down
2 changes: 1 addition & 1 deletion src/audio_core/hle/shared_memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct u32_dsp {

template <class Archive>
void serialize(Archive& ar, const unsigned int) {
ar& storage;
ar & storage;
}
friend class boost::serialization::access;
};
Expand Down
54 changes: 27 additions & 27 deletions src/audio_core/hle/source.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,18 @@ class Source final {
private:
template <class Archive>
void serialize(Archive& ar, const unsigned int) {
ar& physical_address;
ar& length;
ar& adpcm_ps;
ar& adpcm_yn;
ar& adpcm_dirty;
ar& is_looping;
ar& buffer_id;
ar& mono_or_stereo;
ar& format;
ar& from_queue;
ar& play_position;
ar& has_played;
ar & physical_address;
ar & length;
ar & adpcm_ps;
ar & adpcm_yn;
ar & adpcm_dirty;
ar & is_looping;
ar & buffer_id;
ar & mono_or_stereo;
ar & format;
ar & from_queue;
ar & play_position;
ar & has_played;
}
friend class boost::serialization::access;
};
Expand Down Expand Up @@ -163,20 +163,20 @@ class Source final {
private:
template <class Archive>
void serialize(Archive& ar, const unsigned int) {
ar& enabled;
ar& sync_count;
ar& gain;
ar& input_queue;
ar& mono_or_stereo;
ar& format;
ar& current_sample_number;
ar& current_buffer_physical_address;
ar& current_buffer;
ar& buffer_update;
ar& current_buffer_id;
ar& adpcm_coeffs;
ar& rate_multiplier;
ar& interpolation_mode;
ar & enabled;
ar & sync_count;
ar & gain;
ar & input_queue;
ar & mono_or_stereo;
ar & format;
ar & current_sample_number;
ar & current_buffer_physical_address;
ar & current_buffer;
ar & buffer_update;
ar & current_buffer_id;
ar & adpcm_coeffs;
ar & rate_multiplier;
ar & interpolation_mode;
}
friend class boost::serialization::access;

Expand All @@ -196,7 +196,7 @@ class Source final {

template <class Archive>
void serialize(Archive& ar, const unsigned int) {
ar& state;
ar & state;
}
friend class boost::serialization::access;
};
Expand Down
5 changes: 2 additions & 3 deletions src/citra_qt/configuration/configure_cheats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
#include "ui_configure_cheats.h"

ConfigureCheats::ConfigureCheats(Cheats::CheatEngine& cheat_engine_, u64 title_id_, QWidget* parent)
: QWidget(parent),
ui(std::make_unique<Ui::ConfigureCheats>()), cheat_engine{cheat_engine_}, title_id{
title_id_} {
: QWidget(parent), ui(std::make_unique<Ui::ConfigureCheats>()), cheat_engine{cheat_engine_},
title_id{title_id_} {
// Setup gui control settings
ui->setupUi(this);
ui->tableCheats->setColumnWidth(0, 30);
Expand Down
4 changes: 2 additions & 2 deletions src/citra_qt/debugger/graphics/graphics_breakpoints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ QString BreakPointModel::DebugContextEventToString(Pica::DebugContext::Event eve

GraphicsBreakPointsWidget::GraphicsBreakPointsWidget(
std::shared_ptr<Pica::DebugContext> debug_context, QWidget* parent)
: QDockWidget(tr("Pica Breakpoints"), parent), Pica::DebugContext::BreakPointObserver(
debug_context) {
: QDockWidget(tr("Pica Breakpoints"), parent),
Pica::DebugContext::BreakPointObserver(debug_context) {
setObjectName(QStringLiteral("PicaBreakPointsWidget"));

status_text = new QLabel(tr("Emulation running"));
Expand Down
4 changes: 2 additions & 2 deletions src/citra_qt/movie/movie_play_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
#include "ui_movie_play_dialog.h"

MoviePlayDialog::MoviePlayDialog(QWidget* parent, GameList* game_list_, const Core::System& system_)
: QDialog(parent),
ui(std::make_unique<Ui::MoviePlayDialog>()), game_list{game_list_}, system{system_} {
: QDialog(parent), ui(std::make_unique<Ui::MoviePlayDialog>()), game_list{game_list_},
system{system_} {
ui->setupUi(this);

ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
Expand Down
8 changes: 4 additions & 4 deletions src/common/expected.h
Original file line number Diff line number Diff line change
Expand Up @@ -599,14 +599,14 @@ class Expected : private detail::expected_move_assign_base<T, E>,
template <typename G = E, std::enable_if_t<std::is_constructible_v<E, G&&>>* = nullptr,
std::enable_if_t<!std::is_convertible_v<G&&, E>>* = nullptr>
constexpr explicit Expected(Unexpected<G>&& e) noexcept(std::is_nothrow_constructible_v<E, G&&>)
: impl_base{unexpect_t{}, std::move(e.value())}, ctor_base{
detail::default_constructor_tag{}} {}
: impl_base{unexpect_t{}, std::move(e.value())},
ctor_base{detail::default_constructor_tag{}} {}

template <typename G = E, std::enable_if_t<std::is_constructible_v<E, G&&>>* = nullptr,
std::enable_if_t<std::is_convertible_v<G&&, E>>* = nullptr>
constexpr Expected(Unexpected<G>&& e) noexcept(std::is_nothrow_constructible_v<E, G&&>)
: impl_base{unexpect_t{}, std::move(e.value())}, ctor_base{
detail::default_constructor_tag{}} {}
: impl_base{unexpect_t{}, std::move(e.value())},
ctor_base{detail::default_constructor_tag{}} {}

template <typename... Args, std::enable_if_t<std::is_constructible_v<E, Args&&...>>* = nullptr>
constexpr explicit Expected(unexpect_t, Args&&... args)
Expand Down
2 changes: 1 addition & 1 deletion src/common/file_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
#include <sys/stat.h>

#ifndef S_ISDIR
#define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR)
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif

// This namespace has various generic functions related to files and paths.
Expand Down
12 changes: 6 additions & 6 deletions src/common/file_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ struct FSTEntry {
private:
template <class Archive>
void serialize(Archive& ar, const unsigned int) {
ar& isDirectory;
ar& size;
ar & isDirectory;
ar & size;
ar& Path::make(physicalName);
ar& Path::make(virtualName);
ar& children;
ar & children;
}
friend class boost::serialization::access;
};
Expand Down Expand Up @@ -395,13 +395,13 @@ class IOFile : public NonCopyable {
template <class Archive>
void serialize(Archive& ar, const unsigned int) {
ar& Path::make(filename);
ar& openmode;
ar& flags;
ar & openmode;
ar & flags;
u64 pos;
if (Archive::is_saving::value) {
pos = Tell();
}
ar& pos;
ar & pos;
if (Archive::is_loading::value) {
Open();
Seek(pos, SEEK_SET);
Expand Down
6 changes: 3 additions & 3 deletions src/common/memory_ref.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class BufferMem : public BackingMem {
template <class Archive>
void serialize(Archive& ar, const unsigned int) {
ar& boost::serialization::base_object<BackingMem>(*this);
ar& data;
ar & data;
}
friend class boost::serialization::access;
};
Expand Down Expand Up @@ -151,8 +151,8 @@ class MemoryRef {

template <class Archive>
void serialize(Archive& ar, const unsigned int) {
ar& backing_mem;
ar& offset;
ar & backing_mem;
ar & offset;
Init();
}
friend class boost::serialization::access;
Expand Down
4 changes: 2 additions & 2 deletions src/common/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ class Setting {
explicit Setting(const Type& default_val, const Type& min_val, const Type& max_val,
const std::string& name)
requires(ranged)
: value{default_val},
default_value{default_val}, maximum{max_val}, minimum{min_val}, label{name} {}
: value{default_val}, default_value{default_val}, maximum{max_val}, minimum{min_val},
label{name} {}

/**
* Returns a reference to the setting's value.
Expand Down
30 changes: 18 additions & 12 deletions src/common/vector_math.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ class Vec2 {
friend class boost::serialization::access;
template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) {
ar& x;
ar& y;
ar & x;
ar & y;
}

public:
Expand Down Expand Up @@ -217,9 +217,9 @@ class Vec3 {
friend class boost::serialization::access;
template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) {
ar& x;
ar& y;
ar& z;
ar & x;
ar & y;
ar & z;
}

public:
Expand Down Expand Up @@ -396,7 +396,9 @@ class Vec3 {
// _DEFINE_SWIZZLER2 defines a single such function, DEFINE_SWIZZLER2 defines all of them for all
// component names (x<->r) and permutations (xy<->yx)
#define _DEFINE_SWIZZLER2(a, b, name) \
[[nodiscard]] constexpr Vec2<T> name() const { return Vec2<T>(a, b); }
[[nodiscard]] constexpr Vec2<T> name() const { \
return Vec2<T>(a, b); \
}
#define DEFINE_SWIZZLER2(a, b, a2, b2, a3, b3, a4, b4) \
_DEFINE_SWIZZLER2(a, b, a##b); \
_DEFINE_SWIZZLER2(a, b, a2##b2); \
Expand Down Expand Up @@ -445,10 +447,10 @@ class Vec4 {
friend class boost::serialization::access;
template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) {
ar& x;
ar& y;
ar& z;
ar& w;
ar & x;
ar & y;
ar & z;
ar & w;
}

public:
Expand Down Expand Up @@ -596,7 +598,9 @@ class Vec4 {
// DEFINE_SWIZZLER2_COMP2 defines two component functions for all component names (x<->r) and
// permutations (xy<->yx)
#define _DEFINE_SWIZZLER2(a, b, name) \
[[nodiscard]] constexpr Vec2<T> name() const { return Vec2<T>(a, b); }
[[nodiscard]] constexpr Vec2<T> name() const { \
return Vec2<T>(a, b); \
}
#define DEFINE_SWIZZLER2_COMP1(a, a2) \
_DEFINE_SWIZZLER2(a, a, a##a); \
_DEFINE_SWIZZLER2(a, a, a2##a2)
Expand All @@ -621,7 +625,9 @@ class Vec4 {
#undef _DEFINE_SWIZZLER2

#define _DEFINE_SWIZZLER3(a, b, c, name) \
[[nodiscard]] constexpr Vec3<T> name() const { return Vec3<T>(a, b, c); }
[[nodiscard]] constexpr Vec3<T> name() const { \
return Vec3<T>(a, b, c); \
}
#define DEFINE_SWIZZLER3_COMP1(a, a2) \
_DEFINE_SWIZZLER3(a, a, a, a##a##a); \
_DEFINE_SWIZZLER3(a, a, a, a2##a2##a2)
Expand Down
10 changes: 5 additions & 5 deletions src/core/arm/arm_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ class ARM_Interface : NonCopyable {

template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) {
ar& cpu_registers;
ar& fpu_registers;
ar& cpsr;
ar& fpscr;
ar& fpexc;
ar & cpu_registers;
ar & fpu_registers;
ar & cpsr;
ar & fpscr;
ar & fpexc;
}
};

Expand Down
Loading

0 comments on commit 769d858

Please sign in to comment.