MCPcopy Create free account
hub / github.com/ARM-software/astc-encoder / switch_endianness4

Function switch_endianness4

Source/astcenccli_image_load_store.cpp:681–698  ·  view source on GitHub ↗

* @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. */

Source from the content-addressed store, hash-verified

679 * @param byte_count The number of bytes to convert.
680 */
681static 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

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected