Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
dmt
Commits
fdb5fec9
Commit
fdb5fec9
authored
Oct 09, 2020
by
Maxime Perrotin
Committed by
Thanassis Tsiodras
Nov 17, 2020
Browse files
Use portable POSIX for formatting 64bits numbers in printf
parent
af576425
Changes
2
Hide whitespace changes
Inline
Side-by-side
dmt/msgPrinter.py
View file @
fdb5fec9
...
...
@@ -69,7 +69,7 @@ class Printer(RecursiveMapper):
def
MapInteger
(
self
,
srcCVariable
,
prefix
,
_
,
__
,
___
):
lines
=
[]
lines
.
append
(
'#if WORD_SIZE==8'
)
lines
.
append
(
'printf("%%s%s %%
lld
\\
n", paramName, %s);'
%
(
prefix
,
srcCVariable
))
lines
.
append
(
'printf("%%s%s %%
"PRId64"
\\
n", paramName, %s);'
%
(
prefix
,
srcCVariable
))
lines
.
append
(
'#else'
)
lines
.
append
(
'printf("%%s%s %%d
\\
n", paramName, %s);'
%
(
prefix
,
srcCVariable
))
lines
.
append
(
'#endif'
)
...
...
dmt/msgPrinterASN1.py
View file @
fdb5fec9
...
...
@@ -67,7 +67,7 @@ class Printer(RecursiveMapper):
def
MapInteger
(
self
,
srcCVariable
,
unused
,
_
,
__
,
___
):
lines
=
[]
lines
.
append
(
'#if WORD_SIZE==8'
)
lines
.
append
(
'printf("%%
lld"
, %s);'
%
srcCVariable
)
lines
.
append
(
'printf("%%
"PRId64
, %s);'
%
srcCVariable
)
lines
.
append
(
'#else'
)
lines
.
append
(
'printf("%%d", %s);'
%
srcCVariable
)
lines
.
append
(
'#endif'
)
...
...
Write
Preview
Markdown
is supported
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