Skip to content

Commit

Permalink
[Chores] Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbaumann authored Feb 27, 2025
1 parent be5274a commit f7291ed
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/core/r3000a.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
#include "core/sio.h"
#include "core/sio1.h"
#include "core/spu.h"
#include "supportpsx/memory.h"
#include "fmt/format.h"
#include "supportpsx/memory.h"

int PCSX::R3000Acpu::psxInit() {
g_system->printf(_("PCSX-Redux booting\n"));
Expand Down Expand Up @@ -506,7 +506,7 @@ void PCSX::R3000Acpu::processB0KernelCall(uint32_t call) {

std::pair<const uint32_t, std::string>* PCSX::R3000Acpu::findContainingSymbol(uint32_t addr) {
auto symBefore = m_symbols.upper_bound(addr);
if (symBefore != m_symbols.begin()) { // verify there is actually a symbol before addr
if (symBefore != m_symbols.begin()) { // verify there is actually a symbol before addr

Check warning on line 509 in src/core/r3000a.cc

View check run for this annotation

Codecov / codecov/patch

src/core/r3000a.cc#L509

Added line #L509 was not covered by tests
symBefore--;
if (symBefore->first != addr) {
PCSX::PSXAddress addrInfo(addr);
Expand Down
4 changes: 2 additions & 2 deletions src/core/r3000a.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ class R3000Acpu {

std::map<uint32_t, std::string> m_symbols;

std::pair<const uint32_t, std::string>* findContainingSymbol(uint32_t addr);
std::string* getSymbolAt(uint32_t addr);
std::pair<const uint32_t, std::string> *findContainingSymbol(uint32_t addr);
std::string *getSymbolAt(uint32_t addr);

static int psxInit();
virtual bool isDynarec() = 0;
Expand Down
14 changes: 7 additions & 7 deletions src/mips/openbios/kernel/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ _Static_assert(sizeof(allocated_block) == (2 * sizeof(void *)), "allocated_block
static empty_block *user_heap_head = NULL;
static empty_block *kern_heap_head = NULL;

static empty_block marker = { .next = NULL, .size = 0 };
static empty_block marker = {.next = NULL, .size = 0};

enum heap { HEAP_USER, HEAP_KERNEL };

Expand Down Expand Up @@ -137,7 +137,7 @@ static __attribute__((section(".ramtext"))) void multi_free(void *ptr_, const en
empty_block *block = (empty_block *)ptr_;
block--;
size_t size = block->size;
empty_block * const head = heap == HEAP_USER ? user_heap_head : kern_heap_head;
empty_block *const head = heap == HEAP_USER ? user_heap_head : kern_heap_head;

if (head == &marker) {
if (heap == HEAP_USER) {
Expand Down Expand Up @@ -218,7 +218,7 @@ static __attribute__((section(".ramtext"))) void *multi_realloc(void *ptr_, size
return ptr_;
}

empty_block * const head = heap == HEAP_USER ? user_heap_head : kern_heap_head;
empty_block *const head = heap == HEAP_USER ? user_heap_head : kern_heap_head;
if (head == &marker) {
if (size < old_size) {
empty_block *new_block = (empty_block *)((char *)block + size);
Expand Down Expand Up @@ -323,8 +323,8 @@ static __attribute__((section(".ramtext"))) void *multi_realloc(void *ptr_, size
if (new_ptr == NULL) {
return NULL;
}
uint32_t * src = (uint32_t *)ptr_;
uint32_t * dst = (uint32_t *)new_ptr;
uint32_t *src = (uint32_t *)ptr_;
uint32_t *dst = (uint32_t *)new_ptr;
uint32_t size_to_copy = old_size - sizeof(empty_block);
while (size_to_copy > 0) {
*dst++ = *src++;
Expand All @@ -340,7 +340,7 @@ __attribute__((section(".ramtext"))) void *user_realloc(void *ptr, size_t size)
return multi_realloc(ptr, size, HEAP_USER);
}
__attribute__((section(".ramtext"))) void user_initheap(void *base, size_t size) {
user_heap_head = (empty_block*)ALIGN_TO(base);
user_heap_head = (empty_block *)ALIGN_TO(base);
user_heap_head->next = &marker;
user_heap_head->size = ALIGN_TO(size - sizeof(empty_block));
}
Expand All @@ -351,7 +351,7 @@ __attribute__((section(".ramtext"))) void *kern_realloc(void *ptr, size_t size)
return multi_realloc(ptr, size, HEAP_KERNEL);
}
__attribute__((section(".ramtext"))) void kern_initheap(void *base, size_t size) {
kern_heap_head = (empty_block*)ALIGN_TO(base);
kern_heap_head = (empty_block *)ALIGN_TO(base);
kern_heap_head->next = &marker;
kern_heap_head->size = ALIGN_TO(size - sizeof(empty_block));
}

0 comments on commit f7291ed

Please sign in to comment.