summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-10-23 12:06:53 +0100
committerDamien George <damien.p.george@gmail.com>2014-10-23 12:06:53 +0100
commit3aa09f5784bf06f2b23b0d0082cd244af53ca8a9 (patch)
treece74cbf835dbc40e08c133089c6701fb9d5fc7f2
parent37378f8a9d2b358fdde0f3451d816b7f506846cc (diff)
downloadmicropython-3aa09f5784bf06f2b23b0d0082cd244af53ca8a9.tar.gz
micropython-3aa09f5784bf06f2b23b0d0082cd244af53ca8a9.zip
py: Use MP_OBJ_NULL instead of NULL in a few places.
-rw-r--r--py/objstr.c2
-rw-r--r--py/objtype.c2
-rw-r--r--py/runtime.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/py/objstr.c b/py/objstr.c
index 7e6fd10ff7..b008dc6c17 100644
--- a/py/objstr.c
+++ b/py/objstr.c
@@ -215,7 +215,7 @@ STATIC mp_obj_t bytes_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_k
mp_int_t len;
byte *data;
vstr_t *vstr = NULL;
- mp_obj_t o = NULL;
+ mp_obj_t o = MP_OBJ_NULL;
// Try to create array of exact len if initializer len is known
mp_obj_t len_in = mp_obj_len_maybe(args[0]);
if (len_in == MP_OBJ_NULL) {
diff --git a/py/objtype.c b/py/objtype.c
index 89ace54604..cb6b957336 100644
--- a/py/objtype.c
+++ b/py/objtype.c
@@ -292,7 +292,7 @@ mp_obj_t instance_make_new(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, c
o = new_ret;
// now call Python class __init__ function with all args
- init_fn[0] = init_fn[1] = NULL;
+ init_fn[0] = init_fn[1] = MP_OBJ_NULL;
lookup.obj = o;
lookup.attr = MP_QSTR___init__;
lookup.meth_offset = 0;
diff --git a/py/runtime.c b/py/runtime.c
index 6efab0480c..8acd099804 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -475,8 +475,8 @@ mp_obj_t mp_binary_op(mp_uint_t op, mp_obj_t lhs, mp_obj_t rhs) {
}
if (type->getiter != NULL) {
/* second attempt, walk the iterator */
- mp_obj_t next = NULL;
mp_obj_t iter = mp_getiter(rhs);
+ mp_obj_t next;
while ((next = mp_iternext(iter)) != MP_OBJ_STOP_ITERATION) {
if (mp_obj_equal(next, lhs)) {
return mp_const_true;