From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8383 invoked by alias); 28 Apr 2005 16:27:43 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 8034 invoked from network); 28 Apr 2005 16:27:27 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 28 Apr 2005 16:27:27 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j3SGRMW3023283 for ; Thu, 28 Apr 2005 12:27:27 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j3SGRMO25737; Thu, 28 Apr 2005 12:27:22 -0400 Received: from [172.16.50.70] (vpn50-70.rdu.redhat.com [172.16.50.70]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id j3SGRL1K025382; Thu, 28 Apr 2005 12:27:21 -0400 Message-ID: <42710E90.3030300@gnu.org> Date: Thu, 28 Apr 2005 16:27:00 -0000 From: Andrew Cagney User-Agent: Mozilla Thunderbird 1.0.2-1 (X11/20050323) MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [commit] Use bfd_byte in value.h Content-Type: multipart/mixed; boundary="------------050301070209030208090103" X-SW-Source: 2005-04/txt/msg00390.txt.bz2 This is a multi-part message in MIME format. --------------050301070209030208090103 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 180 This changes value.h to use bfd_byte more consistently. When trying to fix the signed (string) VS unsigned (buffer) pointer warnings you very quickly run into these interfaces. --------------050301070209030208090103 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 4977 2005-04-28 Andrew Cagney * valops.c (check_field): Make buffer a bfd_byte. * value.c (unpack_long, unpack_double, unpack_pointer) (unpack_field_as_long, modify_field): Ditto. * value.h: Update declarations. Index: valops.c =================================================================== RCS file: /cvs/src/src/gdb/valops.c,v retrieving revision 1.155 diff -p -u -r1.155 valops.c --- valops.c 24 Feb 2005 13:51:35 -0000 1.155 +++ valops.c 28 Apr 2005 16:13:15 -0000 @@ -2317,7 +2317,7 @@ check_field_in (struct type *type, const target structure/union is defined, otherwise, return 0. */ int -check_field (struct value *arg1, const char *name) +check_field (struct value *arg1, const bfd_byte *name) { struct type *t; Index: value.c =================================================================== RCS file: /cvs/src/src/gdb/value.c,v retrieving revision 1.27 diff -p -u -r1.27 value.c --- value.c 20 Feb 2005 01:19:24 -0000 1.27 +++ value.c 28 Apr 2005 16:13:16 -0000 @@ -996,7 +996,7 @@ value_as_address (struct value *val) to an INT (or some size). After all, it is only an offset. */ LONGEST -unpack_long (struct type *type, const char *valaddr) +unpack_long (struct type *type, const bfd_byte *valaddr) { enum type_code code = TYPE_CODE (type); int len = TYPE_LENGTH (type); @@ -1045,7 +1045,7 @@ unpack_long (struct type *type, const ch format, result is in host format. */ DOUBLEST -unpack_double (struct type *type, const char *valaddr, int *invp) +unpack_double (struct type *type, const bfd_byte *valaddr, int *invp) { enum type_code code; int len; @@ -1109,7 +1109,7 @@ unpack_double (struct type *type, const to an INT (or some size). After all, it is only an offset. */ CORE_ADDR -unpack_pointer (struct type *type, const char *valaddr) +unpack_pointer (struct type *type, const bfd_byte *valaddr) { /* Assume a CORE_ADDR can fit in a LONGEST (for now). Not sure whether we want this to be true eventually. */ @@ -1359,7 +1359,7 @@ value_fn_field (struct value **arg1p, st If the field is signed, we also do sign extension. */ LONGEST -unpack_field_as_long (struct type *type, const char *valaddr, int fieldno) +unpack_field_as_long (struct type *type, const bfd_byte *valaddr, int fieldno) { ULONGEST val; ULONGEST valmask; @@ -1406,7 +1406,7 @@ unpack_field_as_long (struct type *type, 0 <= BITPOS, where lbits is the size of a LONGEST in bits. */ void -modify_field (char *addr, LONGEST fieldval, int bitpos, int bitsize) +modify_field (bfd_byte *addr, LONGEST fieldval, int bitpos, int bitsize) { ULONGEST oword; ULONGEST mask = (ULONGEST) -1 >> (8 * sizeof (ULONGEST) - bitsize); Index: value.h =================================================================== RCS file: /cvs/src/src/gdb/value.h,v retrieving revision 1.85 diff -p -u -r1.85 value.h --- value.h 8 Mar 2005 14:35:17 -0000 1.85 +++ value.h 28 Apr 2005 16:13:16 -0000 @@ -262,11 +262,12 @@ extern LONGEST value_as_long (struct val extern DOUBLEST value_as_double (struct value *val); extern CORE_ADDR value_as_address (struct value *val); -extern LONGEST unpack_long (struct type *type, const char *valaddr); -extern DOUBLEST unpack_double (struct type *type, const char *valaddr, +extern LONGEST unpack_long (struct type *type, const bfd_byte *valaddr); +extern DOUBLEST unpack_double (struct type *type, const bfd_byte *valaddr, int *invp); -extern CORE_ADDR unpack_pointer (struct type *type, const char *valaddr); -extern LONGEST unpack_field_as_long (struct type *type, const char *valaddr, +extern CORE_ADDR unpack_pointer (struct type *type, const bfd_byte *valaddr); +extern LONGEST unpack_field_as_long (struct type *type, + const bfd_byte *valaddr, int fieldno); extern struct value *value_from_longest (struct type *type, LONGEST num); @@ -451,14 +452,15 @@ extern void release_value (struct value extern int record_latest_value (struct value *val); -extern void modify_field (char *addr, LONGEST fieldval, int bitpos, +extern void modify_field (bfd_byte *addr, LONGEST fieldval, int bitpos, int bitsize); extern void type_print (struct type *type, char *varstring, struct ui_file *stream, int show); -extern char *baseclass_addr (struct type *type, int index, char *valaddr, - struct value **valuep, int *errp); +extern bfd_byte *baseclass_addr (struct type *type, int index, + bfd_byte *valaddr, + struct value **valuep, int *errp); extern void print_longest (struct ui_file *stream, int format, int use_local, LONGEST val); @@ -493,7 +495,7 @@ extern void print_variable_value (struct struct frame_info *frame, struct ui_file *stream); -extern int check_field (struct value *, const char *); +extern int check_field (struct value *, const bfd_byte *); extern void typedef_print (struct type *type, struct symbol *news, struct ui_file *stream); --------------050301070209030208090103--