Skip to content

Commit 1d9752f

Browse files
committed
formatting applied to src
1 parent 6b47f79 commit 1d9752f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+2508
-2444
lines changed

src/core/cdriso.cc

Lines changed: 103 additions & 101 deletions
Large diffs are not rendered by default.

src/core/cdrom.cc

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class CDRomImpl : public PCSX::CDRom {
6565
CdlReadToc = 30,
6666
};
6767

68-
static const inline char *CmdName[] = {
68+
static const inline char* CmdName[] = {
6969
"CdlSync", "CdlNop", "CdlSetloc", "CdlPlay", "CdlForward", "CdlBackward", "CdlReadN", "CdlStandby",
7070
"CdlStop", "CdlPause", "CdlInit", "CdlMute", "CdlDemute", "CdlSetfilter", "CdlSetmode", "CdlGetmode",
7171
"CdlGetlocL", "CdlGetlocP", "CdlReadT", "CdlGetTN", "CdlGetTD", "CdlSeekL", "CdlSeekP", "CdlSetclock",
@@ -141,16 +141,16 @@ class CDRomImpl : public PCSX::CDRom {
141141

142142
struct CdrStat cdr_stat;
143143

144-
static constexpr unsigned int msf2sec(const uint8_t *msf) { return ((msf[0] * 60 + msf[1]) * 75) + msf[2]; }
145-
static constexpr void sec2msf(unsigned int s, uint8_t *msf) {
144+
static constexpr unsigned int msf2sec(const uint8_t* msf) { return ((msf[0] * 60 + msf[1]) * 75) + msf[2]; }
145+
static constexpr void sec2msf(unsigned int s, uint8_t* msf) {
146146
msf[0] = s / 75 / 60;
147147
s = s - msf[0] * 75 * 60;
148148
msf[1] = s / 75;
149149
s = s - msf[1] * 75;
150150
msf[2] = s;
151151
}
152152
// for that weird psemu API..
153-
static constexpr unsigned int fsm2sec(const uint8_t *msf) { return ((msf[2] * 60 + msf[1]) * 75) + msf[0]; }
153+
static constexpr unsigned int fsm2sec(const uint8_t* msf) { return ((msf[2] * 60 + msf[1]) * 75) + msf[0]; }
154154

155155
static const uint32_t H_SPUirqAddr = 0x1f801da4;
156156
static const uint32_t H_SPUaddr = 0x1f801da6;
@@ -334,7 +334,7 @@ class CDRomImpl : public PCSX::CDRom {
334334
}
335335
}
336336

337-
void Find_CurTrack(const uint8_t *time) {
337+
void Find_CurTrack(const uint8_t* time) {
338338
int current, sect;
339339

340340
current = msf2sec(time);
@@ -347,7 +347,7 @@ class CDRomImpl : public PCSX::CDRom {
347347
CDR_LOG("Find_CurTrack *** %02d %02d\n", m_curTrack, current);
348348
}
349349

350-
void generate_subq(const uint8_t *time) {
350+
void generate_subq(const uint8_t* time) {
351351
unsigned char start[3], next[3];
352352
unsigned int this_s, start_s, next_s, pregap;
353353
int relative_s;
@@ -394,9 +394,9 @@ class CDRomImpl : public PCSX::CDRom {
394394
m_subq.absolute[2] = itob(time[2]);
395395
}
396396

397-
void ReadTrack(const uint8_t *time) {
397+
void ReadTrack(const uint8_t* time) {
398398
unsigned char tmp[3];
399-
struct SubQ *subq;
399+
struct SubQ* subq;
400400
uint16_t crc;
401401

402402
tmp[0] = itob(time[0]);
@@ -410,9 +410,9 @@ class CDRomImpl : public PCSX::CDRom {
410410
m_suceeded = m_iso.readTrack(tmp);
411411
memcpy(m_prev, tmp, 3);
412412

413-
subq = (struct SubQ *)m_iso.getBufferSub();
413+
subq = (struct SubQ*)m_iso.getBufferSub();
414414
if (subq != NULL && m_curTrack == 1) {
415-
crc = calcCrc((uint8_t *)subq + 12, 10);
415+
crc = calcCrc((uint8_t*)subq + 12, 10);
416416
if (crc == (((uint16_t)subq->CRC[0] << 8) | subq->CRC[1])) {
417417
m_subq.track = subq->TrackNumber;
418418
m_subq.index = subq->IndexNumber;
@@ -526,8 +526,8 @@ class CDRomImpl : public PCSX::CDRom {
526526
if (!m_muted) {
527527
m_iso.readCDDA(m_setSectorPlay[0], m_setSectorPlay[1], m_setSectorPlay[2], m_transfer);
528528

529-
attenuate((int16_t *)m_transfer, CD_FRAMESIZE_RAW / 4, 1);
530-
PCSX::g_emulator.m_spu->playCDDAchannel((short *)m_transfer, CD_FRAMESIZE_RAW);
529+
attenuate((int16_t*)m_transfer, CD_FRAMESIZE_RAW / 4, 1);
530+
PCSX::g_emulator.m_spu->playCDDAchannel((short*)m_transfer, CD_FRAMESIZE_RAW);
531531
}
532532

533533
m_setSectorPlay[2]++;
@@ -891,7 +891,7 @@ class CDRomImpl : public PCSX::CDRom {
891891
}
892892
m_result[0] |= (m_result[1] >> 4) & 0x08;
893893

894-
strncpy((char *)&m_result[4], "PCSX", 4);
894+
strncpy((char*)&m_result[4], "PCSX", 4);
895895
m_stat = Complete;
896896
break;
897897

@@ -943,7 +943,7 @@ class CDRomImpl : public PCSX::CDRom {
943943
// Crusaders of Might and Magic - update getlocl now
944944
// - fixes cutscene speech
945945
{
946-
uint8_t *buf = m_iso.getBuffer();
946+
uint8_t* buf = m_iso.getBuffer();
947947
if (buf != NULL) memcpy(m_transfer, buf, 8);
948948
}
949949

@@ -1024,7 +1024,7 @@ class CDRomImpl : public PCSX::CDRom {
10241024
return v;
10251025
}
10261026

1027-
void attenuate(int16_t *buf, int samples, int stereo) final {
1027+
void attenuate(int16_t* buf, int samples, int stereo) final {
10281028
int i, l, r;
10291029
int ll = m_attenuatorLeftToLeft;
10301030
int lr = m_attenuatorLeftToRight;
@@ -1054,7 +1054,7 @@ class CDRomImpl : public PCSX::CDRom {
10541054
}
10551055

10561056
void readInterrupt() final {
1057-
uint8_t *buf;
1057+
uint8_t* buf;
10581058

10591059
if (!m_reading) return;
10601060

@@ -1353,7 +1353,7 @@ class CDRomImpl : public PCSX::CDRom {
13531353
void dma(uint32_t madr, uint32_t bcr, uint32_t chcr) final {
13541354
uint32_t cdsize;
13551355
unsigned i;
1356-
uint8_t *ptr;
1356+
uint8_t* ptr;
13571357

13581358
CDR_LOG("dma() Log: *** DMA 3 *** %x addr = %x size = %x\n", chcr, madr, bcr);
13591359

@@ -1384,7 +1384,7 @@ class CDRomImpl : public PCSX::CDRom {
13841384
}
13851385
}
13861386

1387-
ptr = (uint8_t *)PSXM(madr);
1387+
ptr = (uint8_t*)PSXM(madr);
13881388
if (ptr == NULL) {
13891389
CDR_LOG("dma() Log: *** DMA 3 *** NULL Pointer!\n");
13901390
break;
@@ -1568,4 +1568,4 @@ class CDRomImpl : public PCSX::CDRom {
15681568

15691569
} // namespace
15701570

1571-
PCSX::CDRom *PCSX::CDRom::factory() { return new CDRomImpl; }
1571+
PCSX::CDRom* PCSX::CDRom::factory() { return new CDRomImpl; }

src/core/cheat.cc

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ void PCSX::Cheats::ClearAllCheats() {
4343
}
4444

4545
// load cheats from the specific filename
46-
void PCSX::Cheats::LoadCheats(const char *filename) {
47-
FILE *fp;
46+
void PCSX::Cheats::LoadCheats(const char* filename) {
47+
FILE* fp;
4848
char buf[256];
4949
int count = 0;
5050
unsigned int t1, t2;
@@ -73,9 +73,9 @@ void PCSX::Cheats::LoadCheats(const char *filename) {
7373
if (g_cheats == NULL) {
7474
assert(g_numCheats == 0);
7575
assert(s_numCheatsAllocated == ALLOC_INCREMENT);
76-
g_cheats = (Cheat *)malloc(sizeof(Cheat) * s_numCheatsAllocated);
76+
g_cheats = (Cheat*)malloc(sizeof(Cheat) * s_numCheatsAllocated);
7777
} else {
78-
g_cheats = (Cheat *)realloc(g_cheats, sizeof(Cheat) * s_numCheatsAllocated);
78+
g_cheats = (Cheat*)realloc(g_cheats, sizeof(Cheat) * s_numCheatsAllocated);
7979
}
8080
}
8181

@@ -104,9 +104,9 @@ void PCSX::Cheats::LoadCheats(const char *filename) {
104104
if (g_cheatCodes == NULL) {
105105
assert(g_numCodes == 0);
106106
assert(s_numCodesAllocated == ALLOC_INCREMENT);
107-
g_cheatCodes = (CheatCode *)malloc(sizeof(CheatCode) * s_numCodesAllocated);
107+
g_cheatCodes = (CheatCode*)malloc(sizeof(CheatCode) * s_numCodesAllocated);
108108
} else {
109-
g_cheatCodes = (CheatCode *)realloc(g_cheatCodes, sizeof(CheatCode) * s_numCodesAllocated);
109+
g_cheatCodes = (CheatCode*)realloc(g_cheatCodes, sizeof(CheatCode) * s_numCodesAllocated);
110110
}
111111
}
112112

@@ -127,8 +127,8 @@ void PCSX::Cheats::LoadCheats(const char *filename) {
127127
}
128128

129129
// save all cheats to the specified filename
130-
void PCSX::Cheats::SaveCheats(const char *filename) {
131-
FILE *fp;
130+
void PCSX::Cheats::SaveCheats(const char* filename) {
131+
FILE* fp;
132132
int i, j;
133133

134134
fp = fopen(filename, "w");
@@ -269,7 +269,7 @@ void PCSX::Cheats::ApplyCheats() {
269269
}
270270
}
271271

272-
int PCSX::Cheats::AddCheat(const char *descr, char *code) {
272+
int PCSX::Cheats::AddCheat(const char* descr, char* code) {
273273
int c = 1;
274274
char *p1, *p2;
275275

@@ -279,9 +279,9 @@ int PCSX::Cheats::AddCheat(const char *descr, char *code) {
279279
if (g_cheats == NULL) {
280280
assert(g_numCheats == 0);
281281
assert(s_numCheatsAllocated == ALLOC_INCREMENT);
282-
g_cheats = (Cheat *)malloc(sizeof(Cheat) * s_numCheatsAllocated);
282+
g_cheats = (Cheat*)malloc(sizeof(Cheat) * s_numCheatsAllocated);
283283
} else {
284-
g_cheats = (Cheat *)realloc(g_cheats, sizeof(Cheat) * s_numCheatsAllocated);
284+
g_cheats = (Cheat*)realloc(g_cheats, sizeof(Cheat) * s_numCheatsAllocated);
285285
}
286286
}
287287

@@ -314,9 +314,9 @@ int PCSX::Cheats::AddCheat(const char *descr, char *code) {
314314
if (g_cheatCodes == NULL) {
315315
assert(g_numCodes == 0);
316316
assert(s_numCodesAllocated == ALLOC_INCREMENT);
317-
g_cheatCodes = (CheatCode *)malloc(sizeof(CheatCode) * s_numCodesAllocated);
317+
g_cheatCodes = (CheatCode*)malloc(sizeof(CheatCode) * s_numCodesAllocated);
318318
} else {
319-
g_cheatCodes = (CheatCode *)realloc(g_cheatCodes, sizeof(CheatCode) * s_numCodesAllocated);
319+
g_cheatCodes = (CheatCode*)realloc(g_cheatCodes, sizeof(CheatCode) * s_numCodesAllocated);
320320
}
321321
}
322322

@@ -350,7 +350,7 @@ void PCSX::Cheats::RemoveCheat(int index) {
350350
g_numCheats--;
351351
}
352352

353-
int PCSX::Cheats::EditCheat(int index, const char *descr, char *code) {
353+
int PCSX::Cheats::EditCheat(int index, const char* descr, char* code) {
354354
int c = 1;
355355
int prev = g_numCodes;
356356
char *p1, *p2;
@@ -381,9 +381,9 @@ int PCSX::Cheats::EditCheat(int index, const char *descr, char *code) {
381381
if (g_cheatCodes == NULL) {
382382
assert(g_numCodes == 0);
383383
assert(s_numCodesAllocated == ALLOC_INCREMENT);
384-
g_cheatCodes = (CheatCode *)malloc(sizeof(CheatCode) * s_numCodesAllocated);
384+
g_cheatCodes = (CheatCode*)malloc(sizeof(CheatCode) * s_numCodesAllocated);
385385
} else {
386-
g_cheatCodes = (CheatCode *)realloc(g_cheatCodes, sizeof(CheatCode) * s_numCodesAllocated);
386+
g_cheatCodes = (CheatCode*)realloc(g_cheatCodes, sizeof(CheatCode) * s_numCodesAllocated);
387387
}
388388
}
389389

@@ -432,7 +432,7 @@ void PCSX::Cheats::CheatSearchBackupMemory() {
432432

433433
void PCSX::Cheats::CheatSearchInitBackupMemory() {
434434
if (g_prevM == NULL) {
435-
g_prevM = (int8_t *)malloc(0x200000);
435+
g_prevM = (int8_t*)malloc(0x200000);
436436
CheatSearchBackupMemory();
437437
}
438438
}
@@ -442,9 +442,9 @@ void PCSX::Cheats::CheatSearchAddResult(uint32_t addr) {
442442
s_numSearchResultsAllocated += ALLOC_INCREMENT;
443443

444444
if (g_searchResults == NULL) {
445-
g_searchResults = (uint32_t *)malloc(sizeof(uint32_t) * s_numSearchResultsAllocated);
445+
g_searchResults = (uint32_t*)malloc(sizeof(uint32_t) * s_numSearchResultsAllocated);
446446
} else {
447-
g_searchResults = (uint32_t *)realloc(g_searchResults, sizeof(uint32_t) * s_numSearchResultsAllocated);
447+
g_searchResults = (uint32_t*)realloc(g_searchResults, sizeof(uint32_t) * s_numSearchResultsAllocated);
448448
}
449449
}
450450

src/core/cheat.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,22 @@ class Cheats {
3030
} CheatCode;
3131

3232
typedef struct {
33-
char *Descr;
33+
char* Descr;
3434
int First; // index of the first cheat code
3535
int n; // number of cheat codes for this cheat
3636
int Enabled;
3737
} Cheat;
3838

3939
void ClearAllCheats();
4040

41-
void LoadCheats(const char *filename);
42-
void SaveCheats(const char *filename);
41+
void LoadCheats(const char* filename);
42+
void SaveCheats(const char* filename);
4343

4444
void ApplyCheats();
4545

46-
int AddCheat(const char *descr, char *code);
46+
int AddCheat(const char* descr, char* code);
4747
void RemoveCheat(int index);
48-
int EditCheat(int index, const char *descr, char *code);
48+
int EditCheat(int index, const char* descr, char* code);
4949

5050
void FreeCheatSearchResults();
5151
void FreeCheatSearchMem();
@@ -80,9 +80,9 @@ class Cheats {
8080
void CheatSearchNoChange32();
8181

8282
#define PREVM(mem) (&g_prevM[mem])
83-
#define PrevMu8(mem) (*(uint8_t *)PREVM(mem))
84-
#define PrevMu16(mem) (SWAP_LE16(*(uint16_t *)PREVM(mem)))
85-
#define PrevMu32(mem) (SWAP_LE32(*(uint32_t *)PREVM(mem)))
83+
#define PrevMu8(mem) (*(uint8_t*)PREVM(mem))
84+
#define PrevMu16(mem) (SWAP_LE16(*(uint16_t*)PREVM(mem)))
85+
#define PrevMu32(mem) (SWAP_LE32(*(uint32_t*)PREVM(mem)))
8686

8787
// cheat types
8888
enum {
@@ -106,12 +106,12 @@ class Cheats {
106106
};
107107

108108
private:
109-
Cheat *g_cheats = NULL;
110-
CheatCode *g_cheatCodes = NULL;
109+
Cheat* g_cheats = NULL;
110+
CheatCode* g_cheatCodes = NULL;
111111
int g_numCodes = 0;
112112

113-
int8_t *g_prevM = NULL;
114-
uint32_t *g_searchResults = NULL;
113+
int8_t* g_prevM = NULL;
114+
uint32_t* g_searchResults = NULL;
115115
int g_numSearchResults = 0;
116116

117117
int g_numCheats = 0;

src/core/debug.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ void PCSX::Debug::processAfter() {
9595

9696
if (m_stepping) {
9797
const bool gotException = pc == 0x80000080 || pc == 0xbfc00180;
98-
if (gotException) m_steppingJumps += 2; // there ought to be two jr $k0
98+
if (gotException) m_steppingJumps += 2; // there ought to be two jr $k0
9999

100100
auto none = m_breakpoints.end();
101101
switch (m_stepType) {

src/core/decode_xa.cc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static const int s_K1[4] = {0.0 * (1 << SHC), 0.0 * (1 << SHC), -0.8125 * (1 <<
5252
#define BLKSIZ 28 /* block size (32 - 4 nibbles) */
5353

5454
//===========================================
55-
static void ADPCM_InitDecode(ADPCM_Decode_t *decp) {
55+
static void ADPCM_InitDecode(ADPCM_Decode_t* decp) {
5656
decp->y0 = 0;
5757
decp->y1 = 0;
5858
}
@@ -66,14 +66,14 @@ static void ADPCM_InitDecode(ADPCM_Decode_t *decp) {
6666
#define IK1(fid) (-s_K1[fid])
6767
#endif
6868

69-
static inline void ADPCM_DecodeBlock16(ADPCM_Decode_t *decp, uint8_t filter_range, const void *vblockp, short *destp,
69+
static inline void ADPCM_DecodeBlock16(ADPCM_Decode_t* decp, uint8_t filter_range, const void* vblockp, short* destp,
7070
int inc) {
7171
int i;
7272
int range, filterid;
7373
int32_t fy0, fy1;
74-
const uint16_t *blockp;
74+
const uint16_t* blockp;
7575

76-
blockp = (const unsigned short *)vblockp;
76+
blockp = (const unsigned short*)vblockp;
7777
filterid = (filter_range >> 4) & 0x0f;
7878
range = (filter_range >> 0) & 0x0f;
7979

@@ -127,12 +127,12 @@ static inline void ADPCM_DecodeBlock16(ADPCM_Decode_t *decp, uint8_t filter_rang
127127
static const int s_headtable[4] = {0, 2, 8, 10};
128128

129129
//===========================================
130-
static void xa_decode_data(xa_decode_t *xdp, unsigned char *srcp) {
131-
const uint8_t *sound_groupsp;
130+
static void xa_decode_data(xa_decode_t* xdp, unsigned char* srcp) {
131+
const uint8_t* sound_groupsp;
132132
const uint8_t *sound_datap, *sound_datap2;
133133
int i, j, k, nbits;
134134
uint16_t data[4096], *datap;
135-
short *destp;
135+
short* destp;
136136

137137
destp = xdp->pcm;
138138
nbits = xdp->nbits == 4 ? 4 : 2;
@@ -285,7 +285,7 @@ typedef struct {
285285
#define SUB_AUDIO 2
286286

287287
//============================================
288-
static int parse_xa_audio_sector(xa_decode_t *xdp, xa_subheader_t *subheadp, unsigned char *sectorp,
288+
static int parse_xa_audio_sector(xa_decode_t* xdp, xa_subheader_t* subheadp, unsigned char* sectorp,
289289
int is_first_sector) {
290290
if (is_first_sector) {
291291
switch (AUDIO_CODING_GET_FREQ(subheadp->coding)) {
@@ -344,8 +344,8 @@ static int parse_xa_audio_sector(xa_decode_t *xdp, xa_subheader_t *subheadp, uns
344344
//=== - 0 for any other successive sector
345345
//=== return -1 if error
346346
//================================================================
347-
int32_t xa_decode_sector(xa_decode_t *xdp, unsigned char *sectorp, int is_first_sector) {
348-
if (parse_xa_audio_sector(xdp, (xa_subheader_t *)sectorp, sectorp + sizeof(xa_subheader_t), is_first_sector))
347+
int32_t xa_decode_sector(xa_decode_t* xdp, unsigned char* sectorp, int is_first_sector) {
348+
if (parse_xa_audio_sector(xdp, (xa_subheader_t*)sectorp, sectorp + sizeof(xa_subheader_t), is_first_sector))
349349
return -1;
350350

351351
return 0;

src/core/decode_xa.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ struct xa_decode_t {
3434
short pcm[16384];
3535
};
3636

37-
int32_t xa_decode_sector(xa_decode_t *xdp, unsigned char *sectorp, int is_first_sector);
37+
int32_t xa_decode_sector(xa_decode_t* xdp, unsigned char* sectorp, int is_first_sector);

0 commit comments

Comments
 (0)