* @brief Swap endianness of N four byte values. * * @param[in,out] dataptr The data to convert. * @param byte_count The number of bytes to convert. */
| 679 | * @param byte_count The number of bytes to convert. |
| 680 | */ |
| 681 | static void switch_endianness4( |
| 682 | void* dataptr, |
| 683 | size_t byte_count |
| 684 | ) { |
| 685 | uint8_t* data = reinterpret_cast<uint8_t*>(dataptr); |
| 686 | for (size_t i = 0; i < byte_count / 4; i++) |
| 687 | { |
| 688 | uint8_t d0 = data[0]; |
| 689 | uint8_t d1 = data[1]; |
| 690 | uint8_t d2 = data[2]; |
| 691 | uint8_t d3 = data[3]; |
| 692 | data[0] = d3; |
| 693 | data[1] = d2; |
| 694 | data[2] = d1; |
| 695 | data[3] = d0; |
| 696 | data += 4; |
| 697 | } |
| 698 | } |
| 699 | |
| 700 | // Khronos enums |
| 701 | #define GL_RED 0x1903 |
no outgoing calls
no test coverage detected