From 523e454fab831e07c83a648c5d07370375a1c376 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Wed, 17 Apr 2024 16:55:28 -0400 Subject: gdbsupport: constify some return values in print-utils.{h,cc} There is no reason the callers of these functions need to change the returned string, so change the `char *` return types to `const char *`. Update a few callers to also use `const char *`. Change-Id: I94adff574d5e1b326e8cc688cf1817a15b408b96 Approved-By: Tom Tromey --- gdbserver/utils.cc | 2 +- gdbserver/utils.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'gdbserver') diff --git a/gdbserver/utils.cc b/gdbserver/utils.cc index 3d3144e..3023007 100644 --- a/gdbserver/utils.cc +++ b/gdbserver/utils.cc @@ -99,7 +99,7 @@ internal_vwarning (const char *file, int line, const char *fmt, va_list args) /* Convert a CORE_ADDR into a HEX string, like %lx. The result is stored in a circular static buffer, NUMCELLS deep. */ -char * +const char * paddress (CORE_ADDR addr) { return phex_nz (addr, sizeof (CORE_ADDR)); diff --git a/gdbserver/utils.h b/gdbserver/utils.h index 7a6d0fd..ad1f82c 100644 --- a/gdbserver/utils.h +++ b/gdbserver/utils.h @@ -19,6 +19,6 @@ #ifndef GDBSERVER_UTILS_H #define GDBSERVER_UTILS_H -char *paddress (CORE_ADDR addr); +const char *paddress (CORE_ADDR addr); #endif /* GDBSERVER_UTILS_H */ -- cgit v1.1