mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Cleanup usage of static, extern and typedef (#1256)
* Cleanup usage of static, extern and typedef Remove static on functions defined headers, as it can result in duplication in binaries. Remove unnecessary extern keyword on a function declaration, as it is the default behavior and can be puzzling when reading the code. Remove the unused declaration of my_ilogb, which is never defined. Remove unnecessary usage of typedef, as they are only increasing the cognitive load of the code for no purpose. Signed-off-by: Marco Antognini <marco.antognini@arm.com> * Improve usage of inline and static in harness Functions declared in header as static can trigger unused warnings when (indirectly) included in translation units that do not use such functions. Use inline instead, which also avoids duplicating symbols in binaries. Signed-off-by: Marco Antognini <marco.antognini@arm.com>
This commit is contained in:
@@ -39,7 +39,7 @@ typedef int FPU_mode_type;
|
||||
extern __thread fpu_control_t fpu_control;
|
||||
#endif
|
||||
// Set the reference hardware floating point unit to FTZ mode
|
||||
static inline void ForceFTZ(FPU_mode_type *mode)
|
||||
inline void ForceFTZ(FPU_mode_type *mode)
|
||||
{
|
||||
#if defined(__i386__) || defined(__x86_64__) || defined(_MSC_VER) \
|
||||
|| defined(__MINGW32__)
|
||||
@@ -65,7 +65,7 @@ static inline void ForceFTZ(FPU_mode_type *mode)
|
||||
}
|
||||
|
||||
// Disable the denorm flush to zero
|
||||
static inline void DisableFTZ(FPU_mode_type *mode)
|
||||
inline void DisableFTZ(FPU_mode_type *mode)
|
||||
{
|
||||
#if defined(__i386__) || defined(__x86_64__) || defined(_MSC_VER) \
|
||||
|| defined(__MINGW32__)
|
||||
@@ -91,7 +91,7 @@ static inline void DisableFTZ(FPU_mode_type *mode)
|
||||
}
|
||||
|
||||
// Restore the reference hardware to floating point state indicated by *mode
|
||||
static inline void RestoreFPState(FPU_mode_type *mode)
|
||||
inline void RestoreFPState(FPU_mode_type *mode)
|
||||
{
|
||||
#if defined(__i386__) || defined(__x86_64__) || defined(_MSC_VER) \
|
||||
|| defined(__MINGW32__)
|
||||
|
||||
Reference in New Issue
Block a user