From 37611a2b102505daefdae7cb47a60c84fb2a9a09 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Wed, 24 Jul 2002 22:46:48 +0000 Subject: [PATCH] 2002-07-24 Andrew Cagney * findvar.c (extract_unsigned_integer): Make `addr' parameter constant. Same for local pointer variables. (extract_signed_integer): Ditto. * defs.h (extract_unsigned_integer): Update. (extract_signed_integer): Update. --- gdb/ChangeLog | 8 ++++++++ gdb/defs.h | 4 ++-- gdb/findvar.c | 16 ++++++++-------- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 79ac32190c7..f55379beeeb 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2002-07-24 Andrew Cagney + + * findvar.c (extract_unsigned_integer): Make `addr' parameter + constant. Same for local pointer variables. + (extract_signed_integer): Ditto. + * defs.h (extract_unsigned_integer): Update. + (extract_signed_integer): Update. + 2002-07-24 Kevin Buettner * gdbserver/configure.in (unistd.h): Add to AC_CHECK_HEADERS list. diff --git a/gdb/defs.h b/gdb/defs.h index 7dea2b73397..a96948c0cad 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -1071,9 +1071,9 @@ extern void *alloca (); /* In findvar.c. */ -extern LONGEST extract_signed_integer (void *, int); +extern LONGEST extract_signed_integer (const void *, int); -extern ULONGEST extract_unsigned_integer (void *, int); +extern ULONGEST extract_unsigned_integer (const void *, int); extern int extract_long_unsigned_integer (void *, int, LONGEST *); diff --git a/gdb/findvar.c b/gdb/findvar.c index 831ae4bc1b0..d2591321d75 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -47,12 +47,12 @@ you lose #endif LONGEST -extract_signed_integer (void *addr, int len) +extract_signed_integer (const void *addr, int len) { LONGEST retval; - unsigned char *p; - unsigned char *startaddr = (unsigned char *) addr; - unsigned char *endaddr = startaddr + len; + const unsigned char *p; + const unsigned char *startaddr = addr; + const unsigned char *endaddr = startaddr + len; if (len > (int) sizeof (LONGEST)) error ("\ @@ -81,12 +81,12 @@ That operation is not available on integers of more than %d bytes.", } ULONGEST -extract_unsigned_integer (void *addr, int len) +extract_unsigned_integer (const void *addr, int len) { ULONGEST retval; - unsigned char *p; - unsigned char *startaddr = (unsigned char *) addr; - unsigned char *endaddr = startaddr + len; + const unsigned char *p; + const unsigned char *startaddr = addr; + const unsigned char *endaddr = startaddr + len; if (len > (int) sizeof (ULONGEST)) error ("\ -- 2.30.2