@@ -13,7 +13,7 @@ struct VTable {
13
13
this ->Swap (other);
14
14
return *this ;
15
15
}
16
- ~VTable () { MLC_CHECK_ERR (::MLCVTableDelete (self), nullptr ); }
16
+ ~VTable () { MLC_CHECK_ERR (::MLCVTableDelete (self)); }
17
17
18
18
template <typename R, typename ... Args> R operator ()(Args... args) const ;
19
19
template <typename Obj> VTable &Set (Func func);
@@ -41,17 +41,17 @@ struct Lib {
41
41
static FuncObj *_init (int32_t type_index) { return VTableGetFunc (init, type_index, " __init__" ); }
42
42
static VTable MakeVTable (const char *name) {
43
43
MLCVTableHandle vtable = nullptr ;
44
- MLC_CHECK_ERR (::MLCVTableCreate (_lib, name, &vtable), nullptr );
44
+ MLC_CHECK_ERR (::MLCVTableCreate (_lib, name, &vtable));
45
45
return VTable (vtable);
46
46
}
47
47
MLC_INLINE static MLCTypeInfo *GetTypeInfo (int32_t type_index) {
48
48
MLCTypeInfo *type_info = nullptr ;
49
- MLC_CHECK_ERR (::MLCTypeIndex2Info (_lib, type_index, &type_info), nullptr );
49
+ MLC_CHECK_ERR (::MLCTypeIndex2Info (_lib, type_index, &type_info));
50
50
return type_info;
51
51
}
52
52
MLC_INLINE static MLCTypeInfo *GetTypeInfo (const char *type_key) {
53
53
MLCTypeInfo *type_info = nullptr ;
54
- MLC_CHECK_ERR (::MLCTypeKey2Info (_lib, type_key, &type_info), nullptr );
54
+ MLC_CHECK_ERR (::MLCTypeKey2Info (_lib, type_key, &type_info));
55
55
return type_info;
56
56
}
57
57
MLC_INLINE static const char *GetTypeKey (int32_t type_index) {
@@ -77,14 +77,14 @@ struct Lib {
77
77
}
78
78
MLC_INLINE static MLCTypeInfo *TypeRegister (int32_t parent_type_index, int32_t type_index, const char *type_key) {
79
79
MLCTypeInfo *info = nullptr ;
80
- MLC_CHECK_ERR (::MLCTypeRegister (_lib, parent_type_index, type_key, type_index, &info), nullptr );
80
+ MLC_CHECK_ERR (::MLCTypeRegister (_lib, parent_type_index, type_key, type_index, &info));
81
81
return info;
82
82
}
83
83
84
84
private:
85
85
static FuncObj *VTableGetFunc (MLCVTableHandle vtable, int32_t type_index, const char *vtable_name) {
86
86
MLCAny func{};
87
- MLC_CHECK_ERR (::MLCVTableGetFunc (vtable, type_index, true , &func), &func );
87
+ MLC_CHECK_ERR (::MLCVTableGetFunc (vtable, type_index, true , &func));
88
88
if (!::mlc::base::IsTypeIndexPOD (func.type_index )) {
89
89
::mlc::base::DecRef (func.v.v_obj);
90
90
}
@@ -100,12 +100,12 @@ struct Lib {
100
100
}
101
101
static MLCVTableHandle VTableGetGlobal (const char *name) {
102
102
MLCVTableHandle ret = nullptr ;
103
- MLC_CHECK_ERR (::MLCVTableGetGlobal (_lib, name, &ret), nullptr );
103
+ MLC_CHECK_ERR (::MLCVTableGetGlobal (_lib, name, &ret));
104
104
return ret;
105
105
}
106
106
static MLC_SYMBOL_HIDE inline MLCTypeTableHandle _lib = []() {
107
107
MLCTypeTableHandle ret = nullptr ;
108
- MLC_CHECK_ERR (::MLCHandleGetGlobal (&ret), nullptr );
108
+ MLC_CHECK_ERR (::MLCHandleGetGlobal (&ret));
109
109
return ret;
110
110
}();
111
111
static MLC_SYMBOL_HIDE inline MLCVTableHandle cxx_str = VTableGetGlobal(" __cxx_str__" );
0 commit comments