Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
bbbf8228
Commit
bbbf8228
authored
9 years ago
by
Kostyantyn Vorobyov
Browse files
Options
Downloads
Patches
Plain Diff
[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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/e-acsl/share/e-acsl/adt_models/e_acsl_adt_mmodel.h
+4
-3
4 additions, 3 deletions
...lugins/e-acsl/share/e-acsl/adt_models/e_acsl_adt_mmodel.h
src/plugins/e-acsl/share/e-acsl/e_acsl_bits.h
+5
-2
5 additions, 2 deletions
src/plugins/e-acsl/share/e-acsl/e_acsl_bits.h
with
9 additions
and
5 deletions
src/plugins/e-acsl/share/e-acsl/adt_models/e_acsl_adt_mmodel.h
+
4
−
3
View file @
bbbf8228
...
@@ -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 initialize
d
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) */
...
...
This diff is collapsed.
Click to expand it.
src/plugins/e-acsl/share/e-acsl/e_acsl_bits.h
+
5
−
2
View file @
bbbf8228
...
@@ -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 "U
N
known byte order"
# error "U
n
known byte order"
#endif
#endif
/* Bit-level manipulations {{{ */
/* Bit-level manipulations {{{ */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment