Renamed cosmoV_readObj to cosmoV_readRef to reduce ambiguity

also fixed several typos
This commit is contained in:
2021-02-07 14:00:00 -06:00
parent 5faa40bdef
commit 8d37f1f243
10 changed files with 48 additions and 48 deletions

View File

@@ -119,18 +119,18 @@ typedef struct CObjUpval {
#define IS_METHOD(x) isObjType(x, COBJ_METHOD)
#define IS_CLOSURE(x) isObjType(x, COBJ_CLOSURE)
#define cosmoV_readString(x) ((CObjString*)cosmoV_readObj(x))
#define cosmoV_readObject(x) ((CObjObject*)cosmoV_readObj(x))
#define cosmoV_readTable(x) ((CObjTable*)cosmoV_readObj(x))
#define cosmoV_readFunction(x) ((CObjFunction*)cosmoV_readObj(x))
#define cosmoV_readCFunction(x) (((CObjCFunction*)cosmoV_readObj(x))->cfunc)
#define cosmoV_readMethod(x) ((CObjMethod*)cosmoV_readObj(x))
#define cosmoV_readClosure(x) ((CObjClosure*)cosmoV_readObj(x))
#define cosmoV_readString(x) ((CObjString*)cosmoV_readRef(x))
#define cosmoV_readObject(x) ((CObjObject*)cosmoV_readRef(x))
#define cosmoV_readTable(x) ((CObjTable*)cosmoV_readRef(x))
#define cosmoV_readFunction(x) ((CObjFunction*)cosmoV_readRef(x))
#define cosmoV_readCFunction(x) (((CObjCFunction*)cosmoV_readRef(x))->cfunc)
#define cosmoV_readMethod(x) ((CObjMethod*)cosmoV_readRef(x))
#define cosmoV_readClosure(x) ((CObjClosure*)cosmoV_readRef(x))
#define cosmoO_readCString(x) ((CObjString*)x)->str
static inline bool isObjType(CValue val, CObjType type) {
return IS_OBJ(val) && cosmoV_readObj(val)->type == type;
return IS_OBJ(val) && cosmoV_readRef(val)->type == type;
}
// just protects against macro expansion