gmio_core: make error functions internal and inline

This commit is contained in:
Hugues Delorme 2015-03-30 10:26:39 +02:00
parent 922367f3b1
commit ac56054988
6 changed files with 17 additions and 15 deletions

View File

@ -50,14 +50,4 @@ enum gmio_error
typedef enum gmio_error gmio_error_t;
GMIO_C_LINKAGE_BEGIN
/*! Returns true if \p code == GMIO_NO_ERROR */
GMIO_LIB_EXPORT gmio_bool_t gmio_no_error(int code);
/*! Returns true if \p code != GMIO_NO_ERROR */
GMIO_LIB_EXPORT gmio_bool_t gmio_error(int code);
GMIO_C_LINKAGE_END
#endif /* GMIO_ERROR_H */

View File

@ -13,14 +13,22 @@
** "http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html".
****************************************************************************/
#include "error.h"
/* WARNING :
* this header has no multi-inclusion guard. It must be included only once
* in the translation unit of use. The reason is that all functions
* defined here are meant to be inlined for performance purpose
*/
gmio_bool_t gmio_no_error(int code)
#include "../error.h"
/*! Returns true if <tt>code == GMIO_NO_ERROR</tt> */
GMIO_INLINE gmio_bool_t gmio_no_error(int code)
{
return code == GMIO_NO_ERROR;
}
gmio_bool_t gmio_error(int code)
/*! Returns true if <tt>code != GMIO_NO_ERROR</tt> */
GMIO_INLINE gmio_bool_t gmio_error(int code)
{
return code != GMIO_NO_ERROR;
}

View File

@ -16,6 +16,7 @@
#include "stl_rw_common.h"
#include "../../gmio_core/error.h"
#include "../../gmio_core/internal/helper_error.h"
#include "../stl_error.h"
gmio_bool_t gmio_check_transfer(int *error, const gmio_transfer_t* trsf)

View File

@ -21,6 +21,7 @@
#include "stl_error.h"
#include "../gmio_core/error.h"
#include "../gmio_core/internal/helper_error.h"
#include "../gmio_core/internal/helper_stream.h"
#include "../gmio_core/internal/helper_transfer.h"
#include "../gmio_core/internal/min_max.h"

View File

@ -26,9 +26,10 @@
#include "../gmio_core/error.h"
#include "../gmio_core/internal/byte_swap.h"
#include "../gmio_core/internal/convert.h"
#include "../gmio_core/internal/safe_cast.h"
#include "../gmio_core/internal/helper_error.h"
#include "../gmio_core/internal/helper_stream.h"
#include "../gmio_core/internal/helper_transfer.h"
#include "../gmio_core/internal/safe_cast.h"
#include <string.h>

View File

@ -25,9 +25,10 @@
#include "../gmio_core/error.h"
#include "../gmio_core/internal/byte_codec.h"
#include "../gmio_core/internal/min_max.h"
#include "../gmio_core/internal/safe_cast.h"
#include "../gmio_core/internal/helper_error.h"
#include "../gmio_core/internal/helper_stream.h"
#include "../gmio_core/internal/helper_transfer.h"
#include "../gmio_core/internal/safe_cast.h"
#include <string.h>