Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
90ab191b
Commit
90ab191b
authored
8 years ago
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
py/objstr: Convert some instances of mp_uint_t to size_t.
parent
50a9dd59
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
py/objstr.c
+10
-10
10 additions, 10 deletions
py/objstr.c
with
10 additions
and
10 deletions
py/objstr.c
+
10
−
10
View file @
90ab191b
...
...
@@ -36,7 +36,7 @@
#include
"py/runtime.h"
#include
"py/stackctrl.h"
STATIC
mp_obj_t
str_modulo_format
(
mp_obj_t
pattern
,
mp_uint
_t
n_args
,
const
mp_obj_t
*
args
,
mp_obj_t
dict
);
STATIC
mp_obj_t
str_modulo_format
(
mp_obj_t
pattern
,
size
_t
n_args
,
const
mp_obj_t
*
args
,
mp_obj_t
dict
);
STATIC
mp_obj_t
mp_obj_new_bytes_iterator
(
mp_obj_t
str
);
STATIC
NORETURN
void
bad_implicit_conversion
(
mp_obj_t
self_in
);
...
...
@@ -654,7 +654,7 @@ STATIC mp_obj_t str_rsplit(size_t n_args, const mp_obj_t *args) {
return
MP_OBJ_FROM_PTR
(
res
);
}
STATIC
mp_obj_t
str_finder
(
mp_uint
_t
n_args
,
const
mp_obj_t
*
args
,
mp_int_t
direction
,
bool
is_index
)
{
STATIC
mp_obj_t
str_finder
(
size
_t
n_args
,
const
mp_obj_t
*
args
,
mp_int_t
direction
,
bool
is_index
)
{
const
mp_obj_type_t
*
self_type
=
mp_obj_get_type
(
args
[
0
]);
mp_check_self
(
MP_OBJ_IS_STR_OR_BYTES
(
args
[
0
]));
...
...
@@ -740,7 +740,7 @@ STATIC mp_obj_t str_endswith(size_t n_args, const mp_obj_t *args) {
enum
{
LSTRIP
,
RSTRIP
,
STRIP
};
STATIC
mp_obj_t
str_uni_strip
(
int
type
,
mp_uint
_t
n_args
,
const
mp_obj_t
*
args
)
{
STATIC
mp_obj_t
str_uni_strip
(
int
type
,
size
_t
n_args
,
const
mp_obj_t
*
args
)
{
mp_check_self
(
MP_OBJ_IS_STR_OR_BYTES
(
args
[
0
]));
const
mp_obj_type_t
*
self_type
=
mp_obj_get_type
(
args
[
0
]);
...
...
@@ -892,7 +892,7 @@ STATIC NORETURN void terse_str_format_value_error(void) {
#define terse_str_format_value_error()
#endif
STATIC
vstr_t
mp_obj_str_format_helper
(
const
char
*
str
,
const
char
*
top
,
int
*
arg_i
,
mp_uint
_t
n_args
,
const
mp_obj_t
*
args
,
mp_map_t
*
kwargs
)
{
STATIC
vstr_t
mp_obj_str_format_helper
(
const
char
*
str
,
const
char
*
top
,
int
*
arg_i
,
size
_t
n_args
,
const
mp_obj_t
*
args
,
mp_map_t
*
kwargs
)
{
vstr_t
vstr
;
mp_print_t
print
;
vstr_init_print
(
&
vstr
,
16
,
&
print
);
...
...
@@ -1344,13 +1344,13 @@ mp_obj_t mp_obj_str_format(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs
return
mp_obj_new_str_from_vstr
(
&
mp_type_str
,
&
vstr
);
}
STATIC
mp_obj_t
str_modulo_format
(
mp_obj_t
pattern
,
mp_uint
_t
n_args
,
const
mp_obj_t
*
args
,
mp_obj_t
dict
)
{
STATIC
mp_obj_t
str_modulo_format
(
mp_obj_t
pattern
,
size
_t
n_args
,
const
mp_obj_t
*
args
,
mp_obj_t
dict
)
{
mp_check_self
(
MP_OBJ_IS_STR_OR_BYTES
(
pattern
));
GET_STR_DATA_LEN
(
pattern
,
str
,
len
);
const
byte
*
start_str
=
str
;
bool
is_bytes
=
MP_OBJ_IS_TYPE
(
pattern
,
&
mp_type_bytes
);
in
t
arg_i
=
0
;
size_
t
arg_i
=
0
;
vstr_t
vstr
;
mp_print_t
print
;
vstr_init_print
(
&
vstr
,
16
,
&
print
);
...
...
@@ -1409,7 +1409,7 @@ STATIC mp_obj_t str_modulo_format(mp_obj_t pattern, mp_uint_t n_args, const mp_o
int
width
=
0
;
if
(
str
<
top
)
{
if
(
*
str
==
'*'
)
{
if
(
(
uint
)
arg_i
>=
n_args
)
{
if
(
arg_i
>=
n_args
)
{
goto
not_enough_args
;
}
width
=
mp_obj_get_int
(
args
[
arg_i
++
]);
...
...
@@ -1422,7 +1422,7 @@ STATIC mp_obj_t str_modulo_format(mp_obj_t pattern, mp_uint_t n_args, const mp_o
if
(
str
<
top
&&
*
str
==
'.'
)
{
if
(
++
str
<
top
)
{
if
(
*
str
==
'*'
)
{
if
(
(
uint
)
arg_i
>=
n_args
)
{
if
(
arg_i
>=
n_args
)
{
goto
not_enough_args
;
}
prec
=
mp_obj_get_int
(
args
[
arg_i
++
]);
...
...
@@ -1445,7 +1445,7 @@ incomplete_format:
// Tuple value lookup
if
(
arg
==
MP_OBJ_NULL
)
{
if
(
(
uint
)
arg_i
>=
n_args
)
{
if
(
arg_i
>=
n_args
)
{
not_enough_args:
mp_raise_TypeError
(
"not enough arguments for format string"
);
}
...
...
@@ -1533,7 +1533,7 @@ not_enough_args:
}
}
if
(
(
uint
)
arg_i
!=
n_args
)
{
if
(
arg_i
!=
n_args
)
{
mp_raise_TypeError
(
"not all arguments converted during string formatting"
);
}
...
...
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