From bbbf8228e3cd1c1068aaef749f6d1c19850184d0 Mon Sep 17 00:00:00 2001 From: Kostyantyn Vorobyov <kostyantyn.vorobyov@cea.fr> Date: Wed, 16 Mar 2016 17:46:32 +0100 Subject: [PATCH] [RTL] Integrated e_acsl_bits.h into ADT memory models --- .../e-acsl/share/e-acsl/adt_models/e_acsl_adt_mmodel.h | 7 ++++--- src/plugins/e-acsl/share/e-acsl/e_acsl_bits.h | 7 +++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/plugins/e-acsl/share/e-acsl/adt_models/e_acsl_adt_mmodel.h b/src/plugins/e-acsl/share/e-acsl/adt_models/e_acsl_adt_mmodel.h index 4d20c3c3505..32067b0aa67 100644 --- a/src/plugins/e-acsl/share/e-acsl/adt_models/e_acsl_adt_mmodel.h +++ b/src/plugins/e-acsl/share/e-acsl/adt_models/e_acsl_adt_mmodel.h @@ -25,6 +25,7 @@ #include "e_acsl_string.h" #include "e_acsl_printf.h" +#include "e_acsl_bits.h" #include "e_acsl_assert.h" #include "e_acsl_debug.h" #include "e_acsl_malloc.h" @@ -181,9 +182,9 @@ void* __realloc(void* ptr, size_t size) { /* Adjust bits in the last byte */ if(tmp->size%8 != 0) { - /* Get fully initialize byte (255), shift right by the number of bytes - * that need to be pertained and flip, so zeroes becomes one and vice - * versa. E.g., in the above example this is as follows: + /* Get a fully initialized byte (255), shift right by the number + * of bytes that need to be pertained and flip, so zeroes becomes + * one and vice versa. E.g., in the above example this is as follows: * 1111 1111 - 255 * 0001 1111 - 255 << tmp->size%8 * 1110 0000 - ~(255 << tmp->size%8) */ diff --git a/src/plugins/e-acsl/share/e-acsl/e_acsl_bits.h b/src/plugins/e-acsl/share/e-acsl/e_acsl_bits.h index e849d0ab750..bda707ce2b0 100644 --- a/src/plugins/e-acsl/share/e-acsl/e_acsl_bits.h +++ b/src/plugins/e-acsl/share/e-acsl/e_acsl_bits.h @@ -20,6 +20,9 @@ /* */ /**************************************************************************/ +/* Bit-level manipulations and endianness checks. + * Should be included after e_acsl_printf.h and e_acsl_string.h headers. */ + #ifndef E_ACSL_BITS #define E_ACSL_BITS @@ -32,9 +35,9 @@ #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ # error "Big-endian byte order is unsupported" #elif __BYTE_ORDER__ == __ORDER_PDP_ENDIAN__ -# error "PDP byte order is unsupported" +# error "PDP-endian byte order is unsupported" #elif __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ -# error "UNknown byte order" +# error "Unknown byte order" #endif /* Bit-level manipulations {{{ */ -- GitLab