From cc28eb9d5479c82f1b50456b4a1af73d6c4dc57e Mon Sep 17 00:00:00 2001 From: Hugues Delorme Date: Fri, 10 Apr 2015 10:10:25 +0200 Subject: [PATCH] gmio_core: inline functions in convert.h --- src/gmio_core/internal/convert.c | 30 ------------------------------ src/gmio_core/internal/convert.h | 15 +++++++++++++-- 2 files changed, 13 insertions(+), 32 deletions(-) delete mode 100644 src/gmio_core/internal/convert.c diff --git a/src/gmio_core/internal/convert.c b/src/gmio_core/internal/convert.c deleted file mode 100644 index 9968802..0000000 --- a/src/gmio_core/internal/convert.c +++ /dev/null @@ -1,30 +0,0 @@ -/**************************************************************************** -** GeomIO Library -** Copyright FougSys (2 Mar. 2015) -** contact@fougsys.fr -** -** This software is a reusable library whose purpose is to provide complete -** I/O support for various CAD file formats (eg. STL) -** -** This software is governed by the CeCILL-B license under French law and -** abiding by the rules of distribution of free software. You can use, -** modify and/ or redistribute the software under the terms of the CeCILL-B -** license as circulated by CEA, CNRS and INRIA at the following URL -** "http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html". -****************************************************************************/ - -#include "convert.h" - -gmio_float32_t gmio_convert_float32(uint32_t val) -{ - gmio_uint_float_32_t conv; - conv.as_uint32 = val; - return conv.as_float32; -} - -uint32_t gmio_convert_uint32(gmio_float32_t val) -{ - gmio_uint_float_32_t conv; - conv.as_float32 = val; - return conv.as_uint32; -} diff --git a/src/gmio_core/internal/convert.h b/src/gmio_core/internal/convert.h index bb9512d..006f69d 100644 --- a/src/gmio_core/internal/convert.h +++ b/src/gmio_core/internal/convert.h @@ -25,7 +25,18 @@ union gmio_uint_float_32 }; typedef union gmio_uint_float_32 gmio_uint_float_32_t; -gmio_float32_t gmio_convert_float32(uint32_t val); -uint32_t gmio_convert_uint32(gmio_float32_t val); +GMIO_INLINE gmio_float32_t gmio_convert_float32(uint32_t val) +{ + gmio_uint_float_32_t conv; + conv.as_uint32 = val; + return conv.as_float32; +} + +GMIO_INLINE uint32_t gmio_convert_uint32(gmio_float32_t val) +{ + gmio_uint_float_32_t conv; + conv.as_float32 = val; + return conv.as_uint32; +} #endif /* GMIO_INTERNAL_CONVERT_H */