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
83229d3f
Commit
83229d3f
authored
9 years ago
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
py: Use MP_OBJ_NULL instead of NULL when appropriate.
parent
54df549b
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
py/map.c
+1
-1
1 addition, 1 deletion
py/map.c
py/objdict.c
+2
-2
2 additions, 2 deletions
py/objdict.c
with
3 additions
and
3 deletions
py/map.c
+
1
−
1
View file @
83229d3f
...
@@ -306,7 +306,7 @@ mp_obj_t mp_set_lookup(mp_set_t *set, mp_obj_t index, mp_map_lookup_kind_t looku
...
@@ -306,7 +306,7 @@ mp_obj_t mp_set_lookup(mp_set_t *set, mp_obj_t index, mp_map_lookup_kind_t looku
if
(
lookup_kind
&
MP_MAP_LOOKUP_ADD_IF_NOT_FOUND
)
{
if
(
lookup_kind
&
MP_MAP_LOOKUP_ADD_IF_NOT_FOUND
)
{
mp_set_rehash
(
set
);
mp_set_rehash
(
set
);
}
else
{
}
else
{
return
NULL
;
return
MP_OBJ_
NULL
;
}
}
}
}
mp_uint_t
hash
=
MP_OBJ_SMALL_INT_VALUE
(
mp_unary_op
(
MP_UNARY_OP_HASH
,
index
));
mp_uint_t
hash
=
MP_OBJ_SMALL_INT_VALUE
(
mp_unary_op
(
MP_UNARY_OP_HASH
,
index
));
...
...
This diff is collapsed.
Click to expand it.
py/objdict.c
+
2
−
2
View file @
83229d3f
...
@@ -251,7 +251,7 @@ STATIC mp_obj_t dict_fromkeys(mp_uint_t n_args, const mp_obj_t *args) {
...
@@ -251,7 +251,7 @@ STATIC mp_obj_t dict_fromkeys(mp_uint_t n_args, const mp_obj_t *args) {
mp_obj_t
iter
=
mp_getiter
(
args
[
1
]);
mp_obj_t
iter
=
mp_getiter
(
args
[
1
]);
mp_obj_t
len
=
mp_obj_len_maybe
(
iter
);
mp_obj_t
len
=
mp_obj_len_maybe
(
iter
);
mp_obj_t
value
=
mp_const_none
;
mp_obj_t
value
=
mp_const_none
;
mp_obj_t
next
=
NULL
;
mp_obj_t
next
=
MP_OBJ_
NULL
;
mp_obj_t
self_out
;
mp_obj_t
self_out
;
if
(
n_args
>
2
)
{
if
(
n_args
>
2
)
{
...
@@ -374,7 +374,7 @@ STATIC mp_obj_t dict_update(mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kw
...
@@ -374,7 +374,7 @@ STATIC mp_obj_t dict_update(mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kw
}
else
{
}
else
{
// update from a generic iterable of pairs
// update from a generic iterable of pairs
mp_obj_t
iter
=
mp_getiter
(
args
[
1
]);
mp_obj_t
iter
=
mp_getiter
(
args
[
1
]);
mp_obj_t
next
=
NULL
;
mp_obj_t
next
=
MP_OBJ_
NULL
;
while
((
next
=
mp_iternext
(
iter
))
!=
MP_OBJ_STOP_ITERATION
)
{
while
((
next
=
mp_iternext
(
iter
))
!=
MP_OBJ_STOP_ITERATION
)
{
mp_obj_t
inneriter
=
mp_getiter
(
next
);
mp_obj_t
inneriter
=
mp_getiter
(
next
);
mp_obj_t
key
=
mp_iternext
(
inneriter
);
mp_obj_t
key
=
mp_iternext
(
inneriter
);
...
...
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