mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-09 01:57:26 +00:00
lib: Fix compile warnings with zlog_hexdump
When using zlog_hexdump tell the compiler that we don't expect to actually change the memory. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
c8ae3ce8b6
commit
a9b5cbe55a
@ -992,7 +992,7 @@ proto_redistnum(int afi, const char *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
zlog_hexdump (void *mem, unsigned int len) {
|
zlog_hexdump (const void *mem, unsigned int len) {
|
||||||
unsigned long i = 0;
|
unsigned long i = 0;
|
||||||
unsigned int j = 0;
|
unsigned int j = 0;
|
||||||
unsigned int columns = 8;
|
unsigned int columns = 8;
|
||||||
@ -1007,7 +1007,7 @@ zlog_hexdump (void *mem, unsigned int len) {
|
|||||||
|
|
||||||
/* print hex data */
|
/* print hex data */
|
||||||
if (i < len)
|
if (i < len)
|
||||||
s += sprintf(s, "%02x ", 0xFF & ((char*)mem)[i]);
|
s += sprintf(s, "%02x ", 0xFF & ((const char*)mem)[i]);
|
||||||
|
|
||||||
/* end of block, just aligning for ASCII dump */
|
/* end of block, just aligning for ASCII dump */
|
||||||
else
|
else
|
||||||
@ -1021,8 +1021,8 @@ zlog_hexdump (void *mem, unsigned int len) {
|
|||||||
if (j >= len) /* end of block, not really printing */
|
if (j >= len) /* end of block, not really printing */
|
||||||
s += sprintf(s, " ");
|
s += sprintf(s, " ");
|
||||||
|
|
||||||
else if(isprint((int)((char*)mem)[j])) /* printable char */
|
else if(isprint((int)((const char *)mem)[j])) /* printable char */
|
||||||
s += sprintf(s, "%c", 0xFF & ((char*)mem)[j]);
|
s += sprintf(s, "%c", 0xFF & ((const char *)mem)[j]);
|
||||||
|
|
||||||
else /* other char */
|
else /* other char */
|
||||||
s += sprintf(s, ".");
|
s += sprintf(s, ".");
|
||||||
|
@ -176,7 +176,7 @@ extern void zlog_backtrace_sigsafe(int priority, void *program_counter);
|
|||||||
extern size_t quagga_timestamp(int timestamp_precision /* # subsecond digits */,
|
extern size_t quagga_timestamp(int timestamp_precision /* # subsecond digits */,
|
||||||
char *buf, size_t buflen);
|
char *buf, size_t buflen);
|
||||||
|
|
||||||
extern void zlog_hexdump(void *mem, unsigned int len);
|
extern void zlog_hexdump(const void *mem, unsigned int len);
|
||||||
|
|
||||||
/* structure useful for avoiding repeated rendering of the same timestamp */
|
/* structure useful for avoiding repeated rendering of the same timestamp */
|
||||||
struct timestamp_control {
|
struct timestamp_control {
|
||||||
|
Loading…
Reference in New Issue
Block a user