MCPcopy Create free account
hub / github.com/IoLanguage/io / BStream_readTaggedInt32

Function BStream_readTaggedInt32

libs/basekit/source/BStream.c:380–401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

378}
379
380int32_t BStream_readTaggedInt32(BStream *self) {
381 unsigned char c = BStream_readByte(self);
382 BStreamTag t = BStreamTag_FromUnsignedChar(c);
383
384 if (t.type == BSTREAM_UNSIGNED_INT && t.byteCount == 1) {
385 return (int32_t)BStream_readUint8(self);
386 }
387
388 if (t.type == BSTREAM_SIGNED_INT && t.byteCount == 4) {
389 return (int32_t)BStream_readInt32(self);
390 }
391 /*
392 if (t.type == BSTREAM_SIGNED_INT && t.byteCount == 8)
393 {
394 return (int32_t)BStream_readInt64(self);
395 }
396 */
397
398 BStream_error_(self, "unhandled int type/size combination");
399
400 return 0;
401}
402
403intptr_t BStream_readTaggedPointer(BStream *self) {
404 unsigned char c = BStream_readByte(self);

Callers 4

BStream_readTaggedUint8Function · 0.85

Calls 5

BStream_readByteFunction · 0.85
BStream_readUint8Function · 0.85
BStream_readInt32Function · 0.85
BStream_error_Function · 0.85

Tested by

no test coverage detected