MSL_C header cleanup (#2988)

* msl_c header cleanup

* math header cleanup

* fix rest of shieldD configs

* cleanup cflag configs a bit

* fix shield build
This commit is contained in:
TakaRikka
2025-12-23 10:20:32 -08:00
committed by GitHub
parent 3feb1e9098
commit 46d53ab65f
281 changed files with 987 additions and 792 deletions
+1 -1
View File
@@ -8,7 +8,7 @@
#include "JSystem/JKernel/JKRExpHeap.h"
#include "JSystem/JKernel/JKRFileCache.h"
#include "JSystem/JUtility/JUTConsole.h"
#include "stdio.h"
#include <stdio.h>
#include "m_Do/m_Do_dvd_thread.h"
#include "m_Do/m_Do_ext.h"
+15 -15
View File
@@ -6,7 +6,7 @@
#include "JSystem/J2DGraph/J2DTevs.h"
#include "JSystem/J2DGraph/J2DMatBlock.h"
#include "math.h"
#include <math.h>
#include "dolphin/gx.h"
void J2DTexMtx::load(u32 mtxIdx) {
@@ -24,15 +24,15 @@ void J2DTexMtx::calc() {
void J2DTexMtx::getTextureMtx(J2DTextureSRTInfo const& param_0, Vec param_1, Mtx param_2) {
float f31 = (param_0.mRotationDeg * M_PI) / 180.0f;
param_2[0][0] = param_0.mScaleX * i_cosf(f31);
param_2[0][1] = -param_0.mScaleX * i_sinf(f31);
param_2[0][0] = param_0.mScaleX * cosf(f31);
param_2[0][1] = -param_0.mScaleX * sinf(f31);
param_2[0][2] = 0.0f;
param_2[0][3] = -param_0.mScaleX * i_cosf(f31) * param_1.x + param_1.y * (param_0.mScaleX * i_sinf(f31)) +
param_2[0][3] = -param_0.mScaleX * cosf(f31) * param_1.x + param_1.y * (param_0.mScaleX * sinf(f31)) +
param_1.x + param_0.mTranslationX;
param_2[1][0] = param_0.mScaleY * i_sinf(f31);
param_2[1][1] = param_0.mScaleY * i_cosf(f31);
param_2[1][0] = param_0.mScaleY * sinf(f31);
param_2[1][1] = param_0.mScaleY * cosf(f31);
param_2[1][2] = 0.0f;
param_2[1][3] = -param_0.mScaleY * i_sinf(f31) * param_1.x - param_1.y * (param_0.mScaleY * i_cosf(f31)) +
param_2[1][3] = -param_0.mScaleY * sinf(f31) * param_1.x - param_1.y * (param_0.mScaleY * cosf(f31)) +
param_1.y + param_0.mTranslationY;
param_2[2][0] = 0.0f;
param_2[2][1] = 0.0f;
@@ -42,16 +42,16 @@ void J2DTexMtx::getTextureMtx(J2DTextureSRTInfo const& param_0, Vec param_1, Mtx
void J2DTexMtx::getTextureMtxMaya(J2DTextureSRTInfo const& param_0, Mtx param_1) {
float f31 = (param_0.mRotationDeg * M_PI) / 180.0f;
param_1[0][0] = param_0.mScaleX * i_cosf(f31);
param_1[0][1] = param_0.mScaleY * i_sinf(f31);
param_1[0][0] = param_0.mScaleX * cosf(f31);
param_1[0][1] = param_0.mScaleY * sinf(f31);
param_1[0][2] = 0.0f;
param_1[0][3] = (param_0.mTranslationX - 0.5f) * i_cosf(f31) -
(param_0.mTranslationY - 0.5f + param_0.mScaleY) * i_sinf(f31) + 0.5f;
param_1[1][0] = -param_0.mScaleX * i_sinf(f31);
param_1[1][1] = param_0.mScaleY * i_cosf(f31);
param_1[0][3] = (param_0.mTranslationX - 0.5f) * cosf(f31) -
(param_0.mTranslationY - 0.5f + param_0.mScaleY) * sinf(f31) + 0.5f;
param_1[1][0] = -param_0.mScaleX * sinf(f31);
param_1[1][1] = param_0.mScaleY * cosf(f31);
param_1[1][2] = 0.0f;
param_1[1][3] = -(param_0.mTranslationX - 0.5f) * i_sinf(f31) -
(param_0.mTranslationY - 0.5f + param_0.mScaleY) * i_cosf(f31) + 0.5f;
param_1[1][3] = -(param_0.mTranslationX - 0.5f) * sinf(f31) -
(param_0.mTranslationY - 0.5f + param_0.mScaleY) * cosf(f31) + 0.5f;
param_1[2][0] = 0.0f;
param_1[2][1] = 0.0f;
param_1[2][2] = 1.0f;
+1 -1
View File
@@ -1,7 +1,7 @@
#include "JSystem/JSystem.h" // IWYU pragma: keep
#include "JSystem/J3DU/J3DUClipper.h"
#include "math.h"
#include <math.h>
void J3DUClipper::init() {
mNear = 1.0f;
+1 -1
View File
@@ -8,7 +8,7 @@
#include "JSystem/JAudio2/JASCalc.h"
#include "JSystem/JAudio2/JASMutex.h"
#include "JSystem/JKernel/JKRHeap.h"
#include "stdio.h"
#include <stdio.h>
static OSMutex sMutex;
+1 -1
View File
@@ -5,7 +5,7 @@
#include "JSystem/JAudio2/JASTaskThread.h"
#include "JSystem/JAudio2/JASMutex.h"
#include "JSystem/JKernel/JKRDvdAramRipper.h"
#include "cstring.h"
#include "string.h"
#include "dolphin/os.h"
#include <stdint.h>
+2 -5
View File
@@ -3,11 +3,8 @@
#include "JSystem/JHostIO/JHIMccBuf.h"
#include "JSystem/JKernel/JKRHeap.h"
#include "JSystem/JHostIO/JHIRMcc.h"
#include <dolphin/dolphin.h>
#include <cstring.h>
extern "C" int HIO2Read(u32, u32, void*, u32);
extern "C" int HIO2Write(u32, u32, void*, u32);
#include <revolution/hio2.h>
#include <string.h>
void JHIReport(const char* fmt, ...) {}
+4 -15
View File
@@ -1,20 +1,9 @@
#include "JSystem/JSystem.h" // IWYU pragma: keep
#include "JSystem/JHostIO/JHIMccBuf.h"
#include <revolution/hio2.h>
enum HIO2DeviceType {
DEVICE_INVALID = -1,
};
typedef BOOL (*HIO2EnumCallback)(HIO2DeviceType);
typedef void (*HIO2DisconnectCallback)(s32);
extern "C" BOOL HIO2Init();
extern "C" BOOL HIO2EnumDevices(HIO2EnumCallback);
extern "C" BOOL HIO2Close(s32);
extern "C" s32 HIO2Open(HIO2DeviceType, int, HIO2DisconnectCallback);
HIO2DeviceType gExiDevice = DEVICE_INVALID;
HIO2DeviceType gExiDevice = HIO2_DEVICE_INVALID;
u8 data_8074bd04 = 1;
s32 ghHIO2;
@@ -29,7 +18,7 @@ BOOL JHIhio2CallbackEnum(HIO2DeviceType type) {
}
void JHIhio2DisconnectCallback(s32) {
gExiDevice = DEVICE_INVALID;
gExiDevice = HIO2_DEVICE_INVALID;
}
u32 JHIInitInterface() {
@@ -45,7 +34,7 @@ u32 JHIInitInterface() {
data_8074bd04 = 0;
}
if (gExiDevice == DEVICE_INVALID) {
if (gExiDevice == HIO2_DEVICE_INVALID) {
return 0;
}
+1 -1
View File
@@ -7,7 +7,7 @@
#include "JSystem/JKernel/JKRDvdFile.h"
#include "JSystem/JUtility/JUTAssert.h"
#include "JSystem/JUtility/JUTException.h"
#include "math.h"
#include <math.h>
#include "string.h"
JKRAramArchive::JKRAramArchive(s32 entryNumber, JKRArchive::EMountDirection mountDirection)
+1 -1
View File
@@ -3,7 +3,7 @@
#include "JSystem/JKernel/JKRAramHeap.h"
#include "JSystem/JKernel/JKRHeap.h"
#include "global.h"
#include <limits.h>
#include <climits.h>
JSUList<JKRAramBlock> JKRAramHeap::sAramList;
+1 -1
View File
@@ -10,7 +10,7 @@
#include "JSystem/JKernel/JKRMemArchive.h"
#include "JSystem/JUtility/JUTAssert.h"
#include "JSystem/JUtility/JUTException.h"
#include "math.h"
#include <math.h>
#include "string.h"
#include <stdint.h>
+1 -1
View File
@@ -6,7 +6,7 @@
#include "JSystem/JKernel/JKRDvdRipper.h"
#include "JSystem/JUtility/JUTAssert.h"
#include "JSystem/JUtility/JUTException.h"
#include "math.h"
#include <math.h>
#include "string.h"
#include "global.h"
#include <stdint.h>
+1 -1
View File
@@ -3,7 +3,7 @@
#include "JSystem/JKernel/JKRThread.h"
#include "JSystem/JUtility/JUTAssert.h"
#include "JSystem/JUtility/JUTConsole.h"
#include "stdio.h"
#include <stdio.h>
#include "global.h"
#include <stdint.h>
+1 -1
View File
@@ -2,7 +2,7 @@
// don't include header until this "zero" mess is figured out
// #include "JSystem/JMath/JMATrigonometric.h"
#include "math.h"
#include <math.h>
#include "global.h"
static f32 dummy() {
+1 -1
View File
@@ -1,7 +1,7 @@
#include "JSystem/JSystem.h" // IWYU pragma: keep
#include "JSystem/JStage/JSGCamera.h"
#include "limits.h"
#include <limits.h>
JStage::TCamera::~TCamera() {}
+1 -1
View File
@@ -1,7 +1,7 @@
#include "JSystem/JSystem.h" // IWYU pragma: keep
#include "JSystem/JStage/JSGFog.h"
#include "limits.h"
#include <limits.h>
JStage::TFog::~TFog() {}
@@ -5,9 +5,9 @@
#include "JSystem/JUtility/JUTException.h"
#include "JSystem/JUtility/JUTAssert.h"
#include "JSystem/JGadget/linklist.h"
#include "math.h"
#include "stdlib.h"
#include "limits.h"
#include <math.h>
#include <stdlib.h>
#include <limits.h>
namespace JStudio {
+5 -5
View File
@@ -249,7 +249,7 @@ void TObject_transition::prepare_data_(const data::TParse_TParagraph::TData& rDa
ASSERT(rData.u32Type == data::PARAGRAPH_DATA);
u32 u32Size = rData.u32Size;
JUT_EXPECT(u32size == 8);
JGADGET_ASSERTWARN(0, u32Size == 8);
const f32* pContent = static_cast<const f32*>(rData.pContent);
ASSERT(pContent != NULL);
@@ -263,7 +263,7 @@ void TObject_list::prepare_data_(const data::TParse_TParagraph::TData& rData, TC
ASSERT(rData.u32Type == data::PARAGRAPH_DATA);
u32 u32Size = rData.u32Size;
JUT_EXPECT(u32size >= 8);
JGADGET_ASSERTWARN(0, u32Size >= 8);
const ListData* pContent = static_cast<const ListData*>(rData.pContent);
ASSERT(pContent != NULL);
@@ -280,7 +280,7 @@ void TObject_list_parameter::prepare_data_(const data::TParse_TParagraph::TData&
ASSERT(rData.u32Type == data::PARAGRAPH_DATA);
u32 u32Size = rData.u32Size;
JUT_EXPECT(u32size >= 8);
JGADGET_ASSERTWARN(0, u32Size >= 8);
const ListData* pContent = static_cast<const ListData*>(rData.pContent);
ASSERT(pContent != NULL);
@@ -295,7 +295,7 @@ void TObject_hermite::prepare_data_(const data::TParse_TParagraph::TData& rData,
ASSERT(rData.u32Type == data::PARAGRAPH_DATA);
u32 u32Size = rData.u32Size;
JUT_EXPECT(u32size >= 8);
JGADGET_ASSERTWARN(0, u32Size >= 8);
const ListData* pContent = static_cast<const ListData*>(rData.pContent);
ASSERT(pContent != NULL);
@@ -306,7 +306,7 @@ void TObject_hermite::prepare_data_(const data::TParse_TParagraph::TData& rData,
TControl::TControl() : pFactory(NULL) {}
TControl::~TControl() {
JUT_EXPECT(ocObject_.empty());
JGADGET_ASSERTWARN(0, ocObject_.empty());
}
void TControl::appendObject(TObject* object) {
+7 -7
View File
@@ -3,15 +3,15 @@
#include "JSystem/JStudio/JStudio/jstudio-math.h"
#include "JSystem/JGeometry.h"
#include "JSystem/TPosition3.h"
#include "math.h"
#include <math.h>
void JStudio::math::getRotation_xyz(MtxP param_1, f32 x, f32 y, f32 z) {
f32 cosx = i_cosf(DEG_TO_RAD(x));
f32 sinx = i_sinf(DEG_TO_RAD(x));
f32 cosy = i_cosf(DEG_TO_RAD(y));
f32 siny = i_sinf(DEG_TO_RAD(y));
f32 cosz = i_cosf(DEG_TO_RAD(z));
f32 sinz = i_sinf(DEG_TO_RAD(z));
f32 cosx = cosf(DEG_TO_RAD(x));
f32 sinx = sinf(DEG_TO_RAD(x));
f32 cosy = cosf(DEG_TO_RAD(y));
f32 siny = sinf(DEG_TO_RAD(y));
f32 cosz = cosf(DEG_TO_RAD(z));
f32 sinz = sinf(DEG_TO_RAD(z));
f32 cosxcosz = cosx * cosz;
f32 cosxsinz = cosx * sinz;
f32 sinxcosz = sinx * cosz;
+17 -17
View File
@@ -46,7 +46,7 @@ TObject::TObject(const data::TParse_TBlock_object& object)
pSequence_next(object.getContent()), u32Wait_(0), mStatus(STATUS_STILL) {}
TObject::~TObject() {
JUT_EXPECT(getControl() == NULL);
JGADGET_ASSERTWARN(0, getControl() == NULL);
}
void TObject::setFlag_operation(u8 op, int val) {
@@ -205,26 +205,26 @@ void TObject::process_sequence_() {
switch (type) {
case 0:
JUT_EXPECT(u32Value == 0);
JUT_EXPECT(pContent == NULL);
JGADGET_ASSERTWARN(0, u32Value == 0);
JGADGET_ASSERTWARN(0, pContent == NULL);
break;
case 1:
JUT_EXPECT(pContent == NULL);
JGADGET_ASSERTWARN(0, pContent == NULL);
setFlag_operation_(u32Value);
break;
case 2:
JUT_EXPECT(pContent == NULL);
JGADGET_ASSERTWARN(0, pContent == NULL);
setWait(u32Value);
break;
case 3: {
JUT_EXPECT(pContent == NULL);
JGADGET_ASSERTWARN(0, pContent == NULL);
s32 off = toInt32FromUInt24_(u32Value);
void* nextseq = (void*)getSequence_offset(off);
setSequence_next(nextseq);
break;
}
case 4: {
JUT_EXPECT(pContent == NULL);
JGADGET_ASSERTWARN(0, pContent == NULL);
u32 val = toInt32FromUInt24_(u32Value);
suspend(val);
break;
@@ -246,7 +246,7 @@ void TObject::process_sequence_() {
p = (void*)para_dat.next;
ASSERT(p != NULL);
}
JUT_EXPECT(p == pNext);
JGADGET_ASSERTWARN(0, p == pNext);
break;
}
default:
@@ -302,19 +302,19 @@ TControl::TControl() : _4(0), _8(0), pFactory(NULL), mObject_control(NULL, 0), _
TControl::~TControl() {
mObject_control.setControl_(NULL);
JUT_EXPECT(ocObject_.empty());
JGADGET_ASSERTWARN(0, ocObject_.empty());
}
void TControl::appendObject(TObject* p) {
p->setControl_(this);
mObjectContainer.Push_back(p);
ocObject_.Push_back(p);
}
void TControl::removeObject(TObject* p) {
ASSERT(p != NULL);
ASSERT(p->getControl() == this);
p->setControl_(NULL);
mObjectContainer.Erase(p);
ocObject_.Erase(p);
}
void TControl::destroyObject(TObject* p) {
@@ -324,15 +324,15 @@ void TControl::destroyObject(TObject* p) {
}
void TControl::destroyObject_all() {
while (!mObjectContainer.empty()) {
destroyObject(&mObjectContainer.back());
while (!ocObject_.empty()) {
destroyObject(&ocObject_.back());
}
}
// NONMATCHING - TPRObject_ID_equal copy issue
TObject* TControl::getObject(void const* param_0, u32 param_1) {
JGadget::TLinkList<TObject, -12>::iterator begin = mObjectContainer.begin();
JGadget::TLinkList<TObject, -12>::iterator end = mObjectContainer.end();
JGadget::TLinkList<TObject, -12>::iterator begin = ocObject_.begin();
JGadget::TLinkList<TObject, -12>::iterator end = ocObject_.end();
JGadget::TLinkList<TObject, -12>::iterator local_50 = std::find_if(begin, end, object::TPRObject_ID_equal(param_0, param_1));
if ((local_50 != end) != false) {
return &*local_50;
@@ -343,7 +343,7 @@ TObject* TControl::getObject(void const* param_0, u32 param_1) {
void TControl::reset() {
resetStatus_();
mObject_control.reset();
JGadget::TContainerEnumerator<JGadget::TLinkList<JStudio::stb::TObject, -12> > aTStack_18(mObjectContainer);
JGadget::TContainerEnumerator<JGadget::TLinkList<JStudio::stb::TObject, -12> > aTStack_18(ocObject_);
while (aTStack_18) {
(*aTStack_18).reset();
}
@@ -354,7 +354,7 @@ bool TControl::forward(u32 param_0) {
bool rv = mObject_control.forward(param_0);
int uVar7 = 0xf;
int uVar6 = 0;
JGadget::TContainerEnumerator<JGadget::TLinkList<JStudio::stb::TObject, -12> > aTStack_38(mObjectContainer);
JGadget::TContainerEnumerator<JGadget::TLinkList<JStudio::stb::TObject, -12> > aTStack_38(ocObject_);
while (aTStack_38) {
JStudio::stb::TObject& this_00 = *aTStack_38;
rv = this_00.forward(param_0) || rv;
@@ -93,12 +93,12 @@ void JStudio_JStage::TAdaptor_light::adaptor_do_update(u32 param_1) {
f32 dVar10 = adaptor_getVariableValue(10)->getValue();
f32 dVar11 = adaptor_getVariableValue(11)->getValue();
f32 temp = MTXDegToRad(dVar11);
f32 dVar12 = i_cosf(temp);
f32 sinVal = i_sinf(temp);
f32 dVar12 = cosf(temp);
f32 sinVal = sinf(temp);
f32 temp2 = MTXDegToRad(dVar10);
VStack_198.direction.x = dVar12 * i_sinf(temp2);
VStack_198.direction.x = dVar12 * sinf(temp2);
VStack_198.direction.y = sinVal;
VStack_198.direction.z = dVar12 * i_cosf(temp2);
VStack_198.direction.z = dVar12 * cosf(temp2);
break;
}
case 2:
+1 -1
View File
@@ -3,7 +3,7 @@
#include "JSystem/JSupport/JSUOutputStream.h"
#include "JSystem/JSupport/JSURandomOutputStream.h"
#include <dolphin/dolphin.h>
#include <cstring.h>
#include <string.h>
JSUOutputStream::~JSUOutputStream() {
if (!isGood()) {
+1 -1
View File
@@ -4,7 +4,7 @@
#include "JSystem/JUtility/JUTConsole.h"
#include "JSystem/JUtility/JUTDbPrint.h"
#include "JSystem/JUtility/JUTDirectPrint.h"
#include "stdio.h"
#include <stdio.h>
#include <dolphin/vi.h>
bool sAssertVisible = true;
+1 -1
View File
@@ -4,7 +4,7 @@
#include "JSystem/J2DGraph/J2DOrthoGraph.h"
#include "JSystem/JKernel/JKRHeap.h"
#include "JSystem/JUtility/JUTVideo.h"
#include "stdio.h"
#include <stdio.h>
JUTDbPrint::JUTDbPrint(JUTFont* pFont, JKRHeap* pHeap) {
mFont = pFont;
+1 -1
View File
@@ -1,7 +1,7 @@
#include "JSystem/JSystem.h" // IWYU pragma: keep
#include "JSystem/JUtility/JUTDirectPrint.h"
#include "stdio.h"
#include <stdio.h>
#include <dolphin/os.h>
#include "global.h"
@@ -1,39 +1,8 @@
#ifndef _STD_LIMITS_H
#define _STD_LIMITS_H
#ifndef _MSL_LIMITS_H
#define _MSL_LIMITS_H
#include "float.h"
#ifdef __cplusplus
extern "C" {
#endif
#define CHAR_BIT 8
#define SCHAR_MIN (-0x7F - 1)
#define SCHAR_MAX 0x7F
#define UCHAR_MAX 0xFF
#define CHAR_MIN 0
#define CHAR_MAX SCHAR_MAX
#define SHRT_MIN (-0x7FFF - 1)
#define SHRT_MAX 0x7FFF
#define USHRT_MAX 0xFFFF
#define INT_MIN (-0x7FFFFFFF - 1)
#define INT_MAX 0x7FFFFFFF
#define UINT_MAX 0xFFFFFFFF
#define LONG_MIN (-0x7FFFFFFFL - 1)
#define LONG_MAX 0x7FFFFFFFL
#define ULONG_MAX 0xFFFFFFFFUL
#define LLONG_MIN (-0x7FFFFFFFFFFFFFFFLL - 1)
#define LLONG_MAX 0x7FFFFFFFFFFFFFFFLL
#define ULLONG_MAX 0xFFFFFFFFFFFFFFFFULL
#ifdef __cplusplus
}
#include <climits.h>
#include <float.h>
namespace std {
template <typename T>
@@ -119,5 +88,5 @@ public:
#endif
} // namespace std
#endif
#endif
@@ -1,7 +1,7 @@
#ifndef _MSL_COMMON_FILE_POS_H
#define _MSL_COMMON_FILE_POS_H
#include "ansi_files.h"
#include <ansi_files.h>
#ifdef __cplusplus
extern "C" {
@@ -15,4 +15,4 @@ long ftell(FILE* file);
}
#endif
#endif /* _MSL_COMMON_FILE_POS_H */
#endif /* _MSL_COMMON_FILE_POS_H */
@@ -1,7 +1,6 @@
#ifndef _MSL_COMMON_ALLOC_H
#define _MSL_COMMON_ALLOC_H
#ifdef __cplusplus
extern "C" {
#endif
@@ -12,4 +11,4 @@ void free(void* ptr);
}
#endif
#endif /* _MSL_COMMON_ALLOC_H */
#endif /* _MSL_COMMON_ALLOC_H */
@@ -1,7 +1,7 @@
#ifndef _MSL_COMMON_ANSI_FILES_H
#define _MSL_COMMON_ANSI_FILES_H
#include "stddef.h"
#include <cstddef.h>
#ifdef __cplusplus
extern "C" {
@@ -13,9 +13,6 @@ extern "C" {
typedef unsigned long __file_handle;
typedef unsigned long fpos_t;
#ifndef __cplusplus
typedef unsigned short wchar_t;
#endif
#define set_error(file) \
do { \
@@ -126,4 +123,4 @@ void __close_all(void);
};
#endif
#endif /* _MSL_COMMON_ANSI_FILES_H */
#endif /* _MSL_COMMON_ANSI_FILES_H */
@@ -1,7 +1,6 @@
#ifndef _MSL_COMMON_ANSI_FP_H
#define _MSL_COMMON_ANSI_FP_H
#define SIGDIGLEN 36
typedef struct decimal {
@@ -21,15 +20,4 @@ typedef struct decform {
short digits;
} decform;
/* void __ull2dec(decimal*, u64);
void __timesdec(decimal*, const decimal*, const decimal*);
void __str2dec(decimal*, const char*, short);
void __two_exp(decimal*, s32);
BOOL __equals_dec(const decimal*, const decimal*);
BOOL __less_dec(const decimal*, const decimal*);
void __minus_dec(decimal*, const decimal*, const decimal*);
void __num2dec_internal(decimal*, f64);
void __num2dec(const decform*, f64, decimal*);
f64 __dec2num(const decimal*); */
#endif
#endif
@@ -1,11 +1,11 @@
#ifndef _MSL_COMMON_BUFFER_IO_H
#define _MSL_COMMON_BUFFER_IO_H
#include "ansi_files.h"
#include <cstdio.h>
enum { __align_buffer, __dont_align_buffer };
void __prep_buffer(FILE* file);
int __flush_buffer(FILE* file, size_t* bytes_flushed);
#endif /* _MSL_COMMON_BUFFER_IO_H */
#endif /* _MSL_COMMON_BUFFER_IO_H */
@@ -1,7 +1,7 @@
#ifndef _MSL_COMMON_CHAR_IO_H
#define _MSL_COMMON_CHAR_IO_H
#include "ansi_files.h"
#include <ansi_files.h>
#ifdef __cplusplus
extern "C" {
@@ -14,4 +14,4 @@ int __put_char(int c, FILE* stream);
}
#endif
#endif /* _MSL_COMMON_CHAR_IO_H */
#endif /* _MSL_COMMON_CHAR_IO_H */
@@ -0,0 +1,37 @@
#ifndef _MSL_CLIMITS_H
#define _MSL_CLIMITS_H
#ifdef __cplusplus
extern "C" {
#endif
#define CHAR_BIT 8
#define SCHAR_MIN (-0x7F - 1)
#define SCHAR_MAX 0x7F
#define UCHAR_MAX 0xFF
#define CHAR_MIN 0
#define CHAR_MAX SCHAR_MAX
#define SHRT_MIN (-0x7FFF - 1)
#define SHRT_MAX 0x7FFF
#define USHRT_MAX 0xFFFF
#define INT_MIN (-0x7FFFFFFF - 1)
#define INT_MAX 0x7FFFFFFF
#define UINT_MAX 0xFFFFFFFF
#define LONG_MIN (-0x7FFFFFFFL - 1)
#define LONG_MAX 0x7FFFFFFFL
#define ULONG_MAX 0xFFFFFFFFUL
#define LLONG_MIN (-0x7FFFFFFFFFFFFFFFLL - 1)
#define LLONG_MAX 0x7FFFFFFFFFFFFFFFLL
#define ULLONG_MAX 0xFFFFFFFFFFFFFFFFULL
#ifdef __cplusplus
}
#endif
#endif
@@ -1,60 +1,126 @@
#ifndef STD_CMATH_H_
#define STD_CMATH_H_
#ifndef MSL_CMATH_H_
#define MSL_CMATH_H_
namespace std {
template<typename T>
inline double fabs(T x) {
return ::fabs(x);
#include <float.h>
#define NAN (*(float*) __float_nan)
#define HUGE_VALF (*(float*) __float_huge)
#define M_PI 3.14159265358979323846f
#define M_SQRT3 1.73205f
#define DEG_TO_RAD(degrees) (degrees * (M_PI / 180.0f))
#define RAD_TO_DEG(radians) (radians * (180.0f / M_PI))
#ifdef __cplusplus
extern "C" {
#endif
extern double __frsqrte(double);
extern float __fres(float);
extern double __fabs(double);
extern float __fabsf(float);
int abs(int);
double acos(double);
float acosf(float);
double asin(double);
double atan(double);
double atan2(double, double);
double ceil(double);
double copysign(double, double);
double cos(double);
float cosf(float);
double exp(double);
double floor(double);
double fmod(double, double);
double frexp(double, int*);
double ldexp(double, int);
double modf(double, double*);
double pow(double, double);
float powf(float, float);
double sin(double);
float sinf(float);
double sqrt(double);
double tan(double);
float tanf(float);
inline float expf(float x) {
return exp(x);
}
inline float fabs(float num) {
return ::fabsf(num);
inline float ceilf(float num) {
return ceil(num);
}
inline float fabsf(float num) {
return ::fabsf(num);
inline double fabs(double f) {
return __fabs(f);
}
inline float sqrt(float x) {
return ::sqrtf(x);
inline float fabsf(float f) {
return (float)fabs((double)f);
}
inline float abs(float x) {
return ::fabsf(x);
inline float floorf(float num) {
return floor(num);
}
inline float fmod(float x, float y) {
return ::fmod(x, y);
inline float fmodf(float f1, float f2) {
return fmod(f1, f2);
}
inline float ceil(float num) {
return ::ceilf(num);
#include "global.h"
#if PLATFORM_WII || PLATFORM_SHIELD
inline float sqrtf(float mag) {
return sqrt(mag);
}
#else
#ifdef DECOMPCTX
// Hack to mitigate fake mismatches when building from decompctx output
// (which doesn't support precompiled headers).
//
// When built without a PCH, these constants would end up .rodata instead of .data
// which causes a variety of knock-on effects in individual functions' assembly.
//
// Making them into globals is a bit of a hack, but it generally fixes later
// .data and .rodata offsets and allows individual functions to match.
static double _half = 0.5;
static double _three = 3.0;
#endif
inline float sqrtf(float mag) {
#ifndef DECOMPCTX
// part of the same hack, these are defined outside of the function when using decompctx
static const double _half = 0.5;
static const double _three = 3.0;
#endif
if (mag > 0.0f) {
double dmag = (double)mag;
double tmpd = __frsqrte(dmag);
tmpd = _half * tmpd * (_three - tmpd * tmpd * dmag);
tmpd = _half * tmpd * (_three - tmpd * tmpd * dmag);
tmpd = _half * tmpd * (_three - tmpd * tmpd * dmag);
return (float)(dmag * tmpd);
} else if (mag < 0.0) {
return NAN;
} else if (isnan(mag)) {
return NAN;
} else {
return mag;
}
}
#endif
inline float atan2f(float y, float x) {
return (float)atan2(y, x);
}
inline float floor(float num) {
return ::floorf(num);
}
inline float sinf(float x) { return sin(x); }
inline float cosf(float x) { return cos(x); }
inline float tanf(float x) { return tan(x); }
inline float acosf(float x) { return acos(x); }
inline float tan(float num) {
return ::i_tanf(num);
}
inline float tanf(float num) {
return ::i_tanf(num);
}
inline float acos(float num) {
return ::acosf(num);
}
inline float pow(float x, float y) {
return ::pow(x, y);
}
inline float pow(float x, int y) {
// FIXME: Needs to use powf
return ::pow(x, y);
}
} // namespace std
#ifdef __cplusplus
};
#endif
#endif
@@ -0,0 +1,6 @@
#ifndef _MSL_CSTDARG_H_
#define _MSL_CSTDARG_H_
#include <va_list.h>
#endif
@@ -0,0 +1,25 @@
#ifndef _MSL_CSTDDEF_H_
#define _MSL_CSTDDEF_H_
#ifdef __cplusplus
extern "C" {
#endif
#define offsetof(type, member) ((size_t)&(((type*)0)->member))
#ifndef NULL
#define NULL 0
#endif
typedef unsigned long size_t;
typedef long ptrdiff_t;
#ifndef __cplusplus
typedef unsigned short wchar_t;
#endif
#ifdef __cplusplus
};
#endif
#endif
@@ -0,0 +1,16 @@
#ifndef MSL_CSTDIO_H_
#define MSL_CSTDIO_H_
#include <char_io.h>
#include <file_io.h>
#include <printf.h>
#include <extras.h>
#include <scanf.h>
#include <va_list.h>
#include <cstddef.h>
#define stdin (&__files._stdin)
#define stdout (&__files._stdout)
#define stderr (&__files._stderr)
#endif
@@ -0,0 +1,8 @@
#ifndef MSL_CSTDLIB_H_
#define MSL_CSTDLIB_H_
#include <abort_exit.h>
#include <arith.h>
#include <strtoul.h>
#endif
@@ -1,23 +1,31 @@
#ifndef STD_CSTRING_H_
#define STD_CSTRING_H_
#ifndef _MSL_CSTRING_H
#define _MSL_CSTRING_H
#include "string.h"
namespace std {
using ::strlen;
using ::strcpy;
using ::wcslen;
using ::strncpy;
using ::strcmp;
using ::strncmp;
using ::strcat;
using ::memset;
using ::memcpy;
inline char* strchr(char* str, int c) {
return ::strchr(str, c);
}
}; // namespace std
#include <cstddef.h>
#include <ansi_files.h>
#include <extras.h>
#ifdef __cplusplus
extern "C" {
#endif
void* memcpy(void* dst, const void* src, size_t n);
void* memset(void* dst, int val, size_t n);
int memcmp(const void* lhs, const void* rhs, size_t count);
void* __memrchr(const void* ptr, int ch, size_t count);
void* memchr(const void* ptr, int ch, size_t count);
void* memmove(void* dst, const void* src, size_t n);
char* strrchr(const char* str, int c);
char* strchr(const char* str, int c);
int strncmp(const char* str1, const char* str2, size_t n);
int strcmp(const char* str1, const char* str2);
char* strcat(char* dst, const char* src);
char* strncpy(char* dst, const char* src, size_t n);
char* strcpy(char* dst, const char* src);
size_t strlen(const char* str);
#ifdef __cplusplus
};
#endif
#endif /* _MSL_COMMON_STRING_H */
@@ -1,7 +1,7 @@
#ifndef _MSL_COMMON_DIRECT_IO_H
#define _MSL_COMMON_DIRECT_IO_H
#include "ansi_files.h"
#include <ansi_files.h>
#ifdef __cplusplus
extern "C" {
@@ -14,4 +14,4 @@ size_t fwrite(const void* buffer, size_t size, size_t count, FILE* stream);
}
#endif
#endif /* _MSL_COMMON_DIRECT_IO_H */
#endif /* _MSL_COMMON_DIRECT_IO_H */
@@ -1,15 +1,18 @@
#ifndef _MSL_COMMON_EXTRAS_H
#define _MSL_COMMON_EXTRAS_H
#include <cstddef.h>
#ifdef __cplusplus
extern "C" {
#endif
int strnicmp(const char* str1, const char* str2, int n);
int stricmp(const char* str1, const char* str2);
size_t wcslen(const wchar_t* s);
#ifdef __cplusplus
}
#endif
#endif /* _MSL_COMMON_EXTRAS_H */
#endif /* _MSL_COMMON_EXTRAS_H */
@@ -1,7 +1,7 @@
#ifndef _MSL_COMMON_FILE_IO_H
#define _MSL_COMMON_FILE_IO_H
#include "ansi_files.h"
#include <ansi_files.h>
#ifdef __cplusplus
extern "C" {
@@ -15,4 +15,4 @@ int fclose(FILE* file);
}
#endif
#endif /* _MSL_COMMON_FILE_IO_H */
#endif /* _MSL_COMMON_FILE_IO_H */
@@ -1,7 +1,7 @@
#ifndef _MSL_COMMON_FLOAT_H
#define _MSL_COMMON_FLOAT_H
#include "fdlibm.h"
#include <fdlibm.h>
#define FP_SNAN 0
#define FP_QNAN 1
@@ -1,130 +1,62 @@
#ifndef MSL_MATH_H_
#define MSL_MATH_H_
#include "global.h"
#include "float.h"
#include <cmath.h>
#define NAN (*(float*) __float_nan)
#define HUGE_VALF (*(float*) __float_huge)
#define M_PI 3.14159265358979323846f
#define M_SQRT3 1.73205f
#define DEG_TO_RAD(degrees) (degrees * (M_PI / 180.0f))
#define RAD_TO_DEG(radians) (radians * (180.0f / M_PI))
#ifdef __cplusplus
extern "C" {
#endif
int abs(int);
double acos(double);
float acosf(float);
double asin(double);
double atan(double);
double atan2(double, double);
double ceil(double);
inline float ceilf(float num) {
return ceil(num);
namespace std {
template<typename T>
inline double fabs(T x) {
return ::fabs(x);
}
double copysign(double, double);
double cos(double);
float cosf(float);
double exp(double);
inline float expf(float x) {
return exp(x);
inline float fabs(float num) {
return ::fabsf(num);
}
extern double __frsqrte(double);
extern float __fres(float);
extern double __fabs(double);
extern float __fabsf(float);
inline double fabs(double f) {
return __fabs(f);
}
inline double fabsf2(float f) {
return __fabsf(f);
}
inline float fabsf(float f) {
return fabsf2(f);
inline float fabsf(float num) {
return ::fabsf(num);
}
double floor(double);
inline float floorf(float num) {
return floor(num);
inline float sqrt(float x) {
return ::sqrtf(x);
}
double fmod(double, double);
inline float fmodf(float f1, float f2) {
return fmod(f1, f2);
inline float abs(float x) {
return ::fabsf(x);
}
double frexp(double, int*);
double ldexp(double, int);
double modf(double, double*);
double pow(double, double);
float powf(float, float);
double sin(double);
float sinf(float);
double sqrt(double);
double tan(double);
float tanf(float);
#if PLATFORM_WII || PLATFORM_SHIELD
inline float sqrtf(float mag) {
return sqrt(mag);
}
#else
#ifdef DECOMPCTX
// Hack to mitigate fake mismatches when building from decompctx output
// (which doesn't support precompiled headers).
//
// When built without a PCH, these constants would end up .rodata instead of .data
// which causes a variety of knock-on effects in individual functions' assembly.
//
// Making them into globals is a bit of a hack, but it generally fixes later
// .data and .rodata offsets and allows individual functions to match.
static double _half = 0.5;
static double _three = 3.0;
#endif
inline float sqrtf(float mag) {
#ifndef DECOMPCTX
// part of the same hack, these are defined outside of the function when using decompctx
static const double _half = 0.5;
static const double _three = 3.0;
#endif
if (mag > 0.0f) {
double dmag = (double)mag;
double tmpd = __frsqrte(dmag);
tmpd = _half * tmpd * (_three - tmpd * tmpd * dmag);
tmpd = _half * tmpd * (_three - tmpd * tmpd * dmag);
tmpd = _half * tmpd * (_three - tmpd * tmpd * dmag);
return (float)(dmag * tmpd);
} else if (mag < 0.0) {
return NAN;
} else if (isnan(mag)) {
return NAN;
} else {
return mag;
}
}
#endif
inline float atan2f(float y, float x) {
return (float)atan2(y, x);
inline float fmod(float x, float y) {
return ::fmod(x, y);
}
inline float i_sinf(float x) { return sin(x); }
inline float i_cosf(float x) { return cos(x); }
inline float i_tanf(float x) { return tan(x); }
inline float i_acosf(float x) { return acos(x); }
inline float ceil(float num) {
return ::ceilf(num);
}
#ifdef __cplusplus
};
#endif
inline float floor(float num) {
return ::floorf(num);
}
inline float tan(float num) {
return ::tanf(num);
}
inline float tanf(float num) {
return ::tanf(num);
}
inline float acos(float num) {
return ::acosf(num);
}
inline float pow(float x, float y) {
return ::pow(x, y);
}
inline float pow(float x, int y) {
// FIXME: Needs to use powf
return ::pow(x, y);
}
} // namespace std
#endif
@@ -1,7 +1,7 @@
#ifndef _MSL_COMMON_MBSTRING_H
#define _MSL_COMMON_MBSTRING_H
#include "wchar_io.h"
#include <wchar_io.h>
#ifdef __cplusplus
extern "C" {
@@ -13,4 +13,4 @@ size_t wcstombs(char* dst, const wchar_t* src, size_t n);
}
#endif
#endif /* _MSL_COMMON_MBSTRING_H */
#endif /* _MSL_COMMON_MBSTRING_H */
@@ -1,7 +1,7 @@
#ifndef _MSL_COMMON_MEM_FUNCS_H
#define _MSL_COMMON_MEM_FUNCS_H
#include "stddef.h"
#include <cstddef.h>
#ifdef __cplusplus
extern "C" {
@@ -16,4 +16,4 @@ void __copy_longs_aligned(void* dst, const void* src, size_t n);
}
#endif
#endif /* _MSL_COMMON_MEM_FUNCS_H */
#endif /* _MSL_COMMON_MEM_FUNCS_H */
@@ -1,8 +1,8 @@
#ifndef _MSL_COMMON_PRINTF_H
#define _MSL_COMMON_PRINTF_H
#include "ansi_files.h"
#include "__va_arg.h"
#include <ansi_files.h>
#include <cstdarg.h>
#ifdef __cplusplus
extern "C" {
@@ -18,13 +18,6 @@ int vprintf(const char* format, va_list arg);
int vswprintf(wchar_t* s, size_t n, const wchar_t* format, va_list arg);
#if defined(__cplusplus)
namespace std {
extern "C" { using ::vsnprintf; }
extern "C" { using ::vswprintf; }
}
#endif
#ifdef __cplusplus
}
#endif
@@ -1,7 +1,7 @@
#ifndef _MSL_COMMON_SCANF_H
#define _MSL_COMMON_SCANF_H
#include "ansi_files.h"
#include <ansi_files.h>
#ifdef __cplusplus
extern "C" {
@@ -0,0 +1,18 @@
#ifndef _MSL_STDARG_H_
#define _MSL_STDARG_H_
#include <cstdarg.h>
#ifdef __cplusplus
extern "C" {
#endif
namespace std {
using ::va_list;
}
#ifdef __cplusplus
};
#endif
#endif
@@ -1,23 +1,16 @@
#ifndef _STDDEF_H_
#define _STDDEF_H_
#ifndef _MSL_STDDEF_H_
#define _MSL_STDDEF_H_
#include <cstddef.h>
#ifdef __cplusplus
extern "C" {
#endif
#if defined __INTELLISENSE__
typedef unsigned int size_t;
typedef int ptrdiff_t;
#else
typedef unsigned long size_t;
typedef long ptrdiff_t;
#endif
#define offsetof(type, member) ((size_t)&(((type*)0)->member))
#ifndef NULL
#define NULL (0)
#endif
namespace std {
using ::ptrdiff_t;
using ::size_t;
}
#ifdef __cplusplus
};
@@ -1,14 +1,30 @@
#ifndef MSL_STDIO_H_
#define MSL_STDIO_H_
#include "char_io.h"
#include "file_io.h"
#include "printf.h"
#include "extras.h"
#include "scanf.h"
#include <cstdio.h>
#include <stddef.h>
#include <stdarg.h>
#define stdin (&__files._stdin)
#define stdout (&__files._stdout)
#define stderr (&__files._stderr)
#ifdef __cplusplus
extern "C" {
#endif
namespace std {
using ::fputs;
using ::fflush;
using ::fclose;
using ::fprintf;
using ::printf;
using ::sprintf;
using ::snprintf;
using ::vsnprintf;
using ::vprintf;
using ::vswprintf;
using ::sscanf;
}
#ifdef __cplusplus
};
#endif
#endif
@@ -1,8 +1,24 @@
#ifndef MSL_STDLIB_H_
#define MSL_STDLIB_H_
#ifndef _MSL_STDLIB_H_
#define _MSL_STDLIB_H_
#include "abort_exit.h"
#include "arith.h"
#include "strtoul.h"
#include <cstdlib.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
namespace std {
using ::strtol;
using ::strtoul;
using ::div;
using ::exit;
using ::abort;
using ::atoi;
using ::atof;
}
#ifdef __cplusplus
};
#endif
#endif
@@ -1,32 +1,30 @@
#ifndef _MSL_COMMON_STRING_H
#define _MSL_COMMON_STRING_H
#ifndef MSL_STRING_H_
#define MSL_STRING_H_
#include "stddef.h"
#include "ansi_files.h"
#include <cstring.h>
namespace std {
using ::memcpy;
using ::memset;
using ::memcmp;
using ::memchr;
using ::memmove;
using ::strrchr;
using ::strlen;
using ::strncmp;
using ::strcmp;
using ::strcat;
using ::strncpy;
using ::strcpy;
using ::strnicmp;
using ::stricmp;
using ::wcslen;
inline char* strchr(char* str, int c) {
return ::strchr(str, c);
}
}; // namespace std
#ifdef __cplusplus
extern "C" {
#endif
void* memcpy(void* dst, const void* src, size_t n);
void* memset(void* dst, int val, size_t n);
int memcmp(const void* lhs, const void* rhs, size_t count);
void* __memrchr(const void* ptr, int ch, size_t count);
void* memchr(const void* ptr, int ch, size_t count);
void* memmove(void* dst, const void* src, size_t n);
char* strrchr(const char* str, int c);
char* strchr(const char* str, int c);
int strncmp(const char* str1, const char* str2, size_t n);
int strcmp(const char* str1, const char* str2);
char* strcat(char* dst, const char* src);
char* strncpy(char* dst, const char* src, size_t n);
char* strcpy(char* dst, const char* src);
size_t strlen(const char* str);
size_t wcslen(const wchar_t* s);
#ifdef __cplusplus
};
#endif
#endif /* _MSL_COMMON_STRING_H */
@@ -9,9 +9,11 @@ long strtol(const char* str, char** end, int base);
unsigned long strtoul(const char* str, char** end, int base);
unsigned long __strtoul(int base, int max_width, int (*ReadProc)(void*, int, int), void* ReadProcArg, int* chars_scanned, int* negative,
int* overflow);
int atoi(const char* str);
float atof(const char* str);
#ifdef __cplusplus
}
#endif
#endif /* _MSL_COMMON_STRTOUL_H */
#endif /* _MSL_COMMON_STRTOUL_H */
@@ -1,5 +1,5 @@
#ifndef __VA_ARG_H
#define __VA_ARG_H
#ifndef MSL_VA_LIST_H
#define MSL_VA_LIST_H
#ifdef __cplusplus
extern "C" {
@@ -35,10 +35,6 @@ void* __va_arg(_va_list_struct*, int);
#define __va_copy(a, b) (*(a) = *(b))
#if defined(__cplusplus)
namespace std { extern "C" { using ::va_list; } }
#endif
#ifdef __cplusplus
}
#endif
@@ -1,12 +1,8 @@
#ifndef _MSL_COMMON_WCHAR_IO_H
#define _MSL_COMMON_WCHAR_IO_H
#include "ansi_files.h"
#ifndef __cplusplus
typedef unsigned short wchar_t;
#endif
#include <ansi_files.h>
int fwide(FILE* file, int mode);
#endif /* _MSL_COMMON_WCHAR_IO_H */
#endif /* _MSL_COMMON_WCHAR_IO_H */
@@ -1,6 +1,6 @@
#include "abort_exit.h"
#include "critical_regions.h"
#include "stddef.h"
#include "cstddef.h"
extern void (*_dtors[])(void);
@@ -1,6 +1,6 @@
#include "alloc.h"
#include "critical_regions.h"
#include <string.h>
#include <cstring.h>
typedef struct Block {
struct Block* prev;
@@ -1,5 +1,5 @@
#include "mbstring.h"
#include "string.h"
#include "cstring.h"
inline static int unicode_to_UTF8(char* s, wchar_t wchar) {
int number_of_bytes;
@@ -1,4 +1,4 @@
#include "string.h"
#include "cstring.h"
void* memmove(void* dst, const void* src, size_t n) {
unsigned char* csrc;
@@ -3,8 +3,8 @@
#include "critical_regions.h"
#include "ctype.h"
#include "scanf.h"
#include "stdio.h"
#include "string.h"
#include "cstdio.h"
#include "cstring.h"
#include "wchar_io.h"
#define TARGET_FLOAT_BITS 64
@@ -1,4 +1,4 @@
#include "string.h"
#include "cstring.h"
#define K1 0x80808080
#define K2 0xFEFEFEFF
@@ -1,7 +1,7 @@
#include "strtoul.h"
#include "ctype.h"
#include "errno.h"
#include "limits.h"
#include "climits.h"
#include "scanf.h"
enum scan_states {
@@ -34,7 +34,7 @@
* Function needed: sqrt
*/
#include "math.h"
#include "cmath.h"
#ifdef __STDC__
static const double
@@ -101,4 +101,4 @@ qS4 = 7.70381505559019352791e-02; /* 0x3FB3B8C5, 0xB12E9282 */
w = r*s+c;
return 2.0*(df+w);
}
}
}
@@ -40,7 +40,7 @@
*
*/
#include "math.h"
#include "cmath.h"
#ifdef __STDC__
static const double
@@ -112,4 +112,4 @@ double __ieee754_asin(x) double x;
return t;
else
return -t;
}
}
@@ -112,7 +112,7 @@
#include "types.h"
#include "errno.h"
#include "math.h"
#include "cmath.h"
#ifndef _DOUBLE_IS_32BITS
@@ -404,4 +404,4 @@ double __ieee754_pow(x, y) double x, y;
#endif /* defined(_DOUBLE_IS_32BITS) */
// EOF e_pow.c
// EOF e_pow.c
@@ -17,7 +17,7 @@
* use __kernel_rem_pio2()
*/
#include "math.h"
#include "cmath.h"
/*
* Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi
@@ -176,4 +176,4 @@ int __ieee754_rem_pio2(x, y) double x, y[];
return -n;
}
return n;
}
}
@@ -81,7 +81,7 @@
*/
#include "errno.h"
#include "math.h"
#include "cmath.h"
#ifdef __STDC__
static const double one = 1.0, tiny = 1.0e-300;
@@ -458,4 +458,4 @@ B. sqrt(x) by Reciproot Iteration
(4) Special cases (see (4) of Section A).
*/
*/
@@ -99,7 +99,7 @@
* = 1 - 2*(tan(y) - (tan(y)^2)/(1+tan(y)))
*/
#include "math.h"
#include "cmath.h"
static const double one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
pio4 = 7.85398163397448278999e-01, /* 0x3FE921FB, 0x54442D18 */
pio4lo = 3.06161699786838301793e-17, /* 0x3C81A626, 0x33145C07 */
@@ -177,4 +177,4 @@ double __kernel_tan(double x, double y, int iy)
}
}
// EOF k_tan.c
// EOF k_tan.c
@@ -11,7 +11,7 @@
* ====================================================
*/
#include "math.h" /* for isfinite macro */
#include "cmath.h" /* for isfinite macro */
static const double
two54
@@ -55,4 +55,4 @@ double ldexp(double x, int n)
k += 54; /* subnormal result */
__HI(x) = (hx & 0x800fffff) | (k << 20);
return x * twom54;
}
}
@@ -1,6 +1,6 @@
#include "ansi_fp.h"
#include "ansi_fp.h"
#include "limits.h"
#include "climits.h"
#include "float.h"
static int __count_trailing_zerol(unsigned long x) {
@@ -1,7 +1,7 @@
#ifndef MWCPLUSLIB_H
#define MWCPLUSLIB_H
#include <stddef.h>
#include <cstddef.h>
#ifdef __cplusplus
extern "C" {
@@ -1,5 +1,5 @@
#include "__va_arg.h"
#include <stdint.h>
#include <cstdarg.h>
#include <cstdint.h>
#undef __va_arg
+1 -1
View File
@@ -5,7 +5,7 @@
#include "SSystem/SComponent/c_math.h"
#include "SSystem/SComponent/c_m3d.h"
#include <cmath.h>
#include <math.h>
s16 cM_rad2s(f32 rad) {
s32 s = (std::fmod(rad, 2 * M_PI) * (0x8000 / M_PI));
@@ -4,7 +4,6 @@
#include "TRK_MINNOW_DOLPHIN/ppc/Generic/targimpl.h"
#include <dolphin/ar.h>
#include "global.h"
#include "__ar.h"
extern u32 _db_stack_addr;
@@ -2,7 +2,7 @@
#include "TRK_MINNOW_DOLPHIN/MetroTRK/Portable/nubevent.h"
#include "TRK_MINNOW_DOLPHIN/utils/common/MWTrace.h"
#include "trk.h"
#include <string.h>
#include <cstring.h>
static BOOL IsTRKConnected;
@@ -1,7 +1,7 @@
#include "TRK_MINNOW_DOLPHIN/MetroTRK/Portable/support.h"
#include "TRK_MINNOW_DOLPHIN/utils/common/MWTrace.h"
#include "TRK_MINNOW_DOLPHIN/MetroTRK/Portable/msgbuf.h"
#include <string.h>
#include <cstring.h>
DSError TRKSuppAccessFile(u32 file_handle, u8* data, size_t* count, DSIOResult* io_result,
BOOL need_reply, BOOL read) {
@@ -1,7 +1,7 @@
#include "TRK_MINNOW_DOLPHIN/ppc/Generic/targimpl.h"
#include "TRK_MINNOW_DOLPHIN/utils/common/MWTrace.h"
#include <stdint.h>
#include <string.h>
#include <cstring.h>
typedef struct memRange {
u8* start;
+1 -1
View File
@@ -16,7 +16,7 @@
#include "JSystem/J3DGraphBase/J3DMaterial.h"
#include "SSystem/SComponent/c_math.h"
#include "c/c_damagereaction.h"
#include "cmath.h"
#include <math.h>
enum B_bq_RES_File_ID {
/* BCK */
+1 -1
View File
@@ -6,7 +6,7 @@
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/actor/d_a_b_tn.h"
#include <cmath.h>
#include <math.h>
#include "Z2AudioLib/Z2Instances.h"
#include "d/actor/d_a_boomerang.h"
#include "d/actor/d_a_nbomb.h"
+1 -1
View File
@@ -17,7 +17,7 @@
#include "SSystem/SComponent/c_math.h"
#include "Z2AudioLib/Z2Instances.h"
#include "JSystem/JAudio2/JAUSectionHeap.h"
#include <cmath.h>
#include <math.h>
enum Joint {
/* 0x00 */ JNT_CENTER,
+1 -1
View File
@@ -10,7 +10,7 @@
#include "d/d_com_inf_game.h"
#include "d/actor/d_a_player.h"
#include "SSystem/SComponent/c_math.h"
#include <cmath.h>
#include <math.h>
int daB_ZANTM_c::draw() {
g_env_light.settingTevStruct(0, &current.pos, &tevStr);
+1 -1
View File
@@ -11,7 +11,7 @@
#include "d/d_cc_uty.h"
#include "d/actor/d_a_player.h"
#include "SSystem/SComponent/c_math.h"
#include <cmath.h>
#include <math.h>
namespace {
dCcD_SrcSph cc_zant_src = {
+1 -1
View File
@@ -7,7 +7,7 @@
#include "d/actor/d_a_bg_obj.h"
#include "JSystem/J3DGraphBase/J3DMaterial.h"
#include "stdio.h"
#include <stdio.h>
#include "dolphin/os.h"
#include "d/actor/d_a_set_bgobj.h"
#include "d/d_s_play.h"
+1 -1
View File
@@ -9,7 +9,7 @@
#include "d/actor/d_a_player.h"
#include "d/d_com_inf_game.h"
#include "d/d_s_play.h"
#include <cmath.h>
#include <math.h>
#define ACTION_MODE_WAIT 0
#define ACTION_MODE_CHASE 1
+1 -1
View File
@@ -9,7 +9,7 @@
#include "f_op/f_op_actor_enemy.h"
#include "f_op/f_op_camera_mng.h"
#include "d/d_bomb.h"
#include <cmath.h>
#include <math.h>
#include "Z2AudioLib/Z2Instances.h"
class daE_SW_HIO_c {
+1 -1
View File
@@ -9,7 +9,7 @@
#include "JSystem/J3DGraphBase/J3DMaterial.h"
#include "SSystem/SComponent/c_math.h"
#include "c/c_damagereaction.h"
#include "cmath.h"
#include <math.h>
#include "d/actor/d_a_player.h"
#include "d/d_com_inf_game.h"
#include "d/d_s_play.h"
+1 -1
View File
@@ -7,7 +7,7 @@
#include "d/actor/d_a_e_ws.h"
#include "d/actor/d_a_obj_carry.h"
#include <cmath.h>
#include <math.h>
#include "f_op/f_op_actor_enemy.h"
class daE_WS_HIO_c : public JORReflexible {
+1 -1
View File
@@ -11,7 +11,7 @@
#include "d/actor/d_a_player.h"
#include "d/d_com_inf_game.h"
#include "f_op/f_op_camera_mng.h"
#include <cmath.h>
#include <math.h>
#include "Z2AudioLib/Z2Instances.h"
struct daE_YMB_HIO_c {
+1 -1
View File
@@ -17,7 +17,7 @@
#include "SSystem/SComponent/c_math.h"
#include "Z2AudioLib/Z2Instances.h"
#include "JSystem/JAudio2/JAUSectionHeap.h"
#include <cmath.h>
#include <math.h>
#define ANM_HS_BACK_WALK 6
#define ANM_HS_WALK_START 7
+1 -1
View File
@@ -10,7 +10,7 @@
#include "d/d_com_inf_game.h"
#include "d/d_msg_object.h"
#include <cmath.h>
#include <math.h>
#include "d/actor/d_a_balloon_2D.h"
#include "d/actor/d_a_e_ym.h"
+1 -1
View File
@@ -22,7 +22,7 @@
#include "c/c_damagereaction.h"
#include "SSystem/SComponent/c_counter.h"
#include "Z2AudioLib/Z2Instances.h"
#include <cmath.h>
#include <math.h>
class dmg_rod_HIO_c : public JORReflexible {
public:
+1 -1
View File
@@ -322,7 +322,7 @@ void dMirror_packet_c::mainDraw() {
}
f32 aspect = view->aspect;
f32 temp_f0_2 = i_tanf(MTXDegToRad(view->fovy * 0.5f));
f32 temp_f0_2 = tanf(MTXDegToRad(view->fovy * 0.5f));
view_port_class* view_port = dComIfGd_getViewport();
f32 var_f3;
+1 -1
View File
@@ -11,7 +11,7 @@
#include "SSystem/SComponent/c_m3d_g_pla.h"
#include "Z2AudioLib/Z2Instances.h"
#include "c/c_damagereaction.h"
#include "cmath.h"
#include <math.h>
#include "d/actor/d_a_alink.h"
#include "d/actor/d_a_canoe.h"
#include "d/actor/d_a_mg_fshop.h"
+1 -1
View File
@@ -11,7 +11,7 @@
#include "d/d_com_inf_game.h"
#include "d/d_s_play.h"
#include "d/actor/d_a_player.h"
#include <cmath.h>
#include <math.h>
void daObjBhbridge_c::RideOn_Angle(s16& param_1, f32 param_2, s16 param_3, f32 param_4) {
cLib_addCalcAngleS(&param_1, param_3 * (param_2 / param_4), 1, 0x100, 1);
+1 -1
View File
@@ -7,7 +7,7 @@
#include "d/actor/d_a_obj_carry.h"
#include "d/actor/d_a_player.h"
#include <cmath.h>
#include <math.h>
#include "d/d_com_inf_game.h"
#include "SSystem/SComponent/c_math.h"
#include "d/actor/d_a_obj_swBallA.h"
+1 -1
View File
@@ -12,7 +12,7 @@
#include "Z2AudioLib/Z2Instances.h"
#include "d/d_cc_d.h"
#include "d/d_com_inf_game.h"
#include "cmath.h"
#include <math.h>
void daObjCwall_c::initBaseMtx() {
mWallModel->setBaseScale(scale);
+1 -1
View File
@@ -8,7 +8,7 @@
#include "d/actor/d_a_obj_digsnow.h"
#include "d/actor/d_a_player.h"
#include "d/d_com_inf_game.h"
#include <cmath.h>
#include <math.h>
void daObjDigSnow_c::initBaseMtx() {
mpModel->setBaseScale(scale);
+1 -1
View File
@@ -7,7 +7,7 @@
#include "d/actor/d_a_obj_drop.h"
#include "SSystem/SComponent/c_math.h"
#include "cmath.h"
#include <math.h>
#include "d/actor/d_a_player.h"
#include "d/d_com_inf_game.h"
#include "d/d_camera.h"
+1 -1
View File
@@ -1,7 +1,7 @@
#include "d/actor/d_a_obj_gra2.h"
#include "d/d_camera.h"
#include "d/actor/d_a_tag_gra.h"
#include <cmath.h>
#include <math.h>
f32 daObj_GrA_c::getSrchCircleR() {
f32 srchCircleR;
+1 -1
View File
@@ -12,7 +12,7 @@
#include "d/actor/d_a_player.h"
#include "d/d_procname.h"
#include "d/d_s_play.h"
#include <cmath.h>
#include <math.h>
f32 dummyLiteral() {
return 0.0f;

Some files were not shown because too many files have changed in this diff Show More