From 94596cdd10315bae715ed83ee46d52203b728ce3 Mon Sep 17 00:00:00 2001 From: Oleg Hahm <oleg@hobbykeller.org> Date: Sun, 19 Jul 2015 10:29:58 +0200 Subject: [PATCH] od: input parameter should be constant --- sys/include/od.h | 4 ++-- sys/od/od.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/include/od.h b/sys/include/od.h index 8cd2d20159..d7120659c0 100644 --- a/sys/include/od.h +++ b/sys/include/od.h @@ -136,7 +136,7 @@ extern "C" { * @param[in] flags Flags as defined in @ref od_flags_address and * @ref od_flags_bytes */ -void od(void *data, size_t data_len, uint8_t width, uint16_t flags); +void od(const void *data, size_t data_len, uint8_t width, uint16_t flags); /** * @brief Dumps memory stored at *data* up to *data_len* in octal, decimal, or @@ -148,7 +148,7 @@ void od(void *data, size_t data_len, uint8_t width, uint16_t flags); * @param[in] width Number of bytes per line. If *width* is 0, * @ref OD_WIDTH_DEFAULT is assumed as a default value. */ -static inline void od_hex_dump(void *data, size_t data_len, uint8_t width) +static inline void od_hex_dump(const void *data, size_t data_len, uint8_t width) { od(data, data_len, width, OD_FLAGS_ADDRESS_HEX | OD_FLAGS_BYTES_HEX | OD_FLAGS_LENGTH_1); } diff --git a/sys/od/od.c b/sys/od/od.c index 87098c8e4a..b49af2996d 100644 --- a/sys/od/od.c +++ b/sys/od/od.c @@ -178,7 +178,7 @@ static inline void _bytes_format(char *format, uint16_t flags) } } -static void _print_date(void *data, size_t offset, char *format, uint8_t length, +static void _print_date(const void *data, size_t offset, char *format, uint8_t length, uint16_t flags) { switch (length) { @@ -287,7 +287,7 @@ static int _log10(uint8_t a) return ++res; } -void od(void *data, size_t data_len, uint8_t width, uint16_t flags) +void od(const void *data, size_t data_len, uint8_t width, uint16_t flags) { char address_format[5]; uint8_t date_length = _length(flags); -- GitLab