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:
@@ -29,7 +29,7 @@
|
||||
#include "mingw_compat.h"
|
||||
#endif
|
||||
|
||||
static void* align_malloc(size_t size, size_t alignment)
|
||||
inline void* align_malloc(size_t size, size_t alignment)
|
||||
{
|
||||
#if defined(_WIN32) && defined(_MSC_VER)
|
||||
return _aligned_malloc(size, alignment);
|
||||
@@ -53,7 +53,7 @@ static void* align_malloc(size_t size, size_t alignment)
|
||||
#endif
|
||||
}
|
||||
|
||||
static void align_free(void* ptr)
|
||||
inline void align_free(void* ptr)
|
||||
{
|
||||
#if defined(_WIN32) && defined(_MSC_VER)
|
||||
_aligned_free(ptr);
|
||||
|
||||
Reference in New Issue
Block a user