Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
efccbf6f
Commit
efccbf6f
authored
Apr 05, 2014
by
Damien George
Browse files
Merge pull request #436 from dhylands/pfenv-print-int
Change pfenv_print_int to take machine_uint_t rather than unsinged in
parents
327a3e2f
64ef5d7f
Changes
2
Hide whitespace changes
Inline
Side-by-side
py/pfenv.c
View file @
efccbf6f
...
...
@@ -79,10 +79,10 @@ int pfenv_print_strn(const pfenv_t *pfenv, const char *str, unsigned int len, in
// We can use 16 characters for 32-bit and 32 characters for 64-bit
#define INT_BUF_SIZE (sizeof(machine_int_t) * 4)
int
pfenv_print_int
(
const
pfenv_t
*
pfenv
,
unsigned
in
t
x
,
int
sgn
,
int
base
,
int
base_char
,
int
flags
,
char
fill
,
int
width
)
{
int
pfenv_print_int
(
const
pfenv_t
*
pfenv
,
machine_uint_
t
x
,
int
sgn
,
int
base
,
int
base_char
,
int
flags
,
char
fill
,
int
width
)
{
char
sign
=
0
;
if
(
sgn
)
{
if
((
in
t
)
x
<
0
)
{
if
((
machine_int_
t
)
x
<
0
)
{
sign
=
'-'
;
x
=
-
x
;
}
else
if
(
flags
&
PF_FLAG_SHOW_SIGN
)
{
...
...
py/pfenv.h
View file @
efccbf6f
...
...
@@ -17,7 +17,7 @@ typedef struct _pfenv_t {
void
pfenv_vstr_add_strn
(
void
*
data
,
const
char
*
str
,
unsigned
int
len
);
int
pfenv_print_strn
(
const
pfenv_t
*
pfenv
,
const
char
*
str
,
unsigned
int
len
,
int
flags
,
char
fill
,
int
width
);
int
pfenv_print_int
(
const
pfenv_t
*
pfenv
,
unsigned
in
t
x
,
int
sgn
,
int
base
,
int
base_char
,
int
flags
,
char
fill
,
int
width
);
int
pfenv_print_int
(
const
pfenv_t
*
pfenv
,
machine_uint_
t
x
,
int
sgn
,
int
base
,
int
base_char
,
int
flags
,
char
fill
,
int
width
);
#if MICROPY_ENABLE_FLOAT
int
pfenv_print_float
(
const
pfenv_t
*
pfenv
,
mp_float_t
f
,
char
fmt
,
int
flags
,
char
fill
,
int
width
,
int
prec
);
#endif
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment