Skip to content

Commit

Permalink
Enforce types.h typedefs
Browse files Browse the repository at this point in the history
  • Loading branch information
Repiteo committed Jan 2, 2024
1 parent 8668792 commit 2513d73
Show file tree
Hide file tree
Showing 472 changed files with 13,795 additions and 13,883 deletions.
10 changes: 5 additions & 5 deletions include/ChannelMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
typedef class ChannelMgr;

class ChannelMgr {
float _00; // _00
float _04; // _04
float _08; // _08
s32 _0C; // _0C
s32 _10; // _10
f32 _00; // _00
f32 _04; // _04
f32 _08; // _08
s32 _0C; // _0C
s32 _10; // _10

ChannelMgr();
};
Expand Down
24 changes: 13 additions & 11 deletions include/Dolphin/float.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
#ifndef _DOLPHIN_FLOAT_H
#define _DOLPHIN_FLOAT_H

extern const float __float_nan[];
#include "types.h"

extern const f32 __float_nan[];
#define __float_nan *__float_nan
extern const float __float_huge;
extern const double __double_min;
extern const double __double_max;
extern const double __double_huge;
extern const double __double_nan;
extern const double __extended_min;
extern const double __extended_max;
extern const float __float_max;
extern const float __float_epsilon;
extern const f32 __float_huge;
extern const f64 __double_min;
extern const f64 __double_max;
extern const f64 __double_huge;
extern const f64 __double_nan;
extern const f64 __extended_min;
extern const f64 __extended_max;
extern const f32 __float_max;
extern const f32 __float_epsilon;

#endif
#endif // _DOLPHIN_FLOAT_H
16 changes: 8 additions & 8 deletions include/Dolphin/math.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ extern "C" {
#define __frsqrte(x) (x)
#endif

#define FABS(x) (float)__fabs(x)
#define FABS(x) (f32)__fabs(x)
// #define __frsqrtes opword

#define SQUARE(v) ((v) * (v))
Expand All @@ -24,13 +24,13 @@ extern "C" {

#define LONG_TAU 6.2831854820251465

double cos(double);
float cosf(float);
double sin(double);
double tan(double);
float tanf(float);
double atan(double);
double atan2(double, double);
f64 cos(f64);
f32 cosf(f32);
f64 sin(f64);
f64 tan(f64);
f32 tanf(f32);
f64 atan(f64);
f64 atan2(f64, f64);

#ifdef __cplusplus
};
Expand Down
4 changes: 2 additions & 2 deletions include/Dolphin/os.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void* OSInitAlloc(void*, void*, int);
OSHeapHandle OSCreateHeap(void*, void*);
OSHeapHandle OSSetCurrentHeap(OSHeapHandle);
void* OSAllocFromHeap(OSHeapHandle, u32);
long OSCheckHeap(OSHeapHandle);
s32 OSCheckHeap(OSHeapHandle);
void OSFreeToHeap(OSHeapHandle heap, void* ptr);

#define OSAlloc(size) OSAllocFromHeap(__OSCurrHeap, (size))
Expand Down Expand Up @@ -207,7 +207,7 @@ OSPriority OSGetThreadPriority(OSThread* thread);
void OSSleepThread(OSThreadQueue* queue);
void OSWakeupThread(OSThreadQueue* queue);

long OSCheckActiveThreads(void);
s32 OSCheckActiveThreads(void);

void OSInitMutex(OSMutexObject*);
void OSLockMutex(OSMutexObject*);
Expand Down
6 changes: 3 additions & 3 deletions include/HmRumble.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ typedef class RumbleSample;
extern "C" void PADControlMotor(int, int);

class RumbleSample {
float _00; // _00
float _04; // _04
int _08; // _08
f32 _00; // _00
f32 _04; // _04
int _08; // _08

RumbleSample(int);
void simpleStop();
Expand Down
2 changes: 1 addition & 1 deletion include/Matrix3f.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "types.h"

struct Matrix3f {
float mMatrix[3][3];
f32 mMatrix[3][3];
};

#endif
2 changes: 1 addition & 1 deletion include/Matrix4f.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
struct Matrix4f {
void makeIdentity();

float mMatrix[4][4];
f32 mMatrix[4][4];
};

#endif
4 changes: 2 additions & 2 deletions include/V3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct Vector3D_ {
f32 x, y, z;
};

double atanf2(float, float);
double sqrtf2(float);
f64 atanf2(f32, f32);
f64 sqrtf2(f32);

#endif
10 changes: 5 additions & 5 deletions include/Vector3f.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

struct Vector3f {
Vector3f() { }
Vector3f(float const& x, float const& y, float const& z);
Vector3f(f32 const& x, f32 const& y, f32 const& z);

inline f32 distance(Vector3f& to)
{
Expand All @@ -23,7 +23,7 @@ struct Vector3f {
set(newX, newY, newZ);
}

inline void set(float const& pX, float const& pY, float const& pZ)
inline void set(f32 const& pX, f32 const& pY, f32 const& pZ)
{
x = pX;
y = pY;
Expand All @@ -44,8 +44,8 @@ struct Vector3f {
f32 x, y, z;
};

inline float Vector3f_diffX(Vector3f& a, Vector3f& b) { return a.getX() - b.getX(); }
inline float Vector3f_diffY(Vector3f& a, Vector3f& b) { return a.getY() - b.getY(); }
inline float Vector3f_diffZ(Vector3f& a, Vector3f& b) { return a.getZ() - b.getZ(); }
inline f32 Vector3f_diffX(Vector3f& a, Vector3f& b) { return a.getX() - b.getX(); }
inline f32 Vector3f_diffY(Vector3f& a, Vector3f& b) { return a.getY() - b.getY(); }
inline f32 Vector3f_diffZ(Vector3f& a, Vector3f& b) { return a.getZ() - b.getZ(); }

#endif
5 changes: 3 additions & 2 deletions include/ctype.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define _CTYPE_H

#include "types.h"

#ifdef __cplusplus
extern "C" {
#endif // ifdef __cplusplus
Expand All @@ -15,12 +16,12 @@ extern "C" {
#define CTYPE_LOWER 0x40
#define CTYPE_UPPER 0x80

extern const unsigned char __ctype_map[256];
extern const u8 __ctype_map[256];

inline BOOL isdigit(int c) { return (__ctype_map[c & 0xFF] & CTYPE_XDIGIT) != 0; }

#ifdef __cplusplus
};
#endif // ifdef __cplusplus

#endif
#endif // _CTYPE_H
Loading

0 comments on commit 2513d73

Please sign in to comment.