1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-17 13:24:45 +00:00

Fix some more GCC warnings, mark some bugs based on GCC warnings (#2309)

* Fix some more GCC warnings, mark some bugs based on GCC warnings

* Weird formatting

* Suggested changes

* More weird indentation I guess

* UNREACHABLE() macro, add missing NORETURNs to fault_n64.c

* AVOID_UB for PAL path in z_file_nameset.c

* Remove comments about return types

* Remove temp no longer needed
This commit is contained in:
Tharo 2024-12-02 09:40:49 +00:00 committed by GitHub
parent 6199634ffb
commit 3f703a39d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
39 changed files with 156 additions and 83 deletions

View file

@ -1,6 +1,8 @@
#ifndef ATTRIBUTES_H
#define ATTRIBUTES_H
#include "versions.h"
#if !defined(__GNUC__) && !defined(__attribute__)
#define __attribute__(x)
#endif
@ -11,4 +13,17 @@
#define NO_REORDER __attribute__((no_reorder))
#define SECTION_DATA __attribute__((section(".data")))
#ifdef __GNUC__
#define UNREACHABLE() __builtin_unreachable()
#else
#define UNREACHABLE()
#endif
// Variables may be unused in retail versions but used in debug versions
#if DEBUG_FEATURES
#define UNUSED_NDEBUG
#else
#define UNUSED_NDEBUG UNUSED
#endif
#endif

View file

@ -3,7 +3,7 @@
#include "ultra64.h"
extern s32 B_80008EE0;
extern u32 B_80008EE0;
void func_800014E8(void);
void CIC6105_AddFaultClient(void);

View file

@ -17,21 +17,23 @@
// For use in initializing OSViMode structures
#define BURST(hsync_width, color_width, vsync_width, color_start) \
(hsync_width | (color_width << 8) | (vsync_width << 16) | (color_start << 20))
#define WIDTH(v) v
#define VSYNC(v) v
#define HSYNC(duration, leap) (duration | (leap << 16))
#define LEAP(upper, lower) ((upper << 16) | lower)
#define START(start, end) ((start << 16) | end)
#define FTOFIX(val, i, f) ((u32)(val * (f32)(1 << f)) & ((1 << (i + f)) - 1))
((((u8)(hsync_width) & 0xFF) << 0) | \
(((u8)(color_width) & 0xFF) << 8) | \
(((u8)(vsync_width) & 0xF) << 16) | \
(((u16)(color_start) & 0xFFF) << 20))
#define WIDTH(v) (v)
#define VSYNC(v) (v)
#define HSYNC(duration, leap) (((u16)(leap) << 16) | (u16)(duration))
#define LEAP(upper, lower) (((u16)(upper) << 16) | (u16)(lower))
#define START(start, end) (((u16)(start) << 16) | (u16)(end))
#define FTOFIX(val, i, f) ((u32)((val) * (f32)(1 << (f))) & ((1 << ((i) + (f))) - 1))
#define F210(val) FTOFIX(val, 2, 10)
#define SCALE(scaleup, off) (F210((1.0f / (f32)scaleup)) | (F210((f32)off) << 16))
#define SCALE(scaleup, off) (F210(1.0f / (f32)(scaleup)) | (F210((f32)(off)) << 16))
#define VCURRENT(v) v
#define ORIGIN(v) v
#define VINTR(v) v
#define HSTART START
#define VCURRENT(v) (v)
#define ORIGIN(v) (v)
#define VINTR(v) (v)
#define HSTART(start, end) START(start, end)
#endif

View file

@ -81,7 +81,7 @@ void View_SetViewport(View* view, Viewport* viewport);
void View_GetViewport(View* view, Viewport* viewport);
void View_SetDistortionOrientation(View* view, f32 rotX, f32 rotY, f32 rotZ);
void View_SetDistortionScale(View* view, f32 scaleX, f32 scaleY, f32 scaleZ);
s32 View_SetDistortionSpeed(View* view, f32 speed);
BAD_RETURN(s32) View_SetDistortionSpeed(View* view, f32 speed);
void View_InitDistortion(View* view);
void View_ClearDistortion(View* view);
void View_SetDistortion(View* view, Vec3f orientation, Vec3f scale, f32 speed);