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
GitLab 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
fa1edff0
Commit
fa1edff0
authored
Mar 14, 2015
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
py: Remove unnecessary and unused sgn argument from pfenv_print_mp_int.
parent
6837d46c
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
py/objstr.c
+7
-7
7 additions, 7 deletions
py/objstr.c
py/pfenv.c
+1
-3
1 addition, 3 deletions
py/pfenv.c
py/pfenv.h
+1
-1
1 addition, 1 deletion
py/pfenv.h
with
9 additions
and
11 deletions
py/objstr.c
+
7
−
7
View file @
fa1edff0
...
...
@@ -1083,7 +1083,7 @@ mp_obj_t mp_obj_str_format(mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kwa
if
(
arg_looks_integer
(
arg
))
{
switch
(
type
)
{
case
'b'
:
pfenv_print_mp_int
(
&
pfenv_vstr
,
arg
,
1
,
2
,
'a'
,
flags
,
fill
,
width
,
0
);
pfenv_print_mp_int
(
&
pfenv_vstr
,
arg
,
2
,
'a'
,
flags
,
fill
,
width
,
0
);
continue
;
case
'c'
:
...
...
@@ -1096,7 +1096,7 @@ mp_obj_t mp_obj_str_format(mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kwa
case
'\0'
:
// No explicit format type implies 'd'
case
'n'
:
// I don't think we support locales in uPy so use 'd'
case
'd'
:
pfenv_print_mp_int
(
&
pfenv_vstr
,
arg
,
1
,
10
,
'a'
,
flags
,
fill
,
width
,
0
);
pfenv_print_mp_int
(
&
pfenv_vstr
,
arg
,
10
,
'a'
,
flags
,
fill
,
width
,
0
);
continue
;
case
'o'
:
...
...
@@ -1104,12 +1104,12 @@ mp_obj_t mp_obj_str_format(mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kwa
flags
|=
PF_FLAG_SHOW_OCTAL_LETTER
;
}
pfenv_print_mp_int
(
&
pfenv_vstr
,
arg
,
1
,
8
,
'a'
,
flags
,
fill
,
width
,
0
);
pfenv_print_mp_int
(
&
pfenv_vstr
,
arg
,
8
,
'a'
,
flags
,
fill
,
width
,
0
);
continue
;
case
'X'
:
case
'x'
:
pfenv_print_mp_int
(
&
pfenv_vstr
,
arg
,
1
,
16
,
type
-
(
'X'
-
'A'
),
flags
,
fill
,
width
,
0
);
pfenv_print_mp_int
(
&
pfenv_vstr
,
arg
,
16
,
type
-
(
'X'
-
'A'
),
flags
,
fill
,
width
,
0
);
continue
;
case
'e'
:
...
...
@@ -1377,7 +1377,7 @@ not_enough_args:
case
'd'
:
case
'i'
:
case
'u'
:
pfenv_print_mp_int
(
&
pfenv_vstr
,
arg_as_int
(
arg
),
1
,
10
,
'a'
,
flags
,
fill
,
width
,
prec
);
pfenv_print_mp_int
(
&
pfenv_vstr
,
arg_as_int
(
arg
),
10
,
'a'
,
flags
,
fill
,
width
,
prec
);
break
;
#if MICROPY_PY_BUILTINS_FLOAT
...
...
@@ -1395,7 +1395,7 @@ not_enough_args:
if
(
alt
)
{
flags
|=
(
PF_FLAG_SHOW_PREFIX
|
PF_FLAG_SHOW_OCTAL_LETTER
);
}
pfenv_print_mp_int
(
&
pfenv_vstr
,
arg
,
1
,
8
,
'a'
,
flags
,
fill
,
width
,
prec
);
pfenv_print_mp_int
(
&
pfenv_vstr
,
arg
,
8
,
'a'
,
flags
,
fill
,
width
,
prec
);
break
;
case
'r'
:
...
...
@@ -1419,7 +1419,7 @@ not_enough_args:
case
'X'
:
case
'x'
:
pfenv_print_mp_int
(
&
pfenv_vstr
,
arg
,
1
,
16
,
*
str
-
(
'X'
-
'A'
),
flags
|
alt
,
fill
,
width
,
prec
);
pfenv_print_mp_int
(
&
pfenv_vstr
,
arg
,
16
,
*
str
-
(
'X'
-
'A'
),
flags
|
alt
,
fill
,
width
,
prec
);
break
;
default:
...
...
This diff is collapsed.
Click to expand it.
py/pfenv.c
+
1
−
3
View file @
fa1edff0
...
...
@@ -178,9 +178,7 @@ int pfenv_print_int(const pfenv_t *pfenv, mp_uint_t x, int sgn, int base, int ba
return
len
;
}
int
pfenv_print_mp_int
(
const
pfenv_t
*
pfenv
,
mp_obj_t
x
,
int
sgn
,
int
base
,
int
base_char
,
int
flags
,
char
fill
,
int
width
,
int
prec
)
{
(
void
)
sgn
;
// TODO why is sgn unused?
int
pfenv_print_mp_int
(
const
pfenv_t
*
pfenv
,
mp_obj_t
x
,
int
base
,
int
base_char
,
int
flags
,
char
fill
,
int
width
,
int
prec
)
{
if
(
!
MP_OBJ_IS_INT
(
x
))
{
// This will convert booleans to int, or raise an error for
// non-integer types.
...
...
This diff is collapsed.
Click to expand it.
py/pfenv.h
+
1
−
1
View file @
fa1edff0
...
...
@@ -51,7 +51,7 @@ void pfenv_vstr_add_strn(void *data, const char *str, mp_uint_t len);
int
pfenv_print_strn
(
const
pfenv_t
*
pfenv
,
const
char
*
str
,
mp_uint_t
len
,
int
flags
,
char
fill
,
int
width
);
int
pfenv_print_int
(
const
pfenv_t
*
pfenv
,
mp_uint_t
x
,
int
sgn
,
int
base
,
int
base_char
,
int
flags
,
char
fill
,
int
width
);
int
pfenv_print_mp_int
(
const
pfenv_t
*
pfenv
,
mp_obj_t
x
,
int
sgn
,
int
base
,
int
base_char
,
int
flags
,
char
fill
,
int
width
,
int
prec
);
int
pfenv_print_mp_int
(
const
pfenv_t
*
pfenv
,
mp_obj_t
x
,
int
base
,
int
base_char
,
int
flags
,
char
fill
,
int
width
,
int
prec
);
#if MICROPY_PY_BUILTINS_FLOAT
int
pfenv_print_float
(
const
pfenv_t
*
pfenv
,
mp_float_t
f
,
char
fmt
,
int
flags
,
char
fill
,
int
width
,
int
prec
);
#endif
...
...
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