From 7fc8793d5b98a8a7c2cf208227c5cb966513171d Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Wed, 29 May 2019 17:45:46 +0200 Subject: [PATCH] Make buffer util functions accept const buffers So that they can be used both on const and non-const input buffers. --- app/src/buffer_util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/buffer_util.h b/app/src/buffer_util.h index 5d94deef..4bfd08d3 100644 --- a/app/src/buffer_util.h +++ b/app/src/buffer_util.h @@ -19,12 +19,12 @@ buffer_write32be(uint8_t *buf, uint32_t value) { } static inline uint32_t -buffer_read32be(uint8_t *buf) { +buffer_read32be(const uint8_t *buf) { return (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]; } static inline -uint64_t buffer_read64be(uint8_t *buf) { +uint64_t buffer_read64be(const uint8_t *buf) { uint32_t msb = buffer_read32be(buf); uint32_t lsb = buffer_read32be(&buf[4]); return ((uint64_t) msb << 32) | lsb;