1
0
mirror of https://gitlab.com/80486DX2-66/gists synced 2024-12-26 11:30:03 +05:30

C: add be_to_le_ptr.h

This commit is contained in:
Intel A80486DX2-66 2024-03-24 22:10:32 +03:00
parent f4fbea4850
commit 1a0095e6d0
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B

View File

@ -0,0 +1,11 @@
/*
* be_to_le_ptr.h
*
* Useful for showing big-endian hexadecimal dumps on little-endian machines
*
* Author: Intel A80486DX2-66
* License: Creative Commons Zero 1.0 Universal
*/
#define BE_TO_LE_PTR(base, size, i) \
(base) + ((size) * ((i) / (size)) + ((size) - 1) - ((i) % (size)))