From 001f13d822104158239fe26a05d9154d967cbe56 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Fri, 19 Apr 2013 15:10:53 +0000 Subject: -Wpointer-sign: gdb_byte -> char. This is sort of the opposite of the previous patch. Places that manipulate strings or interfaces that return strings are changed to use char* instead of gdb_byte*. gdb/ 2013-04-19 Pedro Alves * avr-tdep.c (avr_io_reg_read_command): New local 'bufstr'. Use it to get a string view of the byte buffer. * i386-cygwin-tdep.c (core_process_module_section): Change local 'buf' type to gdb_byte *. Adjust. * linux-tdep.c (linux_info_proc, linux_find_memory_regions_full): Change local to char *. * solib-darwin.c (find_program_interpreter): Change return type to char *. Adjust. (darwin_solib_get_all_image_info_addr_at_init): Adjust. * solib-dsbt.c (enable_break2): Change local 'buf' to char *. * solib-frv.c (enable_break2): Change local 'buf' to char *. * solib-spu.c (spu_current_sos): Add gdb_byte * cast. * solib-svr4.c (find_program_interpreter): Change return type to char *. Adjust. (enable_break): Change local 'interp_name' to char *. * spu-multiarch.c (spu_xfer_partial): Add cast to 'char *'. * spu-tdep.c (spu_pseudo_register_read_spu): Add cast to 'char *'. (spu_pseudo_register_write_spu): Use char for string buffer. Adjust. (info_spu_event_command, info_spu_signal_command): Add casts to 'char *'. --- gdb/avr-tdep.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gdb/avr-tdep.c') diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c index b14bf83..0bc08a8 100644 --- a/gdb/avr-tdep.c +++ b/gdb/avr-tdep.c @@ -1468,8 +1468,9 @@ avr_io_reg_read_command (char *args, int from_tty) { LONGEST bufsiz = 0; gdb_byte *buf; + const char *bufstr; char query[400]; - char *p; + const char *p; unsigned int nreg = 0; unsigned int val; int i, j, k, step; @@ -1477,6 +1478,7 @@ avr_io_reg_read_command (char *args, int from_tty) /* Find out how many io registers the target has. */ bufsiz = target_read_alloc (¤t_target, TARGET_OBJECT_AVR, "avr.io_reg", &buf); + bufstr = (const char *) buf; if (bufsiz <= 0) { @@ -1486,7 +1488,7 @@ avr_io_reg_read_command (char *args, int from_tty) return; } - if (sscanf (buf, "%x", &nreg) != 1) + if (sscanf (bufstr, "%x", &nreg) != 1) { fprintf_unfiltered (gdb_stderr, _("Error fetching number of io registers\n")); @@ -1514,7 +1516,7 @@ avr_io_reg_read_command (char *args, int from_tty) bufsiz = target_read_alloc (¤t_target, TARGET_OBJECT_AVR, query, &buf); - p = buf; + p = (const char *) buf; for (k = i; k < (i + j); k++) { if (sscanf (p, "%[^,],%x;", query, &val) == 2) -- cgit v1.1