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
b1fdf00e
Commit
b1fdf00e
authored
6 years ago
by
Patrick Baudin
Committed by
Virgile Prevosto
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[lib] hex and bin formatters for integers

parent
d5e69f0a
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
tests/misc/oracle/pp_bin_hex.res.oracle
+25
-25
25 additions, 25 deletions
tests/misc/oracle/pp_bin_hex.res.oracle
tests/misc/pp_bin_hex.ml
+2
-2
2 additions, 2 deletions
tests/misc/pp_bin_hex.ml
with
27 additions
and
27 deletions
tests/misc/oracle/pp_bin_hex.res.oracle
+
25
−
25
View file @
b1fdf00e
--------------------------------------------------
--------------------------------------------------
Dec. 0
Dec. 0
Hex. 0x0000
Hex. 0x0000
Bin. 0b00000000
Bin. 0b0000
_
0000
--------------------------------------------------
--------------------------------------------------
Dec. 1
Dec. 1
Hex. 0x0001
Hex. 0x0001
Bin. 0b00000001
Bin. 0b0000
_
0001
--------------------------------------------------
--------------------------------------------------
Dec. -1
Dec. -1
Hex. 1xFFFF
Hex. 1xFFFF
Bin. 1b11111111
Bin. 1b1111
_
1111
--------------------------------------------------
--------------------------------------------------
Dec. 2
Dec. 2
Hex. 0x0002
Hex. 0x0002
Bin. 0b00000010
Bin. 0b0000
_
0010
--------------------------------------------------
--------------------------------------------------
Dec. -2
Dec. -2
Hex. 1xFFFE
Hex. 1xFFFE
Bin. 1b11111110
Bin. 1b1111
_
1110
--------------------------------------------------
--------------------------------------------------
Dec. 5
Dec. 5
Hex. 0x0005
Hex. 0x0005
Bin. 0b00000101
Bin. 0b0000
_
0101
--------------------------------------------------
--------------------------------------------------
Dec. -5
Dec. -5
Hex. 1xFFFB
Hex. 1xFFFB
Bin. 1b11111011
Bin. 1b1111
_
1011
--------------------------------------------------
--------------------------------------------------
Dec. 9
Dec. 9
Hex. 0x0009
Hex. 0x0009
Bin. 0b00001001
Bin. 0b0000
_
1001
--------------------------------------------------
--------------------------------------------------
Dec. -9
Dec. -9
Hex. 1xFFF7
Hex. 1xFFF7
Bin. 1b11110111
Bin. 1b1111
_
0111
--------------------------------------------------
--------------------------------------------------
Dec. 16
Dec. 16
Hex. 0x0010
Hex. 0x0010
Bin. 0b00010000
Bin. 0b0001
_
0000
--------------------------------------------------
--------------------------------------------------
Dec. -16
Dec. -16
Hex. 1xFFF0
Hex. 1xFFF0
Bin. 1b11110000
Bin. 1b1111
_
0000
--------------------------------------------------
--------------------------------------------------
Dec. 127
Dec. 127
Hex. 0x007F
Hex. 0x007F
Bin. 0b01111111
Bin. 0b0111
_
1111
--------------------------------------------------
--------------------------------------------------
Dec. -127
Dec. -127
Hex. 1xFF81
Hex. 1xFF81
Bin. 1b10000001
Bin. 1b1000
_
0001
--------------------------------------------------
--------------------------------------------------
Dec. 128
Dec. 128
Hex. 0x0080
Hex. 0x0080
Bin. 0b10000000
Bin. 0b1000
_
0000
--------------------------------------------------
--------------------------------------------------
Dec. -128
Dec. -128
Hex. 1xFF80
Hex. 1xFF80
Bin. 1b10000000
Bin. 1b1000
_
0000
--------------------------------------------------
--------------------------------------------------
Dec. 255
Dec. 255
Hex. 0x00FF
Hex. 0x00FF
Bin. 0b11111111
Bin. 0b1111
_
1111
--------------------------------------------------
--------------------------------------------------
Dec. -255
Dec. -255
Hex. 1xFF01
Hex. 1xFF01
Bin. 1b00000001
Bin. 1b0000
_
0001
--------------------------------------------------
--------------------------------------------------
Dec. 4279173135
Dec. 4279173135
Hex. 0xFF0F000F
Hex. 0xFF0F
_
000F
Bin. 0b11111111000011110000000000001111
Bin. 0b1111
_
1111
_
0000
_
1111
_
0000
_
0000
_
0000
_
1111
--------------------------------------------------
--------------------------------------------------
Dec. -4279173135
Dec. -4279173135
Hex. 1x00F0FFF1
Hex. 1x00F0
_
FFF1
Bin. 1b00000000111100001111111111110001
Bin. 1b0000
_
0000
_
1111
_
0000
_
1111
_
1111
_
1111
_
0001
--------------------------------------------------
--------------------------------------------------
Dec. 386334727
Dec. 386334727
Hex. 0x17070007
Hex. 0x1707
_
0007
Bin. 0b00010111000001110000000000000111
Bin. 0b0001
_
0111
_
0000
_
0111
_
0000
_
0000
_
0000
_
0111
--------------------------------------------------
--------------------------------------------------
Dec. -386334727
Dec. -386334727
Hex. 1xE8F8FFF9
Hex. 1xE8F8
_
FFF9
Bin. 1b11101000111110001111111111111001
Bin. 1b1110
_
1000
_
1111
_
1000
_
1111
_
1111
_
1111
_
1001
--------------------------------------------------
--------------------------------------------------
[kernel] Parsing tests/misc/pp_bin_hex.i (no preprocessing)
[kernel] Parsing tests/misc/pp_bin_hex.i (no preprocessing)
This diff is collapsed.
Click to expand it.
tests/misc/pp_bin_hex.ml
+
2
−
2
View file @
b1fdf00e
let
pp_dec
fmt
z
=
Integer
.
pretty
~
hexa
:
false
fmt
z
let
pp_dec
fmt
z
=
Integer
.
pretty
~
hexa
:
false
fmt
z
let
pp_hex
fmt
z
=
Integer
.
pp_hex
~
nbits
:
16
fmt
z
let
pp_hex
fmt
z
=
Integer
.
pp_hex
~
nbits
:
16
~
sep
:
"_"
fmt
z
let
pp_bin
fmt
z
=
Integer
.
pp_bin
~
nbits
:
8
fmt
z
let
pp_bin
fmt
z
=
Integer
.
pp_bin
~
nbits
:
8
~
sep
:
"_"
fmt
z
let
hrule
()
=
let
hrule
()
=
Format
.
printf
"--------------------------------------------------@."
Format
.
printf
"--------------------------------------------------@."
...
...
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