Skip to content

Commit 38e7374

Browse files
lint-actionDextinfire
authored andcommitted
Fix code style issues with clang_format
1 parent 76446a1 commit 38e7374

12 files changed

Lines changed: 100 additions & 100 deletions

File tree

src/data/achievementsystem.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ enum class AchievementError {
2121
class Achievement {
2222
public:
2323
Achievement(std::string name, std::string description, bool hidden,
24-
const Sprite &icon)
24+
const Sprite& icon)
2525
: name(std::move(name)),
2626
description(std::move(description)),
2727
hidden(hidden),
2828
icon(icon) {}
2929

30-
std::string const &Name() const { return name; }
31-
std::string const &Description() const { return description; }
30+
std::string const& Name() const { return name; }
31+
std::string const& Description() const { return description; }
3232
bool Hidden() const { return hidden; }
33-
Sprite const &Icon() const { return icon; }
33+
Sprite const& Icon() const { return icon; }
3434

3535
protected:
3636
std::string name;
@@ -42,19 +42,19 @@ class Achievement {
4242
class AchievementSystemBase {
4343
public:
4444
virtual AchievementError MountAchievementFile(
45-
std::function<void(void)> &mainThreadCallback) = 0;
45+
std::function<void(void)>& mainThreadCallback) = 0;
4646
// virtual bool UnlockAchievement(int id) = 0;
47-
virtual const Achievement *GetAchievement(int id) = 0;
47+
virtual const Achievement* GetAchievement(int id) = 0;
4848
virtual size_t GetAchievementCount() const = 0;
4949
};
5050

51-
inline AchievementSystemBase *Implementation = nullptr;
51+
inline AchievementSystemBase* Implementation = nullptr;
5252

5353
void Init();
5454

5555
LoadStatus GetLoadStatus();
5656
void MountAchievementFile();
57-
const Achievement *GetAchievement(int id);
57+
const Achievement* GetAchievement(int id);
5858
size_t GetAchievementCount();
5959

6060
} // namespace AchievementSystem

src/games/cclcc/tipssystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void TipsSystem::DataInit(uint32_t scriptBufferId, uint32_t tipsDataAdr,
4949
void TipsSystem::UpdateTipRecords() {
5050
if (TipEntryCount != 0) {
5151
for (size_t i = 0; i < TipEntryCount; i++) {
52-
auto &record = Records[i];
52+
auto& record = Records[i];
5353
auto tipStatus = SaveSystem::GetTipStatus(record.Id);
5454
record.IsLocked = (tipStatus & 1) == 0;
5555
record.IsUnread = (tipStatus & 2) == 0;

src/games/chlcc/albummenu.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ class AlbumMenu : public Menu, public CommonMenu {
2121
void Render() override;
2222

2323
private:
24-
std::vector<Widgets::Group *> Pages;
24+
std::vector<Widgets::Group*> Pages;
2525

2626
void DrawPage();
2727

2828
void UpdatePages();
2929

30-
void CgOnClick(Widgets::Button *target);
31-
void OnCgVariationEnd(Widgets::CgViewer *target);
30+
void CgOnClick(Widgets::Button* target);
31+
void OnCgVariationEnd(Widgets::CgViewer* target);
3232

33-
Widgets::Group *CgViewerGroup;
34-
Widgets::CgViewer *CgViewerWidget;
33+
Widgets::Group* CgViewerGroup;
34+
Widgets::CgViewer* CgViewerWidget;
3535

3636
int PrevPage = 0;
3737
int CurrentPage;

src/games/mo6tw/tipsmenu.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ using namespace Impacto::Vm::Interface;
2626
using namespace Impacto::UI::Widgets;
2727
using namespace Impacto::UI::Widgets::MO6TW;
2828

29-
void TipsMenu::TipOnClick(Button *target) {
30-
auto tipEntry = static_cast<TipsEntryButton *>(target);
29+
void TipsMenu::TipOnClick(Button* target) {
30+
auto tipEntry = static_cast<TipsEntryButton*>(target);
3131
if (!tipEntry->TipEntryRecord->IsLocked) SwitchToTipId(target->Id);
3232
}
3333

@@ -142,21 +142,21 @@ void TipsMenu::Render() {
142142
}
143143

144144
void TipsMenu::Init() {
145-
auto onClick = [this](auto *btn) { return TipOnClick(btn); };
145+
auto onClick = [this](auto* btn) { return TipOnClick(btn); };
146146
int currentPage = 0, currentCategoryId = -1;
147147

148148
// String of characters by which tips are sorted, taken from _system script
149149
auto [scriptBufId, sortStrAddr] =
150150
Vm::ScriptGetTextTableStrAddress(SortStringTable, SortStringIndex);
151-
uint8_t *sortString = &Vm::ScriptBuffers[scriptBufId][sortStrAddr];
151+
uint8_t* sortString = &Vm::ScriptBuffers[scriptBufId][sortStrAddr];
152152
auto recordCount = TipsSystem::GetTipCount();
153153

154154
float currentY = TipListInitialY;
155155

156156
ItemsList.Clear();
157157
TipViewItems.Clear();
158158

159-
Group *pageItems = new Group(this);
159+
Group* pageItems = new Group(this);
160160
for (size_t i = 0; i < recordCount; i++) {
161161
auto record = TipsSystem::GetTipRecord(i);
162162

@@ -181,11 +181,11 @@ void TipsMenu::Init() {
181181
CategoryString[1] = UnalignedRead<uint16_t>(
182182
&sortString[currentCategoryId * sizeof(uint16_t)]);
183183

184-
Label *categoryLabel = new Label();
184+
Label* categoryLabel = new Label();
185185
categoryLabel->Bounds.X = TipListEntryBounds.X;
186186
categoryLabel->Bounds.Y = currentY;
187187
Vm::Sc3Stream categoryStrStream(
188-
reinterpret_cast<uint8_t *>(CategoryString));
188+
reinterpret_cast<uint8_t*>(CategoryString));
189189
categoryLabel->SetText(categoryStrStream, TipListEntryFontSize,
190190
RendererOutlineMode::Full, 0);
191191
pageItems->Add(categoryLabel);
@@ -194,7 +194,7 @@ void TipsMenu::Init() {
194194

195195
// Actual tip entry button
196196
TipListEntryBounds.Y = currentY;
197-
TipsEntryButton *button =
197+
TipsEntryButton* button =
198198
new TipsEntryButton(record->Id, record, TipListEntryBounds,
199199
Profile::BacklogMenu::EntryHighlight);
200200
button->OnClickHandler = onClick;

src/games/mo6tw/tipssystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ void TipsSystem::DataInit(uint32_t scriptBufferId, uint32_t tipsDataAdr,
2323
int idx = 0;
2424

2525
// Read tips data from the script and create UI elements for each tip
26-
MemoryStream *stream =
26+
MemoryStream* stream =
2727
new MemoryStream(&scriptBuffer[tipsDataAdr], tipsDataSize);
2828
auto unk01 = ReadLE<uint16_t>(stream);
2929
while (unk01 != 255) {

src/io/lzxstream.cpp

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ namespace Io {
88

99
LzxStream::~LzxStream() { free(CompressedBuffer); }
1010

11-
IoError LzxStream::Create(Stream *baseStream, int64_t offset, int64_t size,
12-
Stream **out) {
11+
IoError LzxStream::Create(Stream* baseStream, int64_t offset, int64_t size,
12+
Stream** out) {
1313
if (offset + size > baseStream->Meta.Size) return IoError_Fail;
14-
Stream *dup;
14+
Stream* dup;
1515
int64_t err = baseStream->Duplicate(&dup);
1616
if (err != IoError_OK) return (IoError)err;
1717
err = dup->Seek(offset, RW_SEEK_SET);
@@ -50,7 +50,7 @@ IoError LzxStream::Create(Stream *baseStream, int64_t offset, int64_t size,
5050
return IoError_Fail;
5151
}
5252

53-
LzxStream *result = new LzxStream(uncompressedBlockSize);
53+
LzxStream* result = new LzxStream(uncompressedBlockSize);
5454
result->BaseStream = dup;
5555
result->CompressedOffset = compressedOffset;
5656
result->CompressedPosition = 0;
@@ -61,13 +61,13 @@ IoError LzxStream::Create(Stream *baseStream, int64_t offset, int64_t size,
6161

6262
result->WindowSize = windowSize;
6363
result->CompressionPartitionSize = compressionPartitionSize;
64-
result->CompressedBuffer = (uint8_t *)malloc(compressedBlockSize);
64+
result->CompressedBuffer = (uint8_t*)malloc(compressedBlockSize);
6565
result->CompressedBufferSize = compressedBlockSize;
66-
*out = (Stream *)result;
66+
*out = (Stream*)result;
6767
return IoError_OK;
6868
}
6969

70-
int64_t LzxStream::Read(void *buffer, int64_t sz) {
70+
int64_t LzxStream::Read(void* buffer, int64_t sz) {
7171
return ReadBuffered(buffer, sz);
7272
}
7373

@@ -105,14 +105,14 @@ int64_t LzxStream::Seek(int64_t offset, int origin) {
105105
return Position;
106106
}
107107

108-
IoError LzxStream::Duplicate(Stream **outStream) {
109-
Stream *dup;
108+
IoError LzxStream::Duplicate(Stream** outStream) {
109+
Stream* dup;
110110
int64_t err = BaseStream->Duplicate(&dup);
111111
if (err != IoError_OK) return (IoError)err;
112-
LzxStream *result = new LzxStream(*this);
113-
result->CompressedBuffer = (uint8_t *)malloc(CompressedBufferSize);
112+
LzxStream* result = new LzxStream(*this);
113+
result->CompressedBuffer = (uint8_t*)malloc(CompressedBufferSize);
114114
result->BaseStream = dup;
115-
*outStream = (Stream *)result;
115+
*outStream = (Stream*)result;
116116
return IoError_OK;
117117
}
118118

@@ -149,7 +149,7 @@ IoError LzxStream::FillBuffer() {
149149
}
150150

151151
struct LZXFile {
152-
uint8_t *buf;
152+
uint8_t* buf;
153153
int bufSize;
154154
int pos;
155155
int rest;
@@ -158,7 +158,7 @@ struct LZXFile {
158158
// Based on
159159
// https://github.com/gildor2/UEViewer/blob/master/Unreal/UnCoreCompression.cpp
160160

161-
static int LZXread(struct LZXFile *file, void *buffer, int bytes) {
161+
static int LZXread(struct LZXFile* file, void* buffer, int bytes) {
162162
if (!file->rest) {
163163
// read block header
164164
if (file->buf[file->pos] == 0xFF) {
@@ -186,27 +186,27 @@ static int LZXread(struct LZXFile *file, void *buffer, int bytes) {
186186
return bytes;
187187
}
188188

189-
static int LZXwrite(struct LZXFile *file, void *buffer, int bytes) {
189+
static int LZXwrite(struct LZXFile* file, void* buffer, int bytes) {
190190
memcpy(file->buf + file->pos, buffer, bytes);
191191
file->pos += bytes;
192192
return bytes;
193193
}
194194

195-
static void *LZXalloc(struct mspack_system *self, size_t bytes) {
195+
static void* LZXalloc(struct mspack_system* self, size_t bytes) {
196196
return malloc(bytes);
197197
}
198198

199-
static void LZXfree(void *ptr) { free(ptr); }
199+
static void LZXfree(void* ptr) { free(ptr); }
200200

201-
static void LZXCopy(void *src, void *dst, size_t bytes) {
201+
static void LZXCopy(void* src, void* dst, size_t bytes) {
202202
memcpy(dst, src, bytes);
203203
}
204204

205205
static struct mspack_system LZXSys = {
206206
NULL, // open
207207
NULL, // close
208-
(auto (*)(mspack_file *, void *, int)->int)&LZXread,
209-
(auto (*)(mspack_file *, void *, int)->int)&LZXwrite,
208+
(auto (*)(mspack_file*, void*, int)->int)&LZXread,
209+
(auto (*)(mspack_file*, void*, int)->int)&LZXwrite,
210210
NULL, // seek
211211
NULL, // tell
212212
NULL, // message
@@ -215,8 +215,8 @@ static struct mspack_system LZXSys = {
215215
&LZXCopy,
216216
NULL};
217217

218-
int32_t LZXDecompress(uint8_t *CompressedBuffer, int CompressedSize,
219-
uint8_t *UncompressedBuffer, int UncompressedSize,
218+
int32_t LZXDecompress(uint8_t* CompressedBuffer, int CompressedSize,
219+
uint8_t* UncompressedBuffer, int UncompressedSize,
220220
int WindowSize, int CompressionPartitionSize) {
221221
// setup streams
222222
struct LZXFile src, dst;
@@ -234,9 +234,9 @@ int32_t LZXDecompress(uint8_t *CompressedBuffer, int CompressedSize,
234234
}
235235
if (WindowSize <= 0) WindowSize = 17;
236236
if (CompressionPartitionSize <= 0) CompressionPartitionSize = 256 * 1024;
237-
struct lzxd_stream *lzxd =
238-
lzxd_init(&LZXSys, (mspack_file *)&src, (mspack_file *)&dst, WindowSize,
239-
0, CompressionPartitionSize, UncompressedSize, 0);
237+
struct lzxd_stream* lzxd =
238+
lzxd_init(&LZXSys, (mspack_file*)&src, (mspack_file*)&dst, WindowSize, 0,
239+
CompressionPartitionSize, UncompressedSize, 0);
240240
// decompress
241241
int r = lzxd_decompress(lzxd, UncompressedSize);
242242
if (r != MSPACK_ERR_OK) return -1;

src/io/mpkarchive.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ struct MpkMetaEntry;
1010
class MpkArchive : public VfsArchive {
1111
public:
1212
~MpkArchive();
13-
IoError Open(FileMeta *file, Stream **outStream) override;
13+
IoError Open(FileMeta* file, Stream** outStream) override;
1414

15-
static IoError Create(Stream *stream, VfsArchive **outArchive);
15+
static IoError Create(Stream* stream, VfsArchive** outArchive);
1616

1717
private:
18-
MpkMetaEntry *TOC = 0;
18+
MpkMetaEntry* TOC = 0;
1919
};
2020

2121
} // namespace Io

src/renderer/3d/scene.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class IScene3D {
1616

1717
Camera MainCamera;
1818

19-
IRenderable3D **Renderables;
19+
IRenderable3D** Renderables;
2020

2121
glm::vec3 LightPosition;
2222
glm::vec4 Tint;

0 commit comments

Comments
 (0)