From 220db7212f1f734a5dd2be598f70b142f43905f3 Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 10 Jul 2024 07:11:38 +0200 Subject: [PATCH] inline some crap --- src/p_maputl.c | 16 ++++++++-------- src/r_main.c | 8 ++++---- src/tables.c | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/p_maputl.c b/src/p_maputl.c index d6fb40a14..fc7ea89ec 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -134,7 +134,7 @@ void P_ClosestPointOnLine3D(fixed_t x, fixed_t y, fixed_t z, line_t *line, verte // P_PointOnLineSide // Returns 0 or 1 // -PUREFUNC INT32 P_PointOnLineSide(fixed_t x, fixed_t y, const line_t *line) +FUNCINLINE ATTRINLINE PUREFUNC INT32 P_PointOnLineSide(fixed_t x, fixed_t y, const line_t *line) { fixed_t dx, dy, left, right; @@ -208,7 +208,7 @@ PUREFUNC INT32 P_BoxOnLineSide(fixed_t *tmbox, const line_t *ld) // P_PointOnDivlineSide // Returns 0 or 1. // -static PUREFUNC INT32 P_PointOnDivlineSide(fixed_t x, fixed_t y, const divline_t *line) +FUNCINLINE static ATTRINLINE PUREFUNC INT32 P_PointOnDivlineSide(fixed_t x, fixed_t y, const divline_t *line) { fixed_t dx, dy, left, right; @@ -235,7 +235,7 @@ static PUREFUNC INT32 P_PointOnDivlineSide(fixed_t x, fixed_t y, const divline_t // // P_MakeDivline // -void P_MakeDivline(line_t *li, divline_t *dl) +FUNCINLINE ATTRINLINE void P_MakeDivline(line_t *li, divline_t *dl) { dl->x = li->v1->x; dl->y = li->v1->y; @@ -248,7 +248,7 @@ void P_MakeDivline(line_t *li, divline_t *dl) // Returns the fractional intercept point along the first divline. // This is only called by the addthings and addlines traversers. // -fixed_t P_InterceptVector(divline_t *v2, divline_t *v1) +FUNCINLINE ATTRINLINE fixed_t P_InterceptVector(divline_t *v2, divline_t *v1) { fixed_t frac, num, den; @@ -752,7 +752,7 @@ void P_UnsetThingPosition(mobj_t *thing) } } -void P_UnsetPrecipThingPosition(precipmobj_t *thing) +FUNCINLINE ATTRINLINE void P_UnsetPrecipThingPosition(precipmobj_t *thing) { precipmobj_t **bprev = thing->bprev; precipmobj_t *bnext = thing->bnext; @@ -902,7 +902,7 @@ void P_SetUnderlayPosition(mobj_t *thing) sector_list = NULL; // clear for next time } -void P_SetPrecipitationThingPosition(precipmobj_t *thing) +FUNCINLINE ATTRINLINE void P_SetPrecipitationThingPosition(precipmobj_t *thing) { thing->subsector = R_PointInSubsector(thing->x, thing->y); @@ -990,7 +990,7 @@ boolean P_BlockLinesIterator(INT32 x, INT32 y, boolean (*func)(line_t *)) // // P_BlockThingsIterator // -boolean P_BlockThingsIterator(INT32 x, INT32 y, boolean (*func)(mobj_t *)) +FUNCINLINE ATTRINLINE boolean P_BlockThingsIterator(INT32 x, INT32 y, boolean (*func)(mobj_t *)) { mobj_t *mobj, *bnext = NULL; @@ -1029,7 +1029,7 @@ divline_t trace; static boolean earlyout; //SoM: 4/6/2000: Remove limit on intercepts. -static void P_CheckIntercepts(void) +FUNCINLINE static ATTRINLINE void P_CheckIntercepts(void) { static size_t max_intercepts = 0; size_t count = intercept_p - intercepts; diff --git a/src/r_main.c b/src/r_main.c index 7d31a12fe..50423e343 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -339,7 +339,7 @@ static void FlipCam4_OnChange(void) // // killough 5/2/98: reformatted // -PUREFUNC INT32 R_PointOnSide(fixed_t x, fixed_t y, const node_t *restrict node) +FUNCINLINE ATTRINLINE PUREFUNC INT32 R_PointOnSide(fixed_t x, fixed_t y, const node_t *restrict node) { if (!node->dx) return x <= node->x ? node->dy > 0 : node->dy < 0; @@ -358,7 +358,7 @@ PUREFUNC INT32 R_PointOnSide(fixed_t x, fixed_t y, const node_t *restrict node) } // killough 5/2/98: reformatted -PUREFUNC INT32 R_PointOnSegSide(fixed_t x, fixed_t y, const seg_t *line) +FUNCINLINE ATTRINLINE PUREFUNC INT32 R_PointOnSegSide(fixed_t x, fixed_t y, const seg_t *line) { fixed_t lx = line->v1->x; fixed_t ly = line->v1->y; @@ -1098,7 +1098,7 @@ void R_Init(void) // // R_PointInSubsector // -subsector_t *R_PointInSubsector(fixed_t x, fixed_t y) +FUNCINLINE ATTRINLINE subsector_t *R_PointInSubsector(fixed_t x, fixed_t y) { size_t nodenum = numnodes-1; @@ -1111,7 +1111,7 @@ subsector_t *R_PointInSubsector(fixed_t x, fixed_t y) // // R_IsPointInSubsector, same as above but returns 0 if not in subsector // -subsector_t *R_IsPointInSubsector(fixed_t x, fixed_t y) +FUNCINLINE ATTRINLINE subsector_t *R_IsPointInSubsector(fixed_t x, fixed_t y) { node_t *node; INT32 side, i; diff --git a/src/tables.c b/src/tables.c index 71b74636c..bf5385db1 100644 --- a/src/tables.c +++ b/src/tables.c @@ -26,7 +26,7 @@ #include "tables.h" -unsigned SlopeDiv(unsigned num, unsigned den) +FUNCINLINE ATTRINLINE unsigned SlopeDiv(unsigned num, unsigned den) { unsigned ans; num <<= (FINE_FRACBITS-FRACBITS); @@ -37,7 +37,7 @@ unsigned SlopeDiv(unsigned num, unsigned den) return ans <= SLOPERANGE ? ans : SLOPERANGE; } -UINT64 SlopeDivEx(unsigned int num, unsigned int den) +FUNCINLINE ATTRINLINE UINT64 SlopeDivEx(unsigned int num, unsigned int den) { UINT64 ans; if (den < 512)