Skip to content

Commit

Permalink
memaccess: Fix comments for some 64 bit macros.
Browse files Browse the repository at this point in the history
  • Loading branch information
joevt authored and dingusdev committed Jan 15, 2025
1 parent a6483fa commit 38c4f1e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions memaccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
((((uint8_t*)(addr))[0] << 24) | (((uint8_t*)(addr))[1] << 16) | \
(((uint8_t*)(addr))[2] << 8) | ((uint8_t*)(addr))[3] )

/* read an unaligned big-endian QWORD (32bit) */
/* read an unaligned big-endian QWORD (64bit) */
#define READ_QWORD_BE_U(addr) \
((uint64_t(((uint8_t*)(addr))[0]) << 56) | (uint64_t(((uint8_t*)(addr))[1]) << 48) | \
(uint64_t(((uint8_t*)(addr))[2]) << 40) | (uint64_t(((uint8_t*)(addr))[3]) << 32) | \
Expand All @@ -71,7 +71,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
((((uint8_t*)(addr))[3] << 24) | (((uint8_t*)(addr))[2] << 16) | \
(((uint8_t*)(addr))[1] << 8) | ((uint8_t*)(addr))[0] )

/* read an unaligned little-endian DWORD (64bit) */
/* read an unaligned little-endian QWORD (64bit) */
#define READ_QWORD_LE_U(addr) \
((uint64_t(((uint8_t*)(addr))[7]) << 56) | (uint64_t(((uint8_t*)(addr))[6]) << 48) | \
(uint64_t(((uint8_t*)(addr))[5]) << 40) | (uint64_t(((uint8_t*)(addr))[4]) << 32) | \
Expand Down Expand Up @@ -103,7 +103,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
((uint8_t*)(addr))[3] = (uint8_t)(val); \
} while (0)

/* write an unaligned big-endian DWORD (64bit) */
/* write an unaligned big-endian QWORD (64bit) */
#define WRITE_QWORD_BE_U(addr, val) \
do { \
((uint8_t*)(addr))[0] = ((uint64_t)(val) >> 56); \
Expand Down Expand Up @@ -141,7 +141,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
((uint8_t*)(addr))[3] = ((val) >> 24); \
} while (0)

/* write an unaligned little-endian DWORD (64bit) */
/* write an unaligned little-endian QWORD (64bit) */
#define WRITE_QWORD_LE_U(addr, val) \
do { \
((uint8_t*)(addr))[0] = (uint8_t)(val) ; \
Expand Down

0 comments on commit 38c4f1e

Please sign in to comment.