Skip to content

Commit 519c5e9

Browse files
authored
[Chores] Format code
1 parent dec9cd9 commit 519c5e9

File tree

17 files changed

+305
-356
lines changed

17 files changed

+305
-356
lines changed

src/lua/extra.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
#include "lua-protobuf/pb.h"
2727
#include "lua/luafile.h"
2828
#include "lua/luawrapper.h"
29+
#include "support/djbhash.h"
2930
#include "support/file.h"
3031
#include "support/strings-helpers.h"
31-
#include "support/djbhash.h"
3232
#include "support/zip.h"
3333

3434
namespace {
@@ -82,9 +82,7 @@ PCSX::File* load(std::string_view name, std::string_view from, bool inArchives =
8282
return new PCSX::PosixFile(absolutePath);
8383
}
8484

85-
uint64_t djbHash(const char* str, size_t len) {
86-
return PCSX::djb::hash(str, len);
87-
}
85+
uint64_t djbHash(const char* str, size_t len) { return PCSX::djb::hash(str, len); }
8886

8987
template <typename T, size_t S>
9088
void registerSymbol(PCSX::Lua L, const char (&name)[S], const T ptr) {

src/lua/extra.lua

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
-- along with this program; if not, write to the
1616
-- Free Software Foundation, Inc.,
1717
-- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18-
1918
ffi.cdef [[
2019
uint64_t djbHash(const char* str, size_t len);
2120
]]
@@ -40,8 +39,6 @@ Support.extra = {
4039
error('FFI call failed in ' .. name .. ': ' .. ret)
4140
end,
4241

43-
djbHash = function(str)
44-
return C.djbHash(str, #str)
45-
end,
42+
djbHash = function(str) return C.djbHash(str, #str) end,
4643
}
4744
-- )EOF"

src/lua/fileffi.lua

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ local C = ffi.load 'SUPPORT_FILE'
2020
local function validateBuffer(buffer)
2121
if buffer:maxsize() < buffer.size then
2222
error('Invalid or corrupted LuaBuffer: claims size of ' .. buffer.size .. ' but actual size is ' ..
23-
buffer:maxsize())
23+
buffer:maxsize())
2424
end
2525
return buffer
2626
end
@@ -34,19 +34,19 @@ local function read(self, ptr, size)
3434
return validateBuffer(buf)
3535
elseif type(ptr) == 'cdata' and size == nil and ffi.typeof(ptr) == Support.File._LuaBuffer then
3636
return Support.extra.safeFFI('File::read(C.readFileBuffer)', C.readFileBuffer, self._wrapper,
37-
validateBuffer(ptr))
37+
validateBuffer(ptr))
3838
elseif type(ptr) == 'userdata' and size == nil then
3939
return Support._internal.readFileUserData(self._wrapper, ptr)
4040
elseif type(ptr) == 'table' and ptr._type == 'Slice' then
4141
return Support.extra.safeFFI('File::read(C.readFileToExistingSlice)', C.readFileToExistingSlice, self._wrapper,
42-
ptr._wrapper, size or ptr:size())
42+
ptr._wrapper, size or ptr:size())
4343
end
4444
return Support.extra.safeFFI('File::read(C.readFileRawPtr)', C.readFileRawPtr, self._wrapper, ptr, size)
4545
end
4646

4747
local function readToSlice(self, size)
4848
return Support.File._createSliceWrapper(Support.extra.safeFFI('File::read(C.readFileToSlice)', C.readFileToSlice,
49-
self._wrapper, size))
49+
self._wrapper, size))
5050
end
5151

5252
local function readAt(self, ptr, size, pos)
@@ -59,48 +59,48 @@ local function readAt(self, ptr, size, pos)
5959
return validateBuffer(buf)
6060
elseif type(ptr) == 'cdata' and type(size) == 'number' and pos == nil and ffi.typeof(ptr) == LuaBuffer then
6161
return Support.extra.safeFFI('File::readAt(C.readFileAtBuffer)', C.readFileAtBuffer, self._wrapper,
62-
validateBuffer(ptr), size)
62+
validateBuffer(ptr), size)
6363
elseif type(ptr) == 'userdata' and type(size) == 'number' and pos == nil then
6464
return Support._internal.readFileAtUserData(self._wrapper, ptr, size)
6565
elseif type(ptr) == 'table' and ptr._type == 'Slice' then
6666
return Support.extra.safeFFI('File::readAt(C.readFileAtToExistingSlice)', C.readFileAtToExistingSlice,
67-
self._wrapper, ptr._wrapper, size or ptr:size(), pos)
67+
self._wrapper, ptr._wrapper, size or ptr:size(), pos)
6868
end
6969
return Support.extra.safeFFI('File::readAt(C.readFileAtRawPtr)', C.readFileAtRawPtr, self._wrapper, ptr, size, pos)
7070
end
7171

7272
local function readAtToSlice(self, size, pos)
7373
return Support.File._createSliceWrapper(Support.extra.safeFFI('File::readAt(C.readFileAtToSlice)',
74-
C.readFileAtToSlice, self._wrapper, size, pos))
74+
C.readFileAtToSlice, self._wrapper, size, pos))
7575
end
7676

7777
local function write(self, data, size)
7878
if type(data) == 'cdata' and size == nil and ffi.typeof(data) == LuaBuffer then
7979
return Support.extra.safeFFI('File::write(C.writeFileBuffer)', C.writeFileBuffer, self._wrapper,
80-
validateBuffer(data))
80+
validateBuffer(data))
8181
elseif type(data) == 'userdata' and size == nil then
8282
return Support._internal.writeFileUserData(self._wrapper, data)
8383
elseif type(size) == 'number' then
8484
return Support.extra.safeFFI('File::write(C.writeFileRawPtr)', C.writeFileRawPtr, self._wrapper, data, size)
8585
end
8686
if type(data) ~= 'string' then data = tostring(data) end
8787
return Support.extra.safeFFI('File::write(C.writeFileRawPtr)', C.writeFileRawPtr, self._wrapper, data,
88-
string.len(data))
88+
string.len(data))
8989
end
9090

9191
local function writeAt(self, data, size, pos)
9292
if type(data) == 'cdata' and type(size) == 'number' and pos == nil and ffi.typeof(data) == LuaBuffer then
9393
return Support.extra.safeFFI('File::writeAt(C.writeFileAtBuffer)', C.writeFileAtBuffer, self._wrapper,
94-
validateBuffer(data), size)
94+
validateBuffer(data), size)
9595
elseif type(data) == 'userdata' and type(size) == 'number' and pos == nil then
9696
return Support._internal.writeFileAtUserData(self._wrapper, data, size)
9797
elseif type(size) == 'number' and type(pos) == 'number' then
9898
return Support.extra.safeFFI('File::writeAt(C.writeFileAtRawPtr)', C.writeFileAtRawPtr, self._wrapper, data,
99-
size, pos)
99+
size, pos)
100100
end
101101
if type(data) ~= 'string' then data = tostring(data) end
102102
return Support.extra.safeFFI('File::writeAt(C.writeFileAtRawPtr)', C.writeFileAtRawPtr, self._wrapper, data,
103-
string.len(data), size)
103+
string.len(data), size)
104104
end
105105

106106
local function writeMoveSlice(self, slice) C.writeFileMoveSlice(self._wrapper, slice._wrapper) end
@@ -319,10 +319,10 @@ end
319319
local function ffmpegAudioFile(file, options)
320320
if type(options) ~= 'table' then options = {} end
321321
local channels, endianness, sampleFormat, frequency = options.channels, options.endianness, options.sampleFormat,
322-
options.frequency
322+
options.frequency
323323
return createFileWrapper(Support.extra.safeFFI('Support.File.ffmpegAudioFile', C.ffmpegAudioFile, file._wrapper,
324-
channels or 'Stereo', endianness or 'Little', sampleFormat or 'S16',
325-
frequency or 44100))
324+
channels or 'Stereo', endianness or 'Little', sampleFormat or 'S16',
325+
frequency or 44100))
326326
end
327327

328328
if (type(Support) ~= 'table') then Support = {} end

src/lua/fileffimeta.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ local sliceMeta = {
3232
elseif index == 'size' then
3333
return tonumber(C.getSliceSize(slice._wrapper))
3434
elseif index == 'resize' then
35-
return function(slice, size)
36-
C.resizeSlice(slice._wrapper, size)
37-
end
35+
return function(slice, size) C.resizeSlice(slice._wrapper, size) end
3836
end
3937
error('Unknown index `' .. index .. '` for LuaSlice')
4038
end,

src/mips/common/hardware/sio.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ SOFTWARE.
2727
#pragma once
2828

2929
#include <stdint.h>
30+
3031
#include "common/hardware/irq.h"
3132

3233
struct SIOPort {

src/mips/common/psxlibc/fastmemset.s

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fastMemset:
4444
addu $a2, $a0
4545
addiu $a2, -1
4646
small_memset_loop:
47-
sb $a1, 0($a0)
47+
sb $a1, 0($a0)
4848
bne $a0, $a2, small_memset_loop
4949
addiu $a0, 1
5050
jr $ra
@@ -95,70 +95,70 @@ t1 - the remainder counter to store
9595

9696
big_loop:
9797
addiu $t0, -1
98-
sw $a1, 0x0000($a0)
99-
sw $a1, 0x0004($a0)
100-
sw $a1, 0x0008($a0)
101-
sw $a1, 0x000c($a0)
102-
sw $a1, 0x0010($a0)
103-
sw $a1, 0x0014($a0)
104-
sw $a1, 0x0018($a0)
105-
sw $a1, 0x001c($a0)
106-
sw $a1, 0x0020($a0)
107-
sw $a1, 0x0024($a0)
108-
sw $a1, 0x0028($a0)
109-
sw $a1, 0x002c($a0)
110-
sw $a1, 0x0030($a0)
111-
sw $a1, 0x0034($a0)
112-
sw $a1, 0x0038($a0)
113-
sw $a1, 0x003c($a0)
114-
sw $a1, 0x0040($a0)
115-
sw $a1, 0x0044($a0)
116-
sw $a1, 0x0048($a0)
117-
sw $a1, 0x004c($a0)
118-
sw $a1, 0x0050($a0)
119-
sw $a1, 0x0054($a0)
120-
sw $a1, 0x0058($a0)
121-
sw $a1, 0x005c($a0)
122-
sw $a1, 0x0060($a0)
123-
sw $a1, 0x0064($a0)
124-
sw $a1, 0x0068($a0)
125-
sw $a1, 0x006c($a0)
126-
sw $a1, 0x0070($a0)
127-
sw $a1, 0x0074($a0)
128-
sw $a1, 0x0078($a0)
129-
sw $a1, 0x007c($a0)
130-
sw $a1, 0x0080($a0)
131-
sw $a1, 0x0084($a0)
132-
sw $a1, 0x0088($a0)
133-
sw $a1, 0x008c($a0)
134-
sw $a1, 0x0090($a0)
135-
sw $a1, 0x0094($a0)
136-
sw $a1, 0x0098($a0)
137-
sw $a1, 0x009c($a0)
138-
sw $a1, 0x00a0($a0)
139-
sw $a1, 0x00a4($a0)
140-
sw $a1, 0x00a8($a0)
141-
sw $a1, 0x00ac($a0)
142-
sw $a1, 0x00b0($a0)
143-
sw $a1, 0x00b4($a0)
144-
sw $a1, 0x00b8($a0)
145-
sw $a1, 0x00bc($a0)
146-
sw $a1, 0x00c0($a0)
147-
sw $a1, 0x00c4($a0)
148-
sw $a1, 0x00c8($a0)
149-
sw $a1, 0x00cc($a0)
150-
sw $a1, 0x00d0($a0)
151-
sw $a1, 0x00d4($a0)
152-
sw $a1, 0x00d8($a0)
153-
sw $a1, 0x00dc($a0)
154-
sw $a1, 0x00e0($a0)
155-
sw $a1, 0x00e4($a0)
156-
sw $a1, 0x00e8($a0)
157-
sw $a1, 0x00ec($a0)
158-
sw $a1, 0x00f0($a0)
159-
sw $a1, 0x00f4($a0)
160-
sw $a1, 0x00f8($a0)
161-
sw $a1, 0x00fc($a0)
98+
sw $a1, 0x0000($a0)
99+
sw $a1, 0x0004($a0)
100+
sw $a1, 0x0008($a0)
101+
sw $a1, 0x000c($a0)
102+
sw $a1, 0x0010($a0)
103+
sw $a1, 0x0014($a0)
104+
sw $a1, 0x0018($a0)
105+
sw $a1, 0x001c($a0)
106+
sw $a1, 0x0020($a0)
107+
sw $a1, 0x0024($a0)
108+
sw $a1, 0x0028($a0)
109+
sw $a1, 0x002c($a0)
110+
sw $a1, 0x0030($a0)
111+
sw $a1, 0x0034($a0)
112+
sw $a1, 0x0038($a0)
113+
sw $a1, 0x003c($a0)
114+
sw $a1, 0x0040($a0)
115+
sw $a1, 0x0044($a0)
116+
sw $a1, 0x0048($a0)
117+
sw $a1, 0x004c($a0)
118+
sw $a1, 0x0050($a0)
119+
sw $a1, 0x0054($a0)
120+
sw $a1, 0x0058($a0)
121+
sw $a1, 0x005c($a0)
122+
sw $a1, 0x0060($a0)
123+
sw $a1, 0x0064($a0)
124+
sw $a1, 0x0068($a0)
125+
sw $a1, 0x006c($a0)
126+
sw $a1, 0x0070($a0)
127+
sw $a1, 0x0074($a0)
128+
sw $a1, 0x0078($a0)
129+
sw $a1, 0x007c($a0)
130+
sw $a1, 0x0080($a0)
131+
sw $a1, 0x0084($a0)
132+
sw $a1, 0x0088($a0)
133+
sw $a1, 0x008c($a0)
134+
sw $a1, 0x0090($a0)
135+
sw $a1, 0x0094($a0)
136+
sw $a1, 0x0098($a0)
137+
sw $a1, 0x009c($a0)
138+
sw $a1, 0x00a0($a0)
139+
sw $a1, 0x00a4($a0)
140+
sw $a1, 0x00a8($a0)
141+
sw $a1, 0x00ac($a0)
142+
sw $a1, 0x00b0($a0)
143+
sw $a1, 0x00b4($a0)
144+
sw $a1, 0x00b8($a0)
145+
sw $a1, 0x00bc($a0)
146+
sw $a1, 0x00c0($a0)
147+
sw $a1, 0x00c4($a0)
148+
sw $a1, 0x00c8($a0)
149+
sw $a1, 0x00cc($a0)
150+
sw $a1, 0x00d0($a0)
151+
sw $a1, 0x00d4($a0)
152+
sw $a1, 0x00d8($a0)
153+
sw $a1, 0x00dc($a0)
154+
sw $a1, 0x00e0($a0)
155+
sw $a1, 0x00e4($a0)
156+
sw $a1, 0x00e8($a0)
157+
sw $a1, 0x00ec($a0)
158+
sw $a1, 0x00f0($a0)
159+
sw $a1, 0x00f4($a0)
160+
sw $a1, 0x00f8($a0)
161+
sw $a1, 0x00fc($a0)
162162
bnez $t0, big_loop
163163
addiu $a0, 0x0100
164164

src/mips/openbios/sio0/card.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ int __attribute__((section(".ramtext"))) mcReadHandler() {
9797
switch (g_mcOperation) {
9898
case 1:
9999
g_sio0Mask = port == 0 ? 0x0000 : SIO_CTRL_PORTSEL;
100-
SIOS[0].ctrl = g_sio0Mask | SIO_CTRL_TXEN | SIO_CTRL_ACKIRQEN
101-
| SIO_CTRL_DTR;
100+
SIOS[0].ctrl = g_sio0Mask | SIO_CTRL_TXEN | SIO_CTRL_ACKIRQEN | SIO_CTRL_DTR;
102101
exchangeByte((g_mcDeviceId[port] & 0x0f) + 0x81);
103102
g_mcActionInProgress = 1;
104103
break;
@@ -176,8 +175,7 @@ int __attribute__((section(".ramtext"))) mcWriteHandler() {
176175
switch (g_mcOperation) {
177176
case 1:
178177
g_sio0Mask = port == 0 ? 0x0000 : SIO_CTRL_PORTSEL;
179-
SIOS[0].ctrl = g_sio0Mask | SIO_CTRL_TXEN | SIO_CTRL_ACKIRQEN
180-
| SIO_CTRL_DTR;
178+
SIOS[0].ctrl = g_sio0Mask | SIO_CTRL_TXEN | SIO_CTRL_ACKIRQEN | SIO_CTRL_DTR;
181179
exchangeByte((g_mcDeviceId[port] & 0x0f) + 0x81);
182180
g_mcActionInProgress = 1;
183181
break;
@@ -249,8 +247,7 @@ int __attribute__((section(".ramtext"))) mcInfoHandler() {
249247
switch (g_mcOperation) {
250248
case 1:
251249
g_sio0Mask = port == 0 ? 0x0000 : SIO_CTRL_PORTSEL;
252-
SIOS[0].ctrl = g_sio0Mask | SIO_CTRL_TXEN | SIO_CTRL_ACKIRQEN
253-
| SIO_CTRL_DTR;
250+
SIOS[0].ctrl = g_sio0Mask | SIO_CTRL_TXEN | SIO_CTRL_ACKIRQEN | SIO_CTRL_DTR;
254251
exchangeByte((g_mcDeviceId[port] & 0x0f) + 0x81);
255252
g_mcActionInProgress = 1;
256253
break;

src/mips/openbios/sio0/driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ static void __attribute__((section(".ramtext"))) firstStageCardAction() {
318318
sysDeqIntRP(1, &g_mcHandlerInfo);
319319
SIOS[0].ctrl = SIO_CTRL_IR;
320320
SIOS[0].baudRate = 2073600 / 15200;
321-
SIOS[0].mode = 13; // MUL1, 8bit, no parity, normal polarity
321+
SIOS[0].mode = 13; // MUL1, 8bit, no parity, normal polarity
322322
SIOS[0].ctrl = 0;
323323
return;
324324
}

src/mips/psyqo-paths/archive-manager.hh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,8 @@ class ArchiveManager {
382382
uint32_t indexSize = (getIndexCount() + 1) * sizeof(IndexEntry);
383383
return (indexSize + 2047) / 2048;
384384
}
385-
static eastl::array<void (ArchiveManager::*)(const IndexEntry *), toUnderlying(IndexEntry::Method::COUNT)> s_decompressors;
385+
static eastl::array<void (ArchiveManager::*)(const IndexEntry *), toUnderlying(IndexEntry::Method::COUNT)>
386+
s_decompressors;
386387
void decompressUCL_NRV2E(const IndexEntry *entry);
387388
void decompressLZ4(const IndexEntry *entry);
388389
};

src/mips/psyqo-paths/cdrom-loader.hh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,7 @@ class CDRomLoader {
106106
setupQueue(path, parser, {});
107107
return m_queue.schedule();
108108
}
109-
ReadFileAwaiter readFile(eastl::string_view path, ISO9660Parser &parser) {
110-
return {path, parser, *this};
111-
}
109+
ReadFileAwaiter readFile(eastl::string_view path, ISO9660Parser &parser) { return {path, parser, *this}; }
112110

113111
private:
114112
void setupQueue(eastl::string_view path, ISO9660Parser &parser,

src/mips/psyqo-paths/examples/cdrom-loader/cdrom-loader.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,10 @@ void CDRomLoaderExample::prepare() {
7070
void CDRomLoaderExample::createScene() {
7171
m_font.uploadSystemFont(gpu());
7272
pushScene(&cdromLoaderExampleScene);
73-
m_cdromLoader.readFile("SYSTEM.CNF;1", cdromLoaderExample.m_isoParser,
74-
[this](psyqo::Buffer<uint8_t>&& buffer) {
75-
m_buffer = eastl::move(buffer);
76-
m_callbackCalled = true;
77-
});
73+
m_cdromLoader.readFile("SYSTEM.CNF;1", cdromLoaderExample.m_isoParser, [this](psyqo::Buffer<uint8_t>&& buffer) {
74+
m_buffer = eastl::move(buffer);
75+
m_callbackCalled = true;
76+
});
7877
}
7978

8079
void CDRomLoaderExampleScene::frame() {

0 commit comments

Comments
 (0)