Merge pull request #267 from gamemasterplc/main

Move abs to stdlib.h
This commit is contained in:
gamemasterplc 2024-04-13 19:34:17 -05:00 committed by GitHub
commit b3e7bfcc07
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 13 additions and 11 deletions

View file

@ -43,8 +43,6 @@ float cosf(float x);
float atan2f(float y, float x); float atan2f(float y, float x);
float acosf(float x); float acosf(float x);
#define abs(x) __abs(x)
extern inline double fabs(double x) extern inline double fabs(double x)
{ {
return __fabs(x); return __fabs(x);

6
include/stdlib.h Normal file
View file

@ -0,0 +1,6 @@
#ifndef _STDLIB_H
#define _STDLIB_H
#define abs(x) __abs(x)
#endif

View file

@ -1,8 +1,7 @@
#include "game/process.h" #include "game/process.h"
#include "game/object.h" #include "game/object.h"
#include "game/hsfdraw.h" #include "game/hsfdraw.h"
#include "math.h"
#define M_PI 3.141592653589793
typedef struct unkDominationData2 { typedef struct unkDominationData2 {
/* 0x00 */ s32 unk_00; /* 0x00 */ s32 unk_00;
@ -23,8 +22,6 @@ void fn_1_1CAC(f32, f32, f32);
void fn_1_1D08(f32, f32, f32); void fn_1_1D08(f32, f32, f32);
void fn_1_1D64(f32); void fn_1_1D64(f32);
void fn_1_2024(omObjData*); void fn_1_2024(omObjData*);
double cos(double x);
double sin(double x);
//bss //bss
Process* lbl_1_bss_34; Process* lbl_1_bss_34;

View file

@ -5,6 +5,8 @@
#include "game/objsub.h" #include "game/objsub.h"
#include "game/chrman.h" #include "game/chrman.h"
#include "game/hsfman.h" #include "game/hsfman.h"
#include "math.h"
#include "rel_sqrt_consts.h" #include "rel_sqrt_consts.h"
#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0])) #define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0]))
@ -51,8 +53,6 @@ void fn_1_1074(omObjData* arg0);
void fn_1_11CC(omObjData* arg0); void fn_1_11CC(omObjData* arg0);
void fn_1_13E4(omObjData* arg0); void fn_1_13E4(omObjData* arg0);
void fn_1_1460(omObjData* arg0); void fn_1_1460(omObjData* arg0);
double cos(double x);
double sin(double x);
//bss //bss
Process* lbl_1_bss_18; Process* lbl_1_bss_18;

View file

@ -22,9 +22,6 @@
#include "dolphin.h" #include "dolphin.h"
#include "math.h" #include "math.h"
// TODO: required to match fn_1_3C9C. Can be removed once abs is removed from math.h.
#undef abs
typedef struct { typedef struct {
/* 0x00 */ char unk00[0x50]; /* 0x00 */ char unk00[0x50];
/* 0x50 */ u32 unk50; // pointer? /* 0x50 */ u32 unk50; // pointer?

View file

@ -9,6 +9,7 @@
#include "game/objsub.h" #include "game/objsub.h"
#include "game/gamework_data.h" #include "game/gamework_data.h"
#include "math.h" #include "math.h"
#include "stdlib.h"
typedef struct bit_copy { typedef struct bit_copy {
struct { struct {

View file

@ -22,6 +22,7 @@
#include "game/board/window.h" #include "game/board/window.h"
#include "math.h" #include "math.h"
#include "stdlib.h"
#define ABS(x) (((x) < 0) ? -(x) : (x)) #define ABS(x) (((x) < 0) ? -(x) : (x))

View file

@ -15,6 +15,8 @@
#include "game/board/basic_space.h" #include "game/board/basic_space.h"
#include "game/board/audio.h" #include "game/board/audio.h"
#include "game/pad.h" #include "game/pad.h"
#include "stdlib.h"
#include "math.h"
static void InitJunction(s32, s32, f32); static void InitJunction(s32, s32, f32);
static void UpdateJunctionGfx(omObjData*); static void UpdateJunctionGfx(omObjData*);