| 1230 | //============================================================= |
| 1231 | template <class T> |
| 1232 | int32_t AudioFile<T>::fourBytesToInt (const std::vector<uint8_t>& source, int startIndex, Endianness endianness) |
| 1233 | { |
| 1234 | if (source.size() >= (startIndex + 4)) |
| 1235 | { |
| 1236 | int32_t result; |
| 1237 | |
| 1238 | if (endianness == Endianness::LittleEndian) |
| 1239 | result = (source[startIndex + 3] << 24) | (source[startIndex + 2] << 16) | (source[startIndex + 1] << 8) | source[startIndex]; |
| 1240 | else |
| 1241 | result = (source[startIndex] << 24) | (source[startIndex + 1] << 16) | (source[startIndex + 2] << 8) | source[startIndex + 3]; |
| 1242 | |
| 1243 | return result; |
| 1244 | } |
| 1245 | else |
| 1246 | { |
| 1247 | assert (false && "Attempted to read four bytes from vector at position where out of bounds access would occur"); |
| 1248 | return 0; // this is a dummy value as we don't have one to return |
| 1249 | } |
| 1250 | } |
| 1251 | |
| 1252 | //============================================================= |
| 1253 | template <class T> |
nothing calls this directly
no outgoing calls
no test coverage detected