Read and return a int16_t (16 bits) Throws an exception of type (cfile_error *) if the OS returns an error on read
| 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 |
| 686 | int16_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 |
| 693 | int8_t cf_ReadByte(CFILE *cfp) { |