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
ad86f36f
Commit
ad86f36f
authored
5 years ago
by
Patrick Baudin
Committed by
Loïc Correnson
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[WP] fixes _Bool layout
parent
26cf3482
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/wp/ctypes.ml
+9
-9
9 additions, 9 deletions
src/plugins/wp/ctypes.ml
src/plugins/wp/ctypes.mli
+1
-1
1 addition, 1 deletion
src/plugins/wp/ctypes.mli
with
10 additions
and
10 deletions
src/plugins/wp/ctypes.ml
+
9
−
9
View file @
ad86f36f
...
...
@@ -30,7 +30,7 @@ open Cil_datatype
module
WpLog
=
Wp_parameters
type
c_int
=
|
Bool
|
C
Bool
|
UInt8
|
SInt8
|
UInt16
...
...
@@ -43,19 +43,19 @@ type c_int =
let
compare_c_int
:
c_int
->
c_int
->
_
=
Extlib
.
compare_basic
let
signed
=
function
|
Bool
->
false
|
C
Bool
->
false
|
UInt8
|
UInt16
|
UInt32
|
UInt64
->
false
|
SInt8
|
SInt16
|
SInt32
|
SInt64
->
true
let
i_bits
=
function
|
Bool
->
1
|
C
Bool
->
8
|
UInt8
|
SInt8
->
8
|
UInt16
|
SInt16
->
16
|
UInt32
|
SInt32
->
32
|
UInt64
|
SInt64
->
64
let
i_bytes
=
function
|
Bool
->
1
|
C
Bool
->
1
|
UInt8
|
SInt8
->
1
|
UInt16
|
SInt16
->
2
|
UInt32
|
SInt32
->
4
...
...
@@ -73,12 +73,12 @@ let is_char = function
|
SInt8
->
not
Cil
.
theMachine
.
Cil
.
theMachine
.
char_is_unsigned
|
UInt16
|
SInt16
|
UInt32
|
SInt32
|
UInt64
|
SInt64
|
Bool
->
false
|
UInt64
|
SInt64
|
C
Bool
->
false
let
c_int
ikind
=
let
mach
=
Cil
.
theMachine
.
Cil
.
theMachine
in
match
ikind
with
|
IBool
->
if
Wp_parameters
.
get_bool_range
()
then
Bool
else
UInt8
|
IBool
->
CBool
|
IChar
->
if
mach
.
char_is_unsigned
then
UInt8
else
SInt8
|
ISChar
->
SInt8
|
IUChar
->
UInt8
...
...
@@ -163,7 +163,7 @@ let idx = function
|
SInt32
->
5
|
UInt64
->
6
|
SInt64
->
7
|
Bool
->
8
|
C
Bool
->
8
let
i_memo
f
=
let
m
=
Array
.
make
9
None
in
...
...
@@ -186,7 +186,7 @@ let f_memo f =
|
None
->
let
r
=
f
z
in
m
.
(
k
)
<-
Some
r
;
r
let
i_iter
f
=
List
.
iter
f
[
Bool
;
UInt8
;
SInt8
;
UInt16
;
SInt16
;
UInt32
;
SInt32
;
UInt64
;
SInt64
]
List
.
iter
f
[
C
Bool
;
UInt8
;
SInt8
;
UInt16
;
SInt16
;
UInt32
;
SInt32
;
UInt64
;
SInt64
]
let
f_iter
f
=
List
.
iter
f
[
Float32
;
Float64
]
...
...
@@ -210,7 +210,7 @@ let bounds i = i_memo i_bounds i
(* -------------------------------------------------------------------------- *)
let
pp_int
fmt
i
=
if
i
=
Bool
then
Format
.
pp_print_string
fmt
"bool"
if
i
=
C
Bool
then
Format
.
pp_print_string
fmt
"bool"
else
Format
.
fprintf
fmt
"%cint%d"
(
if
signed
i
then
'
s'
else
'
u'
)
(
i_bits
i
)
let
pp_float
fmt
f
=
Format
.
fprintf
fmt
"float%d"
(
f_bits
f
)
...
...
This diff is collapsed.
Click to expand it.
src/plugins/wp/ctypes.mli
+
1
−
1
View file @
ad86f36f
...
...
@@ -28,7 +28,7 @@ open Cil_types
(** Runtime integers. *)
type
c_int
=
|
Bool
|
C
Bool
|
UInt8
|
SInt8
|
UInt16
...
...
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