Browse Source

od: input parameter should be constant

dev/timer
Oleg Hahm 8 years ago
parent
commit
94596cdd10
  1. 4
      sys/include/od.h
  2. 4
      sys/od/od.c

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

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

Loading…
Cancel
Save