From 3cf7b3ec757d7424cc2007799122063fb0c3f9a0 Mon Sep 17 00:00:00 2001 From: evpobr Date: Tue, 1 Sep 2020 09:27:16 +0500 Subject: [PATCH] src/sfendian.h: Constify psf_get_XXX functions --- src/sfendian.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/sfendian.h b/src/sfendian.h index 88a22371..585b69ad 100644 --- a/src/sfendian.h +++ b/src/sfendian.h @@ -207,7 +207,7 @@ psf_put_be16 (uint8_t *ptr, int offset, int16_t value) } /* psf_put_be16 */ static inline int64_t -psf_get_be64 (uint8_t *ptr, int offset) +psf_get_be64 (const uint8_t *ptr, int offset) { int64_t value ; value = ((uint32_t) ptr [offset]) << 24 ; @@ -225,7 +225,7 @@ psf_get_be64 (uint8_t *ptr, int offset) } /* psf_get_be64 */ static inline int64_t -psf_get_le64 (uint8_t *ptr, int offset) +psf_get_le64 (const uint8_t *ptr, int offset) { int64_t value ; value = ((uint32_t) ptr [offset + 7]) << 24 ; @@ -243,7 +243,7 @@ psf_get_le64 (uint8_t *ptr, int offset) } /* psf_get_le64 */ static inline int32_t -psf_get_be32 (uint8_t *ptr, int offset) +psf_get_be32 (const uint8_t *ptr, int offset) { int32_t value ; value = ((uint32_t) ptr [offset]) << 24 ; @@ -254,7 +254,7 @@ psf_get_be32 (uint8_t *ptr, int offset) } /* psf_get_be32 */ static inline int32_t -psf_get_le32 (uint8_t *ptr, int offset) +psf_get_le32 (const uint8_t *ptr, int offset) { int32_t value ; value = ((uint32_t) ptr [offset + 3]) << 24 ; @@ -265,7 +265,7 @@ psf_get_le32 (uint8_t *ptr, int offset) } /* psf_get_le32 */ static inline int32_t -psf_get_be24 (uint8_t *ptr, int offset) +psf_get_be24 (const uint8_t *ptr, int offset) { int32_t value ; value = ((uint32_t) ptr [offset]) << 24 ; @@ -275,7 +275,7 @@ psf_get_be24 (uint8_t *ptr, int offset) } /* psf_get_be24 */ static inline int32_t -psf_get_le24 (uint8_t *ptr, int offset) +psf_get_le24 (const uint8_t *ptr, int offset) { int32_t value ; value = ((uint32_t) ptr [offset + 2]) << 24 ; @@ -285,7 +285,7 @@ psf_get_le24 (uint8_t *ptr, int offset) } /* psf_get_le24 */ static inline int16_t -psf_get_be16 (uint8_t *ptr, int offset) +psf_get_be16 (const uint8_t *ptr, int offset) { return (int16_t) (ptr [offset] << 8) + ptr [offset + 1] ; } /* psf_get_be16 */