rsys

Basic data structures and low-level features
git clone git://git.meso-star.fr/rsys.git
Log | Files | Refs | README | LICENSE

commit 02429bd5e03bdc6f71f9f717c1d69d070981a106
parent a50e608d561b31075467715def89992b278da7ee
Author: vaplv <vaplv@free.fr>
Date:   Tue, 10 Mar 2015 11:10:42 +0100

Fix compilation issues when the headers are included in C++ code

Diffstat:
Mcmake/CMakeLists.txt | 2+-
Msrc/dynamic_array.h | 2+-
Msrc/logger.h | 2+-
Msrc/math.h | 2+-
4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt @@ -40,7 +40,7 @@ include(rcmake) ################################################################################ set(VERSION_MAJOR 0) set(VERSION_MINOR 1) -set(VERSION_PATCH 0) +set(VERSION_PATCH 1) set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) set(RSYS_FILES_SRC diff --git a/src/dynamic_array.h b/src/dynamic_array.h @@ -144,7 +144,7 @@ DARRAY_FUNC__(reserve)(struct DARRAY_TYPE__* darray, const size_t sz) return RES_OK; sz_adjusted = round_up_pow2(sz); - data = MEM_ALLOC_ALIGNED + data = (DARRAY_DATA*)MEM_ALLOC_ALIGNED (darray->allocator, sz_adjusted * sizeof(DARRAY_DATA), MMIN(ALIGNOF(DARRAY_DATA), 16)); diff --git a/src/logger.h b/src/logger.h @@ -22,7 +22,7 @@ #include <stdarg.h> -#define LOGGER_DEFAULT (void*)0xC0DE +#define LOGGER_DEFAULT (struct logger*)0xC0DE enum log_type { LOG_OUTPUT, diff --git a/src/math.h b/src/math.h @@ -51,7 +51,7 @@ round_up_pow2(const size_t i) static FINLINE int log2i(const int i) { - union { float f; const int32_t i; } ucast; + union { float f; int32_t i; } ucast; ASSERT(i != 0); ucast.f = (float)i; return ((ucast.i>>23/*#bits mantissa*/) & ((1<<8/*#bits exponent*/)-1)) - 127;