From 3acee16d796d67cc2441620b8fa553c445f1f397 Mon Sep 17 00:00:00 2001 From: Intel A80486DX2-66 Date: Tue, 18 Jun 2024 18:15:32 +0300 Subject: [PATCH] fwrite_le.*: make use of `const` for `ptr` --- include/fwrite_le.h | 6 +++++- src/fwrite_le.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/fwrite_le.h b/include/fwrite_le.h index 76127a3..6eb6fd1 100644 --- a/include/fwrite_le.h +++ b/include/fwrite_le.h @@ -18,7 +18,11 @@ #define ifeq_b32_ret(lhs, rhs, value) if (!memcmp(lhs, rhs, 4)) return value; int detect_endianness(void); -size_t fwrite_le(void* ptr, size_t size, size_t count, FILE* stream); +size_t fwrite_le( +#if FWRITE_LE_NO_MODIFICATION + const +#endif + void* ptr, size_t size, size_t count, FILE* stream); void reorder_le_be( #if FWRITE_LE_NO_MODIFICATION uint8_t* dest, uint8_t* src, diff --git a/src/fwrite_le.c b/src/fwrite_le.c index 473124c..e9beb3f 100644 --- a/src/fwrite_le.c +++ b/src/fwrite_le.c @@ -37,7 +37,11 @@ void reorder_le_be( } } -size_t fwrite_le(void* ptr, size_t size, size_t count, FILE* stream) { +size_t fwrite_le( +#if FWRITE_LE_NO_MODIFICATION + const +#endif + void* ptr, size_t size, size_t count, FILE* stream) { /* * warning: this function modifies `void* ptr` by default! * (if FWRITE_LE_NO_MODIFICATION in the header is 0)