* @brief Swap endianness of N two byte values. * * @param[in,out] dataptr The data to convert. * @param byte_count The number of bytes to convert. */
| 658 | * @param byte_count The number of bytes to convert. |
| 659 | */ |
| 660 | static void switch_endianness2( |
| 661 | void* dataptr, |
| 662 | size_t byte_count |
| 663 | ) { |
| 664 | uint8_t* data = reinterpret_cast<uint8_t*>(dataptr); |
| 665 | for (size_t i = 0; i < byte_count / 2; i++) |
| 666 | { |
| 667 | uint8_t d0 = data[0]; |
| 668 | uint8_t d1 = data[1]; |
| 669 | data[0] = d1; |
| 670 | data[1] = d0; |
| 671 | data += 2; |
| 672 | } |
| 673 | } |
| 674 | |
| 675 | /** |
| 676 | * @brief Swap endianness of N four byte values. |
no outgoing calls
no test coverage detected