Skip to content

Commit 432adb6

Browse files
committed
refactor: simplify zero hours basetype rounding functions
1 parent 77feed8 commit 432adb6

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

GeneralsMD/Code/Libraries/Include/Lib/BaseType.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -142,16 +142,16 @@ __forceinline float fast_float_ceil(float f)
142142
}
143143

144144
//-------------------------------------------------------------------------------------------------
145-
#define REAL_TO_INT(x) ((Int)(fast_float2long_round(fast_float_trunc(x))))
146-
#define REAL_TO_UNSIGNEDINT(x) ((UnsignedInt)(fast_float2long_round(fast_float_trunc(x))))
147-
#define REAL_TO_SHORT(x) ((Short)(fast_float2long_round(fast_float_trunc(x))))
148-
#define REAL_TO_UNSIGNEDSHORT(x) ((UnsignedShort)(fast_float2long_round(fast_float_trunc(x))))
149-
#define REAL_TO_BYTE(x) ((Byte)(fast_float2long_round(fast_float_trunc(x))))
150-
#define REAL_TO_UNSIGNEDBYTE(x) ((UnsignedByte)(fast_float2long_round(fast_float_trunc(x))))
151-
#define REAL_TO_CHAR(x) ((Char)(fast_float2long_round(fast_float_trunc(x))))
152-
#define DOUBLE_TO_REAL(x) ((Real) (x))
153-
#define DOUBLE_TO_INT(x) ((Int) (fast_float2long_round(fast_float_trunc(x))))
154-
#define INT_TO_REAL(x) ((Real) (x))
145+
#define REAL_TO_INT(x) ((Int)(x))
146+
#define REAL_TO_UNSIGNEDINT(x) ((UnsignedInt)(x))
147+
#define REAL_TO_SHORT(x) ((Short)(x))
148+
#define REAL_TO_UNSIGNEDSHORT(x) ((UnsignedShort)(x))
149+
#define REAL_TO_BYTE(x) ((Byte)(x))
150+
#define REAL_TO_UNSIGNEDBYTE(x) ((UnsignedByte)(x))
151+
#define REAL_TO_CHAR(x) ((Char)(x))
152+
#define DOUBLE_TO_REAL(x) ((Real)(x))
153+
#define DOUBLE_TO_INT(x) ((Int)(x))
154+
#define INT_TO_REAL(x) ((Real)(x))
155155

156156
// once we've ceiled/floored, trunc and round are identical, and currently, round is faster... (srj)
157157
#define REAL_TO_INT_CEIL(x) (fast_float2long_round(fast_float_ceil(x)))

0 commit comments

Comments
 (0)