summaryrefslogtreecommitdiffstatshomepage
path: root/py/obj.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-02-15 11:34:50 +0000
committerDamien George <damien.p.george@gmail.com>2014-02-15 11:34:50 +0000
commita71c83a1d1aeca1d81d7c673929f8e836dec131e (patch)
tree5c49441e19c3feffbc792eec7ecfbc3ca3036830 /py/obj.h
parent8ac72b9d000ecc48a2d558bdb7c73c7f98d4be62 (diff)
downloadmicropython-a71c83a1d1aeca1d81d7c673929f8e836dec131e.tar.gz
micropython-a71c83a1d1aeca1d81d7c673929f8e836dec131e.zip
Change mp_obj_type_t.name from const char * to qstr.
Ultimately all static strings should be qstr. This entry in the type structure is only used for printing error messages (to tell the type of the bad argument), and printing objects that don't supply a .print method.
Diffstat (limited to 'py/obj.h')
-rw-r--r--py/obj.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/py/obj.h b/py/obj.h
index 4982d5bc23..bed119c0a2 100644
--- a/py/obj.h
+++ b/py/obj.h
@@ -142,7 +142,7 @@ typedef struct _mp_stream_p_t {
struct _mp_obj_type_t {
mp_obj_base_t base;
- const char *name;
+ qstr name;
mp_print_fun_t print;
mp_make_new_fun_t make_new; // to make an instance of the type
@@ -150,6 +150,12 @@ struct _mp_obj_type_t {
mp_unary_op_fun_t unary_op; // can return NULL if op not supported
mp_binary_op_fun_t binary_op; // can return NULL if op not supported
+ mp_load_attr_fun_t load_attr;
+ mp_store_attr_fun_t store_attr;
+ // Implements container[index] = val; note that load_item is implemented
+ // by binary_op(RT_BINARY_OP_SUBSCR)
+ mp_store_item_fun_t store_item;
+
mp_fun_1_t getiter;
mp_fun_1_t iternext;
@@ -161,12 +167,6 @@ struct _mp_obj_type_t {
const mp_method_t *methods;
- mp_load_attr_fun_t load_attr;
- mp_store_attr_fun_t store_attr;
- // Implements container[index] = val; note that load_item is implemented
- // by binary_op(RT_BINARY_OP_SUBSCR)
- mp_store_item_fun_t store_item;
-
// these are for dynamically created types (classes)
mp_obj_t bases_tuple;
mp_obj_t locals_dict;
@@ -200,7 +200,7 @@ extern const mp_obj_t mp_const_stop_iteration; // special object indicating end
// General API for objects
-mp_obj_t mp_obj_new_type(const char *name, mp_obj_t bases_tuple, mp_obj_t locals_dict);
+mp_obj_t mp_obj_new_type(qstr name, mp_obj_t bases_tuple, mp_obj_t locals_dict);
mp_obj_t mp_obj_new_none(void);
mp_obj_t mp_obj_new_bool(bool value);
mp_obj_t mp_obj_new_cell(mp_obj_t obj);