| 830 | // read a value from the byte stream and advance the stream by its size |
| 831 | template<typename T> |
| 832 | T AdvanceByteStream(const unsigned char*& data, unsigned int& remaining) |
| 833 | { |
| 834 | #ifdef IS_LITTLE_ENDIAN |
| 835 | T rv = *(T*)data; |
| 836 | data += sizeof(T); |
| 837 | #else |
| 838 | T rv; unsigned char* rvptr = (unsigned char*)&rv; |
| 839 | for(int i = sizeof(T)-1; i>=0; i--) |
| 840 | rvptr[i] = *data++; |
| 841 | #endif |
| 842 | remaining -= sizeof(T); |
| 843 | return rv; |
| 844 | } |
| 845 | // advance the byte stream by a certain size without reading a value |
| 846 | void AdvanceByteStream(const unsigned char*& data, unsigned int& remaining, int amount) |
| 847 | { |
no outgoing calls
no test coverage detected