Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 588da6a

Browse files
committed
libfoundation: Refactor __MCAssertIsStream() to use type info.
In LC8, the `__MCAssertIsStream()` macro can be implemented more cleanly around type info objects. The previous implementation doesn't work any more anyway.
1 parent 7420ec4 commit 588da6a

2 files changed

Lines changed: 1 addition & 9 deletions

File tree

libfoundation/src/foundation-private.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -452,12 +452,6 @@ inline MCValueTypeCode __MCValueGetTypeCode(__MCValue *self)
452452
return (self -> flags >> 28);
453453
}
454454

455-
inline const MCValueCustomCallbacks *
456-
__MCValueGetCustomCallbacks(__MCValue *self)
457-
{
458-
return reinterpret_cast<__MCCustomValue *>(self)->callbacks;
459-
}
460-
461455
template<class T> inline bool __MCValueCreate(MCValueTypeCode p_type_code, T*& r_value)
462456
{
463457
__MCValue *t_value;

libfoundation/src/foundation-stream.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,7 @@ static MCValueCustomCallbacks kMCStreamCustomValueCallbacks =
312312
static inline void __MCAssertIsStream(MCStreamRef ref)
313313
{
314314
__MCValue *val = reinterpret_cast<__MCValue *>(ref);
315-
MCAssert(nil != val &&
316-
__MCValueGetTypeCode(val) == kMCValueTypeCodeCustom &&
317-
__MCValueGetCustomCallbacks(val) == &kMCStreamCustomValueCallbacks);
315+
MCAssert(MCValueGetTypeInfo(val) == kMCStreamTypeInfo);
318316
}
319317

320318
MC_DLLEXPORT_DEF

0 commit comments

Comments
 (0)