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
42f3de92
Commit
42f3de92
authored
Oct 03, 2014
by
Damien George
Browse files
py: Convert [u]int to mp_[u]int_t where appropriate.
Addressing issue #50.
parent
877dba3e
Changes
25
Hide whitespace changes
Inline
Side-by-side
py/bc.c
View file @
42f3de92
...
...
@@ -75,9 +75,9 @@ STATIC NORETURN void fun_pos_args_mismatch(mp_obj_fun_bc_t *f, mp_uint_t expecte
}
#if DEBUG_PRINT
STATIC
void
dump_args
(
const
mp_obj_t
*
a
,
in
t
sz
)
{
STATIC
void
dump_args
(
const
mp_obj_t
*
a
,
mp_uint_
t
sz
)
{
DEBUG_printf
(
"%p: "
,
a
);
for
(
in
t
i
=
0
;
i
<
sz
;
i
++
)
{
for
(
mp_uint_
t
i
=
0
;
i
<
sz
;
i
++
)
{
DEBUG_printf
(
"%p "
,
a
[
i
]);
}
DEBUG_printf
(
"
\n
"
);
...
...
@@ -179,7 +179,7 @@ continue2:;
// fill in defaults for positional args
mp_obj_t
*
d
=
&
code_state
->
state
[
n_state
-
self
->
n_pos_args
];
mp_obj_t
*
s
=
&
self
->
extra_args
[
self
->
n_def_args
-
1
];
for
(
in
t
i
=
self
->
n_def_args
;
i
>
0
;
i
--
,
d
++
,
s
--
)
{
for
(
mp_uint_
t
i
=
self
->
n_def_args
;
i
>
0
;
i
--
,
d
++
,
s
--
)
{
if
(
*
d
==
MP_OBJ_NULL
)
{
*
d
=
*
s
;
}
...
...
py/bc.h
View file @
42f3de92
...
...
@@ -53,8 +53,8 @@ mp_uint_t mp_decode_uint(const byte **ptr);
mp_vm_return_kind_t
mp_execute_bytecode
(
mp_code_state
*
code_state
,
volatile
mp_obj_t
inject_exc
);
void
mp_setup_code_state
(
mp_code_state
*
code_state
,
mp_obj_t
self_in
,
mp_uint_t
n_args
,
mp_uint_t
n_kw
,
const
mp_obj_t
*
args
);
void
mp_bytecode_print
(
const
void
*
descr
,
const
byte
*
code
,
in
t
len
);
void
mp_bytecode_print2
(
const
byte
*
code
,
in
t
len
);
void
mp_bytecode_print
(
const
void
*
descr
,
const
byte
*
code
,
mp_uint_
t
len
);
void
mp_bytecode_print2
(
const
byte
*
code
,
mp_uint_
t
len
);
// Helper macros to access pointer with least significant bit holding a flag
#define MP_TAGPTR_PTR(x) ((void*)((mp_uint_t)(x) & ~((mp_uint_t)1)))
...
...
py/binary.c
View file @
42f3de92
...
...
@@ -99,7 +99,7 @@ int mp_binary_get_size(char struct_type, char val_type, mp_uint_t *palign) {
return
size
;
}
mp_obj_t
mp_binary_get_val_array
(
char
typecode
,
void
*
p
,
in
t
index
)
{
mp_obj_t
mp_binary_get_val_array
(
char
typecode
,
void
*
p
,
mp_uint_
t
index
)
{
mp_int_t
val
=
0
;
switch
(
typecode
)
{
case
'b'
:
...
...
@@ -250,7 +250,7 @@ void mp_binary_set_val(char struct_type, char val_type, mp_obj_t val_in, byte **
mp_binary_set_int
(
MIN
(
size
,
sizeof
(
val
)),
struct_type
==
'>'
,
p
,
in
);
}
void
mp_binary_set_val_array
(
char
typecode
,
void
*
p
,
in
t
index
,
mp_obj_t
val_in
)
{
void
mp_binary_set_val_array
(
char
typecode
,
void
*
p
,
mp_uint_
t
index
,
mp_obj_t
val_in
)
{
switch
(
typecode
)
{
#if MICROPY_PY_BUILTINS_FLOAT
case
'f'
:
...
...
@@ -265,7 +265,7 @@ void mp_binary_set_val_array(char typecode, void *p, int index, mp_obj_t val_in)
}
}
void
mp_binary_set_val_array_from_int
(
char
typecode
,
void
*
p
,
in
t
index
,
mp_int_t
val
)
{
void
mp_binary_set_val_array_from_int
(
char
typecode
,
void
*
p
,
mp_uint_
t
index
,
mp_int_t
val
)
{
switch
(
typecode
)
{
case
'b'
:
((
int8_t
*
)
p
)[
index
]
=
val
;
...
...
py/binary.h
View file @
42f3de92
...
...
@@ -29,9 +29,9 @@
#define BYTEARRAY_TYPECODE 0
int
mp_binary_get_size
(
char
struct_type
,
char
val_type
,
mp_uint_t
*
palign
);
mp_obj_t
mp_binary_get_val_array
(
char
typecode
,
void
*
p
,
in
t
index
);
void
mp_binary_set_val_array
(
char
typecode
,
void
*
p
,
in
t
index
,
mp_obj_t
val_in
);
void
mp_binary_set_val_array_from_int
(
char
typecode
,
void
*
p
,
in
t
index
,
mp_int_t
val
);
mp_obj_t
mp_binary_get_val_array
(
char
typecode
,
void
*
p
,
mp_uint_
t
index
);
void
mp_binary_set_val_array
(
char
typecode
,
void
*
p
,
mp_uint_
t
index
,
mp_obj_t
val_in
);
void
mp_binary_set_val_array_from_int
(
char
typecode
,
void
*
p
,
mp_uint_
t
index
,
mp_int_t
val
);
mp_obj_t
mp_binary_get_val
(
char
struct_type
,
char
val_type
,
byte
**
ptr
);
void
mp_binary_set_val
(
char
struct_type
,
char
val_type
,
mp_obj_t
val_in
,
byte
**
ptr
);
long
long
mp_binary_get_int
(
mp_uint_t
size
,
bool
is_signed
,
bool
big_endian
,
byte
*
p
);
...
...
py/builtin.c
View file @
42f3de92
...
...
@@ -415,9 +415,9 @@ STATIC mp_obj_t mp_builtin_print(mp_uint_t n_args, const mp_obj_t *args, mp_map_
pfenv_t
pfenv
;
pfenv
.
data
=
stream_obj
;
pfenv
.
print_strn
=
(
void
(
*
)(
void
*
,
const
char
*
,
unsigned
in
t
))
mp_stream_write
;
pfenv
.
print_strn
=
(
void
(
*
)(
void
*
,
const
char
*
,
mp_uint_
t
))
mp_stream_write
;
#endif
for
(
in
t
i
=
0
;
i
<
n_args
;
i
++
)
{
for
(
mp_uint_
t
i
=
0
;
i
<
n_args
;
i
++
)
{
if
(
i
>
0
)
{
#if MICROPY_PY_IO
mp_stream_write
(
stream_obj
,
sep_data
,
sep_len
);
...
...
py/builtinimport.c
View file @
42f3de92
...
...
@@ -82,7 +82,7 @@ STATIC mp_import_stat_t find_file(const char *file_str, uint file_len, vstr_t *d
return
stat_dir_or_file
(
dest
);
}
else
{
// go through each path looking for a directory or file
for
(
in
t
i
=
0
;
i
<
path_num
;
i
++
)
{
for
(
mp_uint_
t
i
=
0
;
i
<
path_num
;
i
++
)
{
vstr_reset
(
dest
);
mp_uint_t
p_len
;
const
char
*
p
=
mp_obj_str_get_data
(
path_items
[
i
],
&
p_len
);
...
...
@@ -167,7 +167,7 @@ STATIC void do_load(mp_obj_t module_obj, vstr_t *file) {
mp_obj_t
mp_builtin___import__
(
mp_uint_t
n_args
,
mp_obj_t
*
args
)
{
#if DEBUG_PRINT
DEBUG_printf
(
"__import__:
\n
"
);
for
(
in
t
i
=
0
;
i
<
n_args
;
i
++
)
{
for
(
mp_uint_
t
i
=
0
;
i
<
n_args
;
i
++
)
{
DEBUG_printf
(
" "
);
mp_obj_print
(
args
[
i
],
PRINT_REPR
);
DEBUG_printf
(
"
\n
"
);
...
...
@@ -176,7 +176,7 @@ mp_obj_t mp_builtin___import__(mp_uint_t n_args, mp_obj_t *args) {
mp_obj_t
module_name
=
args
[
0
];
mp_obj_t
fromtuple
=
mp_const_none
;
in
t
level
=
0
;
mp_int_
t
level
=
0
;
if
(
n_args
>=
4
)
{
fromtuple
=
args
[
3
];
if
(
n_args
>=
5
)
{
...
...
py/compile.c
View file @
42f3de92
...
...
@@ -493,7 +493,7 @@ STATIC void cpython_c_tuple_emit_const(compiler_t *comp, mp_parse_node_t pn, vst
return
;
}
in
t
arg
=
MP_PARSE_NODE_LEAF_ARG
(
pn
);
mp_uint_
t
arg
=
MP_PARSE_NODE_LEAF_ARG
(
pn
);
switch
(
MP_PARSE_NODE_LEAF_KIND
(
pn
))
{
case
MP_PARSE_NODE_ID
:
assert
(
0
);
case
MP_PARSE_NODE_INTEGER
:
vstr_printf
(
vstr
,
"%s"
,
qstr_str
(
arg
));
break
;
...
...
@@ -853,7 +853,7 @@ STATIC void c_assign(compiler_t *comp, mp_parse_node_t pn, assign_kind_t assign_
assert
(
0
);
}
else
if
(
MP_PARSE_NODE_IS_LEAF
(
pn
))
{
if
(
MP_PARSE_NODE_IS_ID
(
pn
))
{
int
arg
=
MP_PARSE_NODE_LEAF_ARG
(
pn
);
qstr
arg
=
MP_PARSE_NODE_LEAF_ARG
(
pn
);
switch
(
assign_kind
)
{
case
ASSIGN_STORE
:
case
ASSIGN_AUG_STORE
:
...
...
py/modstruct.c
View file @
42f3de92
...
...
@@ -164,7 +164,7 @@ STATIC mp_obj_t struct_pack(uint n_args, mp_obj_t *args) {
// TODO: "The arguments must match the values required by the format exactly."
const
char
*
fmt
=
mp_obj_str_get_str
(
args
[
0
]);
char
fmt_type
=
get_fmt_type
(
&
fmt
);
in
t
size
=
MP_OBJ_SMALL_INT_VALUE
(
struct_calcsize
(
args
[
0
]));
mp_int_
t
size
=
MP_OBJ_SMALL_INT_VALUE
(
struct_calcsize
(
args
[
0
]));
byte
*
p
;
mp_obj_t
res
=
mp_obj_str_builder_start
(
&
mp_type_bytes
,
size
,
&
p
);
memset
(
p
,
0
,
size
);
...
...
py/mpz.c
View file @
42f3de92
...
...
@@ -58,7 +58,7 @@
returns sign(i - j)
assumes i, j are normalised
*/
STATIC
mp_int_
t
mpn_cmp
(
const
mpz_dig_t
*
idig
,
mp_uint_t
ilen
,
const
mpz_dig_t
*
jdig
,
mp_uint_t
jlen
)
{
STATIC
in
t
mpn_cmp
(
const
mpz_dig_t
*
idig
,
mp_uint_t
ilen
,
const
mpz_dig_t
*
jdig
,
mp_uint_t
jlen
)
{
if
(
ilen
<
jlen
)
{
return
-
1
;
}
if
(
ilen
>
jlen
)
{
return
1
;
}
...
...
@@ -361,7 +361,7 @@ STATIC void mpn_div(mpz_dig_t *num_dig, mp_uint_t *num_len, mpz_dig_t *den_dig,
// handle simple cases
{
mp_int_
t
cmp
=
mpn_cmp
(
num_dig
,
*
num_len
,
den_dig
,
den_len
);
in
t
cmp
=
mpn_cmp
(
num_dig
,
*
num_len
,
den_dig
,
den_len
);
if
(
cmp
==
0
)
{
*
num_len
=
0
;
quo_dig
[
0
]
=
1
;
...
...
@@ -744,8 +744,8 @@ bool mpz_is_even(const mpz_t *z) {
return
z
->
len
==
0
||
(
z
->
dig
[
0
]
&
1
)
==
0
;
}
mp_int_
t
mpz_cmp
(
const
mpz_t
*
z1
,
const
mpz_t
*
z2
)
{
mp_int_
t
cmp
=
z2
->
neg
-
z1
->
neg
;
in
t
mpz_cmp
(
const
mpz_t
*
z1
,
const
mpz_t
*
z2
)
{
in
t
cmp
=
(
int
)
z2
->
neg
-
(
int
)
z1
->
neg
;
if
(
cmp
!=
0
)
{
return
cmp
;
}
...
...
py/mpz.h
View file @
42f3de92
...
...
@@ -88,7 +88,7 @@ bool mpz_is_neg(const mpz_t *z);
bool
mpz_is_odd
(
const
mpz_t
*
z
);
bool
mpz_is_even
(
const
mpz_t
*
z
);
mp_int_
t
mpz_cmp
(
const
mpz_t
*
lhs
,
const
mpz_t
*
rhs
);
in
t
mpz_cmp
(
const
mpz_t
*
lhs
,
const
mpz_t
*
rhs
);
mpz_t
*
mpz_abs
(
const
mpz_t
*
z
);
mpz_t
*
mpz_neg
(
const
mpz_t
*
z
);
...
...
py/obj.h
View file @
42f3de92
...
...
@@ -212,9 +212,9 @@ typedef struct _mp_buffer_info_t {
// them with ver = sizeof(struct). Cons: overkill for *micro*?
//int ver; // ?
void
*
buf
;
// can be NULL if len == 0
mp_int_t
len
;
// in bytes
; TODO should it be mp_uint_t?
int
typecode
;
// as per binary.h
; TODO what is the correct type to use?
void
*
buf
;
// can be NULL if len == 0
mp_
u
int_t
len
;
// in bytes
int
typecode
;
// as per binary.h
// Rationale: to load arbitrary-sized sprites directly to LCD
// Cons: a bit adhoc usecase
...
...
py/objarray.c
View file @
42f3de92
...
...
@@ -66,7 +66,7 @@ STATIC void array_print(void (*print)(void *env, const char *fmt, ...), void *en
print
(
env
,
"array('%c'"
,
o
->
typecode
);
if
(
o
->
len
>
0
)
{
print
(
env
,
", ["
);
for
(
in
t
i
=
0
;
i
<
o
->
len
;
i
++
)
{
for
(
mp_uint_
t
i
=
0
;
i
<
o
->
len
;
i
++
)
{
if
(
i
>
0
)
{
print
(
env
,
", "
);
}
...
...
@@ -92,7 +92,7 @@ STATIC mp_obj_t array_construct(char typecode, mp_obj_t initializer) {
mp_obj_t
iterable
=
mp_getiter
(
initializer
);
mp_obj_t
item
;
in
t
i
=
0
;
mp_uint_
t
i
=
0
;
while
((
item
=
mp_iternext
(
iterable
))
!=
MP_OBJ_STOP_ITERATION
)
{
if
(
len
==
0
)
{
array_append
(
array
,
item
);
...
...
@@ -210,7 +210,7 @@ STATIC mp_obj_t array_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value
return
res
;
#endif
}
else
{
uint
index
=
mp_get_index
(
o
->
base
.
type
,
o
->
len
,
index_in
,
false
);
mp_
uint
_t
index
=
mp_get_index
(
o
->
base
.
type
,
o
->
len
,
index_in
,
false
);
if
(
value
==
MP_OBJ_SENTINEL
)
{
// load
return
mp_binary_get_val_array
(
o
->
typecode
,
o
->
items
,
index
);
...
...
py/objint.c
View file @
42f3de92
...
...
@@ -88,8 +88,8 @@ void mp_obj_int_print(void (*print)(void *env, const char *fmt, ...), void *env,
// enough, a dynamic one will be allocated.
char
stack_buf
[
sizeof
(
mp_int_t
)
*
4
];
char
*
buf
=
stack_buf
;
in
t
buf_size
=
sizeof
(
stack_buf
);
in
t
fmt_size
;
mp_uint_
t
buf_size
=
sizeof
(
stack_buf
);
mp_uint_
t
fmt_size
;
char
*
str
=
mp_obj_int_formatted
(
&
buf
,
&
buf_size
,
&
fmt_size
,
self_in
,
10
,
NULL
,
'\0'
,
'\0'
);
print
(
env
,
"%s"
,
str
);
...
...
@@ -135,7 +135,7 @@ STATIC uint int_as_str_size_formatted(uint base, const char *prefix, char comma)
//
// The resulting formatted string will be returned from this function and the
// formatted size will be in *fmt_size.
char
*
mp_obj_int_formatted
(
char
**
buf
,
in
t
*
buf_size
,
in
t
*
fmt_size
,
mp_const_obj_t
self_in
,
char
*
mp_obj_int_formatted
(
char
**
buf
,
mp_uint_
t
*
buf_size
,
mp_uint_
t
*
fmt_size
,
mp_const_obj_t
self_in
,
int
base
,
const
char
*
prefix
,
char
base_char
,
char
comma
)
{
fmt_int_t
num
;
if
(
MP_OBJ_IS_SMALL_INT
(
self_in
))
{
...
...
py/objint.h
View file @
42f3de92
...
...
@@ -36,9 +36,9 @@ typedef struct _mp_obj_int_t {
extern
const
mp_obj_int_t
mp_maxsize_obj
;
void
mp_obj_int_print
(
void
(
*
print
)(
void
*
env
,
const
char
*
fmt
,
...),
void
*
env
,
mp_obj_t
self_in
,
mp_print_kind_t
kind
);
char
*
mp_obj_int_formatted
(
char
**
buf
,
in
t
*
buf_size
,
in
t
*
fmt_size
,
mp_const_obj_t
self_in
,
char
*
mp_obj_int_formatted
(
char
**
buf
,
mp_uint_
t
*
buf_size
,
mp_uint_
t
*
fmt_size
,
mp_const_obj_t
self_in
,
int
base
,
const
char
*
prefix
,
char
base_char
,
char
comma
);
char
*
mp_obj_int_formatted_impl
(
char
**
buf
,
in
t
*
buf_size
,
in
t
*
fmt_size
,
mp_const_obj_t
self_in
,
char
*
mp_obj_int_formatted_impl
(
char
**
buf
,
mp_uint_
t
*
buf_size
,
mp_uint_
t
*
fmt_size
,
mp_const_obj_t
self_in
,
int
base
,
const
char
*
prefix
,
char
base_char
,
char
comma
);
mp_int_t
mp_obj_int_hash
(
mp_obj_t
self_in
);
bool
mp_obj_int_is_positive
(
mp_obj_t
self_in
);
...
...
py/objint_mpz.c
View file @
42f3de92
...
...
@@ -81,12 +81,12 @@ STATIC mp_obj_int_t *mp_obj_int_new_mpz(void) {
// formatted size will be in *fmt_size.
//
// This particular routine should only be called for the mpz representation of the int.
char
*
mp_obj_int_formatted_impl
(
char
**
buf
,
in
t
*
buf_size
,
in
t
*
fmt_size
,
mp_const_obj_t
self_in
,
char
*
mp_obj_int_formatted_impl
(
char
**
buf
,
mp_uint_
t
*
buf_size
,
mp_uint_
t
*
fmt_size
,
mp_const_obj_t
self_in
,
int
base
,
const
char
*
prefix
,
char
base_char
,
char
comma
)
{
assert
(
MP_OBJ_IS_TYPE
(
self_in
,
&
mp_type_int
));
const
mp_obj_int_t
*
self
=
self_in
;
uint
needed_size
=
mpz_as_str_size
(
&
self
->
mpz
,
base
,
prefix
,
comma
);
mp_
uint
_t
needed_size
=
mpz_as_str_size
(
&
self
->
mpz
,
base
,
prefix
,
comma
);
if
(
needed_size
>
*
buf_size
)
{
*
buf
=
m_new
(
char
,
needed_size
);
*
buf_size
=
needed_size
;
...
...
py/objlist.c
View file @
42f3de92
...
...
@@ -164,7 +164,7 @@ STATIC mp_obj_t list_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) {
assert
(
0
);
}
in
t
len_adj
=
slice
.
start
-
slice
.
stop
;
mp_int_
t
len_adj
=
slice
.
start
-
slice
.
stop
;
//printf("Len adj: %d\n", len_adj);
assert
(
len_adj
<=
0
);
mp_seq_replace_slice_no_grow
(
self
->
items
,
self
->
len
,
slice
.
start
,
slice
.
stop
,
self
->
items
/*NULL*/
,
0
,
mp_obj_t
);
...
...
@@ -203,7 +203,7 @@ STATIC mp_obj_t list_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) {
if
(
!
mp_seq_get_fast_slice_indexes
(
self
->
len
,
index
,
&
slice_out
))
{
assert
(
0
);
}
in
t
len_adj
=
slice
->
len
-
(
slice_out
.
stop
-
slice_out
.
start
);
mp_int_
t
len_adj
=
slice
->
len
-
(
slice_out
.
stop
-
slice_out
.
start
);
//printf("Len adj: %d\n", len_adj);
if
(
len_adj
>
0
)
{
if
(
self
->
len
+
len_adj
>
self
->
alloc
)
{
...
...
py/objnamedtuple.c
View file @
42f3de92
...
...
@@ -81,7 +81,7 @@ STATIC uint namedtuple_count_fields(const char *namedef) {
STATIC
int
namedtuple_find_field
(
const
char
*
name
,
const
char
*
namedef
)
{
int
id
=
0
;
in
t
len
=
strlen
(
name
);
size_
t
len
=
strlen
(
name
);
while
(
namedef
)
{
if
(
memcmp
(
name
,
namedef
,
len
)
==
0
)
{
namedef
+=
len
;
...
...
@@ -101,9 +101,9 @@ STATIC void namedtuple_print(void (*print)(void *env, const char *fmt, ...), voi
print
(
env
,
"%s("
,
qstr_str
(
o
->
tuple
.
base
.
type
->
name
));
const
char
*
fields
=
((
mp_obj_namedtuple_type_t
*
)
o
->
tuple
.
base
.
type
)
->
fields
;
for
(
in
t
i
=
0
;
i
<
o
->
tuple
.
len
;
i
++
)
{
for
(
mp_uint_
t
i
=
0
;
i
<
o
->
tuple
.
len
;
i
++
)
{
if
(
i
>
0
)
{
print
(
env
,
", "
);
print
(
env
,
", "
);
}
const
char
*
next
=
fields
;
...
...
py/objrange.c
View file @
42f3de92
...
...
@@ -63,7 +63,7 @@ STATIC const mp_obj_type_t range_it_type = {
.
iternext
=
range_it_iternext
,
};
mp_obj_t
mp_obj_new_range_iterator
(
int
cur
,
in
t
stop
,
in
t
step
)
{
STATIC
mp_obj_t
mp_obj_new_range_iterator
(
mp_
int
_t
cur
,
mp_int_
t
stop
,
mp_int_
t
step
)
{
mp_obj_range_it_t
*
o
=
m_new_obj
(
mp_obj_range_it_t
);
o
->
base
.
type
=
&
range_it_type
;
o
->
cur
=
cur
;
...
...
py/parse.h
View file @
42f3de92
...
...
@@ -68,7 +68,6 @@ typedef struct _mp_parse_node_struct_t {
#define MP_PARSE_NODE_IS_TOKEN_KIND(pn, k) ((pn) == (MP_PARSE_NODE_TOKEN | ((k) << 5)))
#define MP_PARSE_NODE_LEAF_KIND(pn) ((pn) & 0x1f)
// TODO should probably have int and uint versions of this macro
#define MP_PARSE_NODE_LEAF_ARG(pn) (((mp_uint_t)(pn)) >> 5)
#define MP_PARSE_NODE_LEAF_SMALL_INT(pn) (((mp_int_t)(pn)) >> 1)
#define MP_PARSE_NODE_STRUCT_KIND(pns) ((pns)->kind_num_nodes & 0xff)
...
...
py/pfenv.c
View file @
42f3de92
...
...
@@ -46,11 +46,11 @@
static
const
char
pad_spaces
[]
=
" "
;
static
const
char
pad_zeroes
[]
=
"0000000000000000"
;
void
pfenv_vstr_add_strn
(
void
*
data
,
const
char
*
str
,
unsigned
in
t
len
){
void
pfenv_vstr_add_strn
(
void
*
data
,
const
char
*
str
,
mp_uint_
t
len
){
vstr_add_strn
(
data
,
str
,
len
);
}
int
pfenv_print_strn
(
const
pfenv_t
*
pfenv
,
const
char
*
str
,
unsigned
in
t
len
,
int
flags
,
char
fill
,
int
width
)
{
int
pfenv_print_strn
(
const
pfenv_t
*
pfenv
,
const
char
*
str
,
mp_uint_
t
len
,
int
flags
,
char
fill
,
int
width
)
{
int
left_pad
=
0
;
int
right_pad
=
0
;
int
pad
=
width
-
len
;
...
...
@@ -234,8 +234,8 @@ int pfenv_print_mp_int(const pfenv_t *pfenv, mp_obj_t x, int sgn, int base, int
// enough, a dynamic one will be allocated.
char
stack_buf
[
sizeof
(
mp_int_t
)
*
4
];
char
*
buf
=
stack_buf
;
in
t
buf_size
=
sizeof
(
stack_buf
);
in
t
fmt_size
=
0
;
mp_uint_
t
buf_size
=
sizeof
(
stack_buf
);
mp_uint_
t
fmt_size
=
0
;
char
*
str
;
if
(
prec
>
1
)
{
...
...
Prev
1
2
Next
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