Skip to content

Commit

Permalink
[Chores] Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasnoble authored Nov 6, 2024
1 parent cc67b8e commit 083e040
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions src/mips/common/crt0/cxxglue.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ extern fptr __preinit_array_end[] __attribute__((weak));
extern fptr __init_array_start[] __attribute__((weak));
extern fptr __init_array_end[] __attribute__((weak));

int main(int argc, char ** argv);
int main(int argc, char** argv);

void cxxmain(int argc, char ** argv) {
void cxxmain(int argc, char** argv) {
size_t count, i;

count = __preinit_array_end - __preinit_array_start;
Expand All @@ -69,16 +69,16 @@ void cxxmain(int argc, char ** argv) {

// These two technically aren't part of the standard library requirements, but can
// be invoked by the freestanding libstdc++, so might as well.
__attribute__((weak)) size_t strlen(const char * s) {
__attribute__((weak)) size_t strlen(const char* s) {
size_t r = 0;

while (*s++) r++;

return r;
}

__attribute__((weak)) const void * memchr(const void * _s, int c, size_t n) {
const uint8_t * s = (uint8_t *) _s;
__attribute__((weak)) const void* memchr(const void* _s, int c, size_t n) {
const uint8_t* s = (uint8_t*)_s;
size_t i;

for (i = 0; i < n; i++, s++) {
Expand Down
8 changes: 4 additions & 4 deletions src/mips/psyqo/bump-allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ namespace psyqo {
template <size_t N>
class BumpAllocator {
public:
template <Primitive P, typename ...Args>
Fragments::SimpleFragment<P> &allocateFragment(Args ...args) {
template <Primitive P, typename... Args>
Fragments::SimpleFragment<P> &allocateFragment(Args... args) {
static constexpr size_t size = sizeof(Fragments::SimpleFragment<P>);
uint8_t *ptr = m_current;
m_current += size;
return *new (ptr) Fragments::SimpleFragment<P>(args...);
}
template <typename T, typename ...Args>
T &allocate(Args ...args) {
template <typename T, typename... Args>
T &allocate(Args... args) {
size_t size = sizeof(T);
uint8_t *ptr = m_current;
if constexpr (alignof(T) > 1) {
Expand Down
4 changes: 2 additions & 2 deletions src/mips/psyqo/examples/cube/cube.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ void CubeScene::frame() {

// Read the result of nclip and skip rendering this face if it's not facing us
int32_t mac0 = 0;
psyqo::GTE::read<psyqo::GTE::Register::MAC0>(reinterpret_cast<uint32_t *>(&mac0));
psyqo::GTE::read<psyqo::GTE::Register::MAC0>(reinterpret_cast<uint32_t*>(&mac0));
if (mac0 <= 0) continue;

// Since the GTE can only handle 3 vertices at a time, we need to store our first vertex
Expand All @@ -191,7 +191,7 @@ void CubeScene::frame() {
// Calculate the average Z for the z-Index to be put in the ordering table
psyqo::GTE::Kernels::avsz4();
int32_t zIndex = 0;
psyqo::GTE::read<psyqo::GTE::Register::OTZ>(reinterpret_cast<uint32_t *>(&zIndex));
psyqo::GTE::read<psyqo::GTE::Register::OTZ>(reinterpret_cast<uint32_t*>(&zIndex));

// If the Z-index is out of bounds for our ordering table, we skip rendering this face.
if (zIndex < 0 || zIndex >= ORDERING_TABLE_SIZE) continue;
Expand Down
2 changes: 1 addition & 1 deletion src/mips/psyqo/primitives/common.hh
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ enum ColorMode { Tex4Bits, Tex8Bits, Tex16Bits };
} // namespace Prim::TPageAttr

namespace Prim {
enum class Transparency { Auto, Opaque, SemiTransparent };
enum class Transparency { Auto, Opaque, SemiTransparent };
}

namespace PrimPieces {
Expand Down

0 comments on commit 083e040

Please sign in to comment.