1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

od: input parameter should be constant

This commit is contained in:
Oleg Hahm 2015-07-19 10:29:58 +02:00
parent 13b776194d
commit 94596cdd10
2 changed files with 4 additions and 4 deletions

View File

@ -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);
}

View File

@ -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);