From 1a23556796881d7c9f4be59eb3edb4aa655bf7d4 Mon Sep 17 00:00:00 2001 From: Slice Date: Mon, 26 Feb 2024 19:08:45 +0300 Subject: [PATCH] use const float instead of define Signed-off-by: Slice --- rEFIt_UEFI/libeg/FloatLib.h | 12 ++++++------ rEFIt_UEFI/libeg/nanosvgrast.cpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/rEFIt_UEFI/libeg/FloatLib.h b/rEFIt_UEFI/libeg/FloatLib.h index 00828c62a7..5c7b5d4e47 100644 --- a/rEFIt_UEFI/libeg/FloatLib.h +++ b/rEFIt_UEFI/libeg/FloatLib.h @@ -8,12 +8,12 @@ #ifndef FloatLib_h #define FloatLib_h -#define PI (3.1415926536f) -#define PI2 (6.283185307179586f) -#define PI5 (1.570796326794897f) -#define PI4 (0.78539816339745f) -#define FLT_MAX (1.0e38f) -#define FLT_MIN (1.0e-37f) +const float PI = 3.1415926536f; +const float PI2 = 6.283185307179586f; +const float PI5 = 1.570796326794897f; +const float PI4 = 0.78539816339745f; +const float FLT_MAX = 1.0e38f; +const float FLT_MIN = 1.0e-37f; float SqrtF(float X); float PowF(float X, INTN N); diff --git a/rEFIt_UEFI/libeg/nanosvgrast.cpp b/rEFIt_UEFI/libeg/nanosvgrast.cpp index 9c23d1f53a..ce6cba381b 100644 --- a/rEFIt_UEFI/libeg/nanosvgrast.cpp +++ b/rEFIt_UEFI/libeg/nanosvgrast.cpp @@ -520,7 +520,7 @@ static void nsvg__squareCap(NSVGrasterizer* r, NSVGpoint* left, NSVGpoint* right } #ifndef NSVG_PI -#define NSVG_PI (3.14159265358979323846264338327f) +const float NSVG_PI = 3.141592653589793f; #endif static void nsvg__roundCap(NSVGrasterizer* r, NSVGpoint* left, NSVGpoint* right, NSVGpoint* p, float dx, float dy, float lineWidth, int ncap, int connect)