From: Chih-Hung Hsieh Date: Fri, 4 Sep 2015 19:04:11 +0000 (-0700) Subject: libdw: Add const declaration to getlocations_addr locs. X-Git-Tag: elfutils-0.164~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f6b93914662566bbbb974cc85ef686a9f6b41a42;p=thirdparty%2Felfutils.git libdw: Add const declaration to getlocations_addr locs. And change K&R C function definition to ansi, which prevented GCC from seeing that callers passed in const arguments. Signed-off-by: Chih-Hung Hsieh Signed-off-by: Mark Wielaard --- diff --git a/libdw/ChangeLog b/libdw/ChangeLog index 63910ba75..96f8d9013 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,3 +1,10 @@ +2015-09-04 Chih-Hung Hsieh + Mark Wielaard + + * dwarf_getlocation.c (getlocations_addr): Replace K&R function + definition with ansi-C definition and add const qualifier to + locs argument. + 2015-09-04 Chih-Hung Hsieh * libdw_findcu.c (__libdw_intern_next_unit): Replace K&R function diff --git a/libdw/dwarf_getlocation.c b/libdw/dwarf_getlocation.c index f1dda683d..0a0e04b4c 100644 --- a/libdw/dwarf_getlocation.c +++ b/libdw/dwarf_getlocation.c @@ -680,17 +680,10 @@ initial_offset_base (attr, offset, basep) } static ptrdiff_t -getlocations_addr (attr, offset, basep, startp, endp, address, - locs, expr, exprlen) - Dwarf_Attribute *attr; - ptrdiff_t offset; - Dwarf_Addr *basep; - Dwarf_Addr *startp; - Dwarf_Addr *endp; - Dwarf_Addr address; - Elf_Data *locs; - Dwarf_Op **expr; - size_t *exprlen; +getlocations_addr (Dwarf_Attribute *attr, ptrdiff_t offset, + Dwarf_Addr *basep, Dwarf_Addr *startp, Dwarf_Addr *endp, + Dwarf_Addr address, const Elf_Data *locs, Dwarf_Op **expr, + size_t *exprlen) { unsigned char *readp = locs->d_buf + offset; unsigned char *readendp = locs->d_buf + locs->d_size;