Skip to content
Snippets Groups Projects
Commit bbbf8228 authored by Kostyantyn Vorobyov's avatar Kostyantyn Vorobyov
Browse files

[RTL] Integrated e_acsl_bits.h into ADT memory models

parent 44e6a135
No related branches found
No related tags found
No related merge requests found
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "e_acsl_string.h" #include "e_acsl_string.h"
#include "e_acsl_printf.h" #include "e_acsl_printf.h"
#include "e_acsl_bits.h"
#include "e_acsl_assert.h" #include "e_acsl_assert.h"
#include "e_acsl_debug.h" #include "e_acsl_debug.h"
#include "e_acsl_malloc.h" #include "e_acsl_malloc.h"
...@@ -181,9 +182,9 @@ void* __realloc(void* ptr, size_t size) { ...@@ -181,9 +182,9 @@ void* __realloc(void* ptr, size_t size) {
/* Adjust bits in the last byte */ /* Adjust bits in the last byte */
if(tmp->size%8 != 0) { if(tmp->size%8 != 0) {
/* Get fully initialize byte (255), shift right by the number of bytes /* Get a fully initialized byte (255), shift right by the number
* that need to be pertained and flip, so zeroes becomes one and vice * of bytes that need to be pertained and flip, so zeroes becomes
* versa. E.g., in the above example this is as follows: * one and vice versa. E.g., in the above example this is as follows:
* 1111 1111 - 255 * 1111 1111 - 255
* 0001 1111 - 255 << tmp->size%8 * 0001 1111 - 255 << tmp->size%8
* 1110 0000 - ~(255 << tmp->size%8) */ * 1110 0000 - ~(255 << tmp->size%8) */
......
...@@ -20,6 +20,9 @@ ...@@ -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 #ifndef E_ACSL_BITS
#define E_ACSL_BITS #define E_ACSL_BITS
...@@ -32,9 +35,9 @@ ...@@ -32,9 +35,9 @@
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
# error "Big-endian byte order is unsupported" # error "Big-endian byte order is unsupported"
#elif __BYTE_ORDER__ == __ORDER_PDP_ENDIAN__ #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__ #elif __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
# error "UNknown byte order" # error "Unknown byte order"
#endif #endif
/* Bit-level manipulations {{{ */ /* Bit-level manipulations {{{ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment