diff options
author | Damien George <damien.p.george@gmail.com> | 2014-02-15 11:34:50 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-02-15 11:34:50 +0000 |
commit | a71c83a1d1aeca1d81d7c673929f8e836dec131e (patch) | |
tree | 5c49441e19c3feffbc792eec7ecfbc3ca3036830 /unix/main.c | |
parent | 8ac72b9d000ecc48a2d558bdb7c73c7f98d4be62 (diff) |
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 'unix/main.c')
-rw-r--r-- | unix/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/unix/main.c b/unix/main.c index 716c7b114..6aafe94dd 100644 --- a/unix/main.c +++ b/unix/main.c @@ -195,7 +195,7 @@ static const mp_method_t test_methods[] = { static const mp_obj_type_t test_type = { { &mp_const_type }, - "Test", + .name = MP_QSTR_Test, .print = test_print, .methods = test_methods, }; @@ -308,7 +308,7 @@ int main(int argc, char **argv) { // test_obj = TestClass() // test_obj.attr = 42 mp_obj_t test_class_type, test_class_instance; - test_class_type = mp_obj_new_type("TestClass", mp_const_empty_tuple, mp_obj_new_dict(0)); + test_class_type = mp_obj_new_type(QSTR_FROM_STR_STATIC("TestClass"), mp_const_empty_tuple, mp_obj_new_dict(0)); rt_store_name(QSTR_FROM_STR_STATIC("test_obj"), test_class_instance = rt_call_function_0(test_class_type)); rt_store_attr(test_class_instance, QSTR_FROM_STR_STATIC("attr"), mp_obj_new_int(42)); |