MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / cf_ReadShort

Function cf_ReadShort

cfile/cfile.cpp:686–690  ·  view source on GitHub ↗

Read and return a int16_t (16 bits) Throws an exception of type (cfile_error *) if the OS returns an error on read

Source from the content-addressed store, hash-verified

684// Read and return a int16_t (16 bits)
685// Throws an exception of type (cfile_error *) if the OS returns an error on read
686int16_t cf_ReadShort(CFILE *cfp, bool little_endian) {
687 int16_t i;
688 cf_ReadBytes((uint8_t *)&i, sizeof(i), cfp);
689 return little_endian ? D3::convert_le(i) : D3::convert_be(i);
690}
691// Read and return a byte (8 bits)
692// Throws an exception of type (cfile_error *) if the OS returns an error on read
693int8_t cf_ReadByte(CFILE *cfp) {

Callers 15

mng_ReadNewShipPageFunction · 0.85
mng_ReadShipPageFunction · 0.85
mng_ReadNewSoundPageFunction · 0.85
mng_ReadNewGamefilePageFunction · 0.85
mng_CompileAddonPagesFunction · 0.85
mng_ReadNewMegacellPageFunction · 0.85
mng_ReadNewGenericPageFunction · 0.85
mng_ReadGenericPageFunction · 0.85
mng_ReadNewDoorPageFunction · 0.85
mng_ReadNewTexturePageFunction · 0.85
mng_ReadNewWeaponPageFunction · 0.85

Calls 3

cf_ReadBytesFunction · 0.85
convert_leFunction · 0.85
convert_beFunction · 0.85

Tested by 1

TESTFunction · 0.68