Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
0bddf6c3
Commit
0bddf6c3
authored
May 06, 2012
by
Christoph Mallon
Browse files
Teach new_tarval_from_str_int() to parse binary numbers: 0[bB][01]+.
parent
e48a03a6
Changes
2
Show whitespace changes
Inline
Side-by-side
include/libfirm/tv.h
View file @
0bddf6c3
...
...
@@ -70,6 +70,7 @@
* if mode is int_number:
* - [+-]?0[xX][0-9a-fA-F]+ (hexadecimal representation)
* - [+-]?0[0-7]* (octal representation)
* - [+-]?0[bB][01]+ (binary representation)
* - [+-]?[1-9][0-9]* (decimal representation)
*
* if mode is float_number:
...
...
ir/tv/tv.c
View file @
0bddf6c3
...
...
@@ -344,6 +344,10 @@ static ir_tarval *new_tarval_from_str_int(const char *str, size_t len,
str
+=
2
;
len
-=
2
;
base
=
16
;
}
else
if
(
str
[
1
]
==
'b'
||
str
[
1
]
==
'B'
)
{
str
+=
2
;
len
-=
2
;
base
=
2
;
}
else
{
++
str
;
--
len
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment