summaryrefslogtreecommitdiffstatshomepage
path: root/py/obj.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-05-21 19:42:43 +0100
committerDamien George <damien.p.george@gmail.com>2014-05-21 19:42:43 +0100
commit6ac5dced2441bf63dbc65acbd7e33fb71d1d3ede (patch)
treefa0c99f00806dda3e9bf469245bb0b3870c4a101 /py/obj.h
parent6d197740cf7067c65f40574f7cf0707480bbf461 (diff)
downloadmicropython-6ac5dced2441bf63dbc65acbd7e33fb71d1d3ede.tar.gz
micropython-6ac5dced2441bf63dbc65acbd7e33fb71d1d3ede.zip
py: Rename MP_OBJ_NOT_SUPPORTED to MP_OBJ_NULL.
See issue #608 for justification.
Diffstat (limited to 'py/obj.h')
-rw-r--r--py/obj.h19
1 files changed, 8 insertions, 11 deletions
diff --git a/py/obj.h b/py/obj.h
index 14ced0691a..2df597de75 100644
--- a/py/obj.h
+++ b/py/obj.h
@@ -52,8 +52,7 @@ typedef struct _mp_obj_base_t mp_obj_base_t;
// These fake objects are used to indicate certain things in arguments or return
// values, and should only be used when explicitly allowed.
//
-// - MP_OBJ_NULL : used to indicate the absence of an object.
-// - MP_OBJ_NOT_SUPPORTED : a return value that indicates an unsupported operation.
+// - MP_OBJ_NULL : used to indicate the absence of an object, or unsupported operation.
// - MP_OBJ_STOP_ITERATION : used instead of throwing a StopIteration, for efficiency.
// - MP_OBJ_SENTINEL : used for various internal purposes where one needs
// an object which is unique from all other objects, including MP_OBJ_NULL.
@@ -63,14 +62,12 @@ typedef struct _mp_obj_base_t mp_obj_base_t;
#if NDEBUG
#define MP_OBJ_NULL ((mp_obj_t)0)
-#define MP_OBJ_NOT_SUPPORTED ((mp_obj_t)0)
#define MP_OBJ_STOP_ITERATION ((mp_obj_t)0)
#define MP_OBJ_SENTINEL ((mp_obj_t)4)
#else
#define MP_OBJ_NULL ((mp_obj_t)0)
-#define MP_OBJ_NOT_SUPPORTED ((mp_obj_t)4)
-#define MP_OBJ_STOP_ITERATION ((mp_obj_t)8)
-#define MP_OBJ_SENTINEL ((mp_obj_t)12)
+#define MP_OBJ_STOP_ITERATION ((mp_obj_t)4)
+#define MP_OBJ_SENTINEL ((mp_obj_t)8)
#endif
// These macros check for small int, qstr or object, and access small int and qstr values
@@ -256,15 +253,15 @@ struct _mp_obj_type_t {
mp_make_new_fun_t make_new; // to make an instance of the type
mp_call_fun_t call;
- mp_unary_op_fun_t unary_op; // can return MP_OBJ_NOT_SUPPORTED if op not supported
- mp_binary_op_fun_t binary_op; // can return MP_OBJ_NOT_SUPPORTED if op not supported
+ mp_unary_op_fun_t unary_op; // can return MP_OBJ_NULL if op not supported
+ mp_binary_op_fun_t binary_op; // can return MP_OBJ_NULL if op not supported
mp_load_attr_fun_t load_attr;
mp_store_attr_fun_t store_attr; // if value is MP_OBJ_NULL, then delete that attribute
mp_subscr_fun_t subscr; // implements load, store, delete subscripting
// value=MP_OBJ_NULL means delete, value=MP_OBJ_SENTINEL means load, else store
- // can return MP_OBJ_NOT_SUPPORTED
+ // can return MP_OBJ_NULL if op not supported
mp_fun_1_t getiter;
mp_fun_1_t iternext; // may return MP_OBJ_STOP_ITERATION as an optimisation instead of raising StopIteration() (with no args)
@@ -483,11 +480,11 @@ typedef struct _mp_obj_float_t {
mp_float_t value;
} mp_obj_float_t;
mp_float_t mp_obj_float_get(mp_obj_t self_in);
-mp_obj_t mp_obj_float_binary_op(int op, mp_float_t lhs_val, mp_obj_t rhs); // can return MP_OBJ_NOT_SUPPORTED
+mp_obj_t mp_obj_float_binary_op(int op, mp_float_t lhs_val, mp_obj_t rhs); // can return MP_OBJ_NULL if op not supported
// complex
void mp_obj_complex_get(mp_obj_t self_in, mp_float_t *real, mp_float_t *imag);
-mp_obj_t mp_obj_complex_binary_op(int op, mp_float_t lhs_real, mp_float_t lhs_imag, mp_obj_t rhs_in); // can return MP_OBJ_NOT_SUPPORTED
+mp_obj_t mp_obj_complex_binary_op(int op, mp_float_t lhs_real, mp_float_t lhs_imag, mp_obj_t rhs_in); // can return MP_OBJ_NULL if op not supported
#endif
// tuple