Skip to content

Commit

Permalink
Reformat all the things!
Browse files Browse the repository at this point in the history
  • Loading branch information
spycrab committed Apr 12, 2018
1 parent d27e85e commit 40bb997
Show file tree
Hide file tree
Showing 179 changed files with 1,889 additions and 992 deletions.
2 changes: 1 addition & 1 deletion Source/.clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortFunctionsOnASingleLine: InlineOnly
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
Expand Down
5 changes: 3 additions & 2 deletions Source/Core/AudioCommon/AlsaSoundStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,9 @@ bool AlsaSound::AlsaInit()
// it is probably a bad idea to try to send more than one buffer of data
if ((unsigned int)frames_to_deliver > buffer_size)
frames_to_deliver = buffer_size;
NOTICE_LOG(AUDIO, "ALSA gave us a %ld sample \"hardware\" buffer with %d periods. Will send %d "
"samples per fragments.",
NOTICE_LOG(AUDIO,
"ALSA gave us a %ld sample \"hardware\" buffer with %d periods. Will send %d "
"samples per fragments.",
buffer_size, periods, frames_to_deliver);

snd_pcm_sw_params_alloca(&swparams);
Expand Down
1 change: 1 addition & 0 deletions Source/Core/AudioCommon/AlsaSoundStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class AlsaSound final : public SoundStream
bool SetRunning(bool running) override;

static bool isValid() { return true; }

private:
// maximum number of frames the buffer can hold
static constexpr size_t BUFFER_SIZE_MAX = 8192;
Expand Down
1 change: 1 addition & 0 deletions Source/Core/AudioCommon/Mixer.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class Mixer final

float GetCurrentSpeed() const { return m_speed.load(); }
void UpdateSpeed(float val) { m_speed.store(val); }

private:
static constexpr u32 MAX_SAMPLES = 1024 * 4; // 128 ms
static constexpr u32 INDEX_MASK = MAX_SAMPLES * 2 - 1;
Expand Down
1 change: 1 addition & 0 deletions Source/Core/AudioCommon/OpenSLESStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class OpenSLESStream final : public SoundStream
bool Init() override;
bool SetRunning(bool running) override { return running; }
static bool isValid() { return true; }

private:
std::thread thread;
Common::Event soundSyncEvent;
Expand Down
1 change: 1 addition & 0 deletions Source/Core/AudioCommon/WaveFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class WaveFileWriter
void SetSkipSilence(bool skip) { skip_silence = skip; }
void AddStereoSamplesBE(const short* sample_data, u32 count, int sample_rate); // big endian
u32 GetAudioSize() const { return audio_size; }

private:
static constexpr size_t BUFFER_SIZE = 32 * 1024;

Expand Down
1 change: 1 addition & 0 deletions Source/Core/Common/Analytics.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ class AnalyticsReporter

// For convenience.
void Send(AnalyticsReportBuilder& report) { Send(std::move(report)); }

protected:
void ThreadProc();

Expand Down
8 changes: 6 additions & 2 deletions Source/Core/Common/Arm64Emitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,12 @@ bool IsImmLogical(uint64_t value, unsigned int width, unsigned int* n, unsigned
// (1 + 2^d + 2^(2d) + ...), i.e. 0x0001000100010001 or similar. These can
// be derived using a table lookup on CLZ(d).
static const std::array<uint64_t, 6> multipliers = {{
0x0000000000000001UL, 0x0000000100000001UL, 0x0001000100010001UL, 0x0101010101010101UL,
0x1111111111111111UL, 0x5555555555555555UL,
0x0000000000000001UL,
0x0000000100000001UL,
0x0001000100010001UL,
0x0101010101010101UL,
0x1111111111111111UL,
0x5555555555555555UL,
}};

int multiplier_idx = CountLeadingZeros(d, kXRegSizeInBits) - 57;
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Common/BitField.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ struct BitField
constexpr operator T() const { return Value(); }
constexpr std::size_t StartBit() const { return position; }
constexpr std::size_t NumBits() const { return bits; }

private:
// StorageType is T for non-enum types and the underlying type of T if
// T is an enumeration. Note that T is wrapped within an enable_if in the
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Common/BitSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ class BitSet
constexpr int operator*() const { return m_bit; }
constexpr bool operator==(Iterator other) const { return m_bit == other.m_bit; }
constexpr bool operator!=(Iterator other) const { return m_bit != other.m_bit; }

private:
IntTy m_val;
int m_bit;
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Common/BlockingLoop.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ class BlockingLoop
// This function should be triggered regularly over time so
// that we will fall back from the busy loop to sleeping.
void AllowSleep() { m_may_sleep.Set(); }

private:
std::mutex m_wait_lock;
std::mutex m_prepare_lock;
Expand Down
10 changes: 5 additions & 5 deletions Source/Core/Common/CommonFuncs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ std::string LastStrerrorString()
{
char error_message[BUFFER_SIZE];

// There are two variants of strerror_r. The XSI version stores the message to the passed-in
// buffer and returns an int (0 on success). The GNU version returns a pointer to the message,
// which might have been stored in the passed-in buffer or might be a static string.
// There are two variants of strerror_r. The XSI version stores the message to the passed-in
// buffer and returns an int (0 on success). The GNU version returns a pointer to the message,
// which might have been stored in the passed-in buffer or might be a static string.

// We check defines in order to figure out variant is in use, and we store the returned value
// to a variable so that we'll get a compile-time check that our assumption was correct.
// We check defines in order to figure out variant is in use, and we store the returned value
// to a variable so that we'll get a compile-time check that our assumption was correct.

#if defined(__GLIBC__) && (_GNU_SOURCE || (_POSIX_C_SOURCE < 200112L && _XOPEN_SOURCE < 600))
const char* str = strerror_r(errno, error_message, BUFFER_SIZE);
Expand Down
6 changes: 2 additions & 4 deletions Source/Core/Common/CompatPatches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,7 @@ static bool GetModuleVersion(const wchar_t* name, Version* version)

void CompatPatchesInstall(LdrWatcher* watcher)
{
watcher->Install({{L"EZFRD64.dll", L"811EZFRD64.DLL"},
[](const LdrDllLoadEvent& event) {
watcher->Install({{L"EZFRD64.dll", L"811EZFRD64.DLL"}, [](const LdrDllLoadEvent& event) {
// *EZFRD64 is incldued in software packages for cheapo third-party gamepads
// (and gamepad adapters). The module cannot handle its heap being above 4GB,
// which tends to happen very often on modern Windows.
Expand All @@ -214,8 +213,7 @@ void CompatPatchesInstall(LdrWatcher* watcher)
auto patcher = ImportPatcher(event.base_address);
patcher.PatchIAT("kernel32.dll", "HeapCreate", HeapCreateLow4GB);
}});
watcher->Install({{L"ucrtbase.dll"},
[](const LdrDllLoadEvent& event) {
watcher->Install({{L"ucrtbase.dll"}, [](const LdrDllLoadEvent& event) {
// ucrtbase implements caching between fseek/fread, old versions have a bug
// such that some reads return incorrect data. This causes noticable bugs
// in dolphin since we use these APIs for reading game images.
Expand Down
9 changes: 7 additions & 2 deletions Source/Core/Common/Config/Enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ enum class System
};

constexpr std::array<LayerType, 7> SEARCH_ORDER{{
LayerType::CurrentRun, LayerType::CommandLine, LayerType::Movie, LayerType::Netplay,
LayerType::LocalGame, LayerType::GlobalGame, LayerType::Base,
LayerType::CurrentRun,
LayerType::CommandLine,
LayerType::Movie,
LayerType::Netplay,
LayerType::LocalGame,
LayerType::GlobalGame,
LayerType::Base,
}};
}
2 changes: 2 additions & 0 deletions Source/Core/Common/Config/Layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class Section
Section(iterator begin_, iterator end_) : m_begin(begin_), m_end(end_) {}
iterator begin() const { return m_begin; }
iterator end() const { return m_end; }

private:
iterator m_begin;
iterator m_end;
Expand All @@ -81,6 +82,7 @@ class ConstSection
ConstSection(iterator begin_, iterator end_) : m_begin(begin_), m_end(end_) {}
iterator begin() const { return m_begin; }
iterator end() const { return m_end; }

private:
iterator m_begin;
iterator m_end;
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Common/DebugInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class DebugInterface
{
protected:
virtual ~DebugInterface() {}

public:
virtual std::string Disassemble(unsigned int /*address*/) { return "NODEBUGGER"; }
virtual std::string GetRawMemoryString(int /*memory*/, unsigned int /*address*/)
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Common/FixedSizeQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class FixedSizeQueue
T& front() { return storage[head]; }
const T& front() const { return storage[head]; }
size_t size() const { return count; }

private:
std::array<T, N> storage;
int head = 0;
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Common/Flag.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class Flag final
}

bool TestAndClear() { return TestAndSet(false); }

private:
std::atomic_bool m_val;
};
Expand Down
Loading

0 comments on commit 40bb997

Please sign in to comment.