oot icon indicating copy to clipboard operation
oot copied to clipboard

Move libultra functions and variables to libultra headers

Open Thar0 opened this issue 2 years ago • 6 comments
trafficstars

Not totally happy with this, since macros.h and the new stack.h are not libultra headers but are still used in some libultra files for now, however this is the bulk of the changes and further improvements will inevitably be found.

Thar0 avatar Dec 18 '22 18:12 Thar0

Not sure where to start reviewing but I noticed FLT_MAX -> MAXFLOAT, the former being C-standard (I think), the latter coming from where?

Dragorn421 avatar Dec 19 '22 02:12 Dragorn421

In the three MIPS cross compilers I have installed (mips-linux-gnu-, well-known, mips64-ultra-elf-, glank's toolchain, mips64-elf-, libdragon toolchain) I cannot find the definition FLT_MAX, only MAXFLOAT in math.h.

Supposedly FLT_MAX is in float.h, an ISO C99 header, however I can't find a physical copy of such a header (I'd love to know where it is) It seems MAXFLOAT is not strictly ISO C, it's an "extension", but it seems sufficiently widely adopted?

Thar0 avatar Dec 19 '22 02:12 Thar0

Very interesting last set of changes! What is the future you envision for explicit-width "ultratypes" s32 & co ? What should use int & co "natives" instead, or not? (does that make sense)

Dragorn421 avatar Dec 25 '22 15:12 Dragorn421

So far I've only been removing the ultratypes from libc files/functions, since libc shouldn't know anything about libultra. Otherwise I have no current plans to start removing them elsewhere

Thar0 avatar Dec 25 '22 17:12 Thar0

idk what this entails but theres also the "modern n64 sdk" which includes the entirety of libultra. the legality is murky at best.

ariahiro64 avatar Mar 06 '24 05:03 ariahiro64

We'll eventually need at least part of this PR revived for header cleanup.

The goals with libultra should be clarified: align with ultralib? if not, which includes in .c files (IWYU ?) ?

Dragorn421 avatar Sep 11 '24 12:09 Dragorn421