diff options
author | Alan Modra <amodra@gmail.com> | 2005-02-23 12:28:06 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2005-02-23 12:28:06 +0000 |
commit | 2132e3a3184eae0655a82965d1cc90c65eddfd98 (patch) | |
tree | 5f72eaaca4b7b0f6acc4729bdd42eb5f609d2670 | |
parent | 9210d879437155a7f2743a1a59980c79b971627e (diff) | |
download | gdb-2132e3a3184eae0655a82965d1cc90c65eddfd98.zip gdb-2132e3a3184eae0655a82965d1cc90c65eddfd98.tar.gz gdb-2132e3a3184eae0655a82965d1cc90c65eddfd98.tar.bz2 |
* cgen.c: Warning fixes.
* config/tc-arc.c: Likewise.
* config/tc-arm.c: Likewise.
* config/tc-avr.c: Likewise.
* config/tc-d10v.c: Likewise.
* config/tc-d30v.c: Likewise.
* config/tc-frv.c: Likewise.
* config/tc-frv.h: Likewise.
* config/tc-h8300.c: Likewise.
* config/tc-h8500.c: Likewise.
* config/tc-i370.c: Likewise.
* config/tc-i960.c: Likewise.
* config/tc-ia64.c: Likewise.
* config/tc-ip2k.c: Likewise.
* config/tc-m68hc11.c: Likewise.
* config/tc-maxq.c: Likewise.
* config/tc-mcore.c: Likewise.
* config/tc-mips.c: Likewise.
* config/tc-msp430.c: Likewise.
* config/tc-pj.c: Likewise.
* config/tc-ppc.c: Likewise.
* config/tc-ppc.h: Likewise.
* config/tc-s390.c: Likewise.
* config/tc-sh.c: Likewise.
* config/tc-sh64.c: Likewise.
* config/tc-tic4x.c: Likewise.
* config/tc-tic80.c: Likewise.
* config/tc-v850.c: Likewise.
* config/tc-vax.c: Likewise.
* config/tc-w65.c: Likewise.
* config/tc-xstormy16.c: Likewise.
* config/tc-z8k.c: Likewise.
33 files changed, 186 insertions, 138 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index fc664d4..275bd1c 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,38 @@ +2005-02-23 Alan Modra <amodra@bigpond.net.au> + + * cgen.c: Warning fixes. + * config/tc-arc.c: Likewise. + * config/tc-arm.c: Likewise. + * config/tc-avr.c: Likewise. + * config/tc-d10v.c: Likewise. + * config/tc-d30v.c: Likewise. + * config/tc-frv.c: Likewise. + * config/tc-frv.h: Likewise. + * config/tc-h8300.c: Likewise. + * config/tc-h8500.c: Likewise. + * config/tc-i370.c: Likewise. + * config/tc-i960.c: Likewise. + * config/tc-ia64.c: Likewise. + * config/tc-ip2k.c: Likewise. + * config/tc-m68hc11.c: Likewise. + * config/tc-maxq.c: Likewise. + * config/tc-mcore.c: Likewise. + * config/tc-mips.c: Likewise. + * config/tc-msp430.c: Likewise. + * config/tc-pj.c: Likewise. + * config/tc-ppc.c: Likewise. + * config/tc-ppc.h: Likewise. + * config/tc-s390.c: Likewise. + * config/tc-sh.c: Likewise. + * config/tc-sh64.c: Likewise. + * config/tc-tic4x.c: Likewise. + * config/tc-tic80.c: Likewise. + * config/tc-v850.c: Likewise. + * config/tc-vax.c: Likewise. + * config/tc-w65.c: Likewise. + * config/tc-xstormy16.c: Likewise. + * config/tc-z8k.c: Likewise. + 2005-02-22 Catherine Moore <clm@cm00re.com> * read.c (read_a_source_file): Reinstate TC_EQUAL_IN_INSN test. @@ -1,5 +1,5 @@ /* GAS interface for targets using CGEN: Cpu tools GENerator. - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -522,7 +522,7 @@ gas_cgen_finish_insn (insn, buf, length, relax_p, result) /* If we're recording insns as numbers (rather than a string of bytes), target byte order handling is deferred until now. */ #if CGEN_INT_INSN_P - cgen_put_insn_value (gas_cgen_cpu_desc, f, length, *buf); + cgen_put_insn_value (gas_cgen_cpu_desc, (unsigned char *) f, length, *buf); #else memcpy (f, buf, byte_len); #endif @@ -616,17 +616,19 @@ gas_cgen_md_apply_fix3 (fixP, valP, seg) #if CGEN_INT_INSN_P { CGEN_INSN_INT insn_value = - cgen_get_insn_value (cd, where, CGEN_INSN_BITSIZE (insn)); + cgen_get_insn_value (cd, (unsigned char *) where, + CGEN_INSN_BITSIZE (insn)); /* ??? 0 is passed for `pc'. */ errmsg = CGEN_CPU_INSERT_OPERAND (cd) (cd, opindex, fields, &insn_value, (bfd_vma) 0); - cgen_put_insn_value (cd, where, CGEN_INSN_BITSIZE (insn), - insn_value); + cgen_put_insn_value (cd, (unsigned char *) where, + CGEN_INSN_BITSIZE (insn), insn_value); } #else /* ??? 0 is passed for `pc'. */ - errmsg = CGEN_CPU_INSERT_OPERAND (cd) (cd, opindex, fields, where, + errmsg = CGEN_CPU_INSERT_OPERAND (cd) (cd, opindex, fields, + (unsigned char *) where, (bfd_vma) 0); #endif if (errmsg) diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c index 445ea48..f5583a3 100644 --- a/gas/config/tc-arc.c +++ b/gas/config/tc-arc.c @@ -1121,7 +1121,7 @@ static void arc_extinst (ignore) int ignore ATTRIBUTE_UNUSED; { - unsigned char syntax[129]; + char syntax[129]; char *name; char *p; char c; diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 7a7c41e..6976d88 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -13816,7 +13816,7 @@ create_unwind_entry (int have_data) { int size; addressT where; - unsigned char *ptr; + char *ptr; /* The current word of data. */ valueT data; /* The number of bytes left in this word. */ @@ -14025,7 +14025,7 @@ static void s_arm_unwind_fnend (int ignored ATTRIBUTE_UNUSED) { long where; - unsigned char *ptr; + char *ptr; valueT val; demand_empty_rest_of_line (); diff --git a/gas/config/tc-avr.c b/gas/config/tc-avr.c index c884151..6bce110 100644 --- a/gas/config/tc-avr.c +++ b/gas/config/tc-avr.c @@ -1,6 +1,7 @@ /* tc-avr.c -- Assembler code for the ATMEL AVR - Copyright 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002, 2004, 2005 + Free Software Foundation, Inc. Contributed by Denis Chertykov <denisc@overta.ru> This file is part of GAS, the GNU Assembler. @@ -906,7 +907,7 @@ md_apply_fix3 (fixP, valP, seg) { /* Fetch the instruction, insert the fully resolved operand value, and stuff the instruction back again. */ - where = fixP->fx_frag->fr_literal + fixP->fx_where; + where = (unsigned char *) fixP->fx_frag->fr_literal + fixP->fx_where; insn = bfd_getl16 (where); switch (fixP->fx_r_type) diff --git a/gas/config/tc-d10v.c b/gas/config/tc-d10v.c index 639fdc0..a5360a9 100644 --- a/gas/config/tc-d10v.c +++ b/gas/config/tc-d10v.c @@ -1,5 +1,5 @@ /* tc-d10v.c -- Assembler code for the Mitsubishi D10V - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -1313,8 +1313,8 @@ do_assemble (str, opcode) char *str; struct d10v_opcode **opcode; { - unsigned char *op_start, *save; - unsigned char *op_end; + unsigned char *op_start, *op_end; + char *save; char name[20]; int nlen = 0; expressionS myops[6]; @@ -1325,10 +1325,8 @@ do_assemble (str, opcode) str++; /* Find the opcode end. */ - for (op_start = op_end = (unsigned char *) (str); - *op_end - && nlen < 20 - && !is_end_of_line[*op_end] && *op_end != ' '; + for (op_start = op_end = (unsigned char *) str; + *op_end && nlen < 20 && !is_end_of_line[*op_end] && *op_end != ' '; op_end++) { name[nlen] = TOLOWER (op_start[nlen]); @@ -1345,7 +1343,7 @@ do_assemble (str, opcode) as_fatal (_("unknown opcode: %s"), name); save = input_line_pointer; - input_line_pointer = op_end; + input_line_pointer = (char *) op_end; *opcode = find_opcode (*opcode, myops); if (*opcode == 0) return -1; diff --git a/gas/config/tc-d30v.c b/gas/config/tc-d30v.c index c79a45c..9a736c6 100644 --- a/gas/config/tc-d30v.c +++ b/gas/config/tc-d30v.c @@ -1,5 +1,6 @@ /* tc-d30v.c -- Assembler code for the Mitsubishi D30V - Copyright 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2005 + Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -1428,9 +1429,9 @@ do_assemble (str, opcode, shortp, is_parallel) int shortp; int is_parallel; { - unsigned char *op_start; - unsigned char *save; - unsigned char *op_end; + char *op_start; + char *save; + char *op_end; char name[NAME_BUF_LEN]; int cmp_hack; int nlen = 0; @@ -1443,11 +1444,11 @@ do_assemble (str, opcode, shortp, is_parallel) str++; /* Find the opcode end. */ - for (op_start = op_end = (unsigned char *) (str); + for (op_start = op_end = str; *op_end && nlen < (NAME_BUF_LEN - 1) && *op_end != '/' - && !is_end_of_line[*op_end] && *op_end != ' '; + && !is_end_of_line[(unsigned char) *op_end] && *op_end != ' '; op_end++) { name[nlen] = TOLOWER (op_start[nlen]); diff --git a/gas/config/tc-frv.c b/gas/config/tc-frv.c index c737dcd..fde63a4 100644 --- a/gas/config/tc-frv.c +++ b/gas/config/tc-frv.c @@ -745,7 +745,7 @@ frv_tomcat_shuffle (this_nop_type, vliw_to_split, insert_before_insn) /* Set the packing bit on the previous insn. */ if (pack_prev) { - unsigned char *buffer = prev_insn->address; + char *buffer = prev_insn->address; buffer[0] |= 0x80; } /* The branch is in the middle. Split this vliw insn into first @@ -784,7 +784,7 @@ frv_tomcat_shuffle (this_nop_type, vliw_to_split, insert_before_insn) /* Set the packing bit on the previous insn. */ if (pack_prev) { - unsigned char *buffer = prev_insn->address; + char *buffer = prev_insn->address; buffer[0] |= 0x80; } @@ -830,7 +830,7 @@ frv_tomcat_shuffle (this_nop_type, vliw_to_split, insert_before_insn) /* Set the packing bit on the previous insn. */ if (pack_prev) { - unsigned char *buffer = prev_insn->address; + char *buffer = prev_insn->address; buffer[0] |= 0x80; } diff --git a/gas/config/tc-frv.h b/gas/config/tc-frv.h index fb887a0..a07fc81 100644 --- a/gas/config/tc-frv.h +++ b/gas/config/tc-frv.h @@ -1,5 +1,5 @@ /* tc-frv.h -- Header file for tc-frv.c. - Copyright 2002 Free Software Foundation, Inc. + Copyright 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -109,7 +109,7 @@ extern void frv_frob_file PARAMS ((void)); { \ valueT count = ((FRAGP)->fr_next->fr_address \ - ((FRAGP)->fr_address + (FRAGP)->fr_fix)); \ - unsigned char *dest = (FRAGP)->fr_literal + (FRAGP)->fr_fix; \ + char *dest = (FRAGP)->fr_literal + (FRAGP)->fr_fix; \ if ((count & 3) != 0) \ { \ memset (dest, 0, (count & 3)); \ diff --git a/gas/config/tc-h8300.c b/gas/config/tc-h8300.c index 8879402..103e605 100644 --- a/gas/config/tc-h8300.c +++ b/gas/config/tc-h8300.c @@ -1,6 +1,6 @@ /* tc-h8300.c -- Assemble code for the Renesas H8/300 Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, - 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -978,7 +978,8 @@ get_mova_operands (char *op_end, struct h8_op *operand) static void get_rtsl_operands (char *ptr, struct h8_op *operand) { - int mode, num, num2, len, type = 0; + int mode, len, type = 0; + unsigned int num, num2; ptr++; if (*ptr == '(') @@ -1004,7 +1005,7 @@ get_rtsl_operands (char *ptr, struct h8_op *operand) ptr += len; /* CONST_xxx are used as placeholders in the opcode table. */ num = num2 - num; - if (num < 0 || num > 3) + if (num > 3) { as_bad (_("invalid register list")); return; diff --git a/gas/config/tc-h8500.c b/gas/config/tc-h8500.c index 20c0a8a..bdbaa2d 100644 --- a/gas/config/tc-h8500.c +++ b/gas/config/tc-h8500.c @@ -1,5 +1,5 @@ /* tc-h8500.c -- Assemble code for the Renesas H8/500 - Copyright 1993, 1994, 1995, 1998, 2000, 2001, 2002, 2003 + Copyright 1993, 1994, 1995, 1998, 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -155,7 +155,7 @@ static expressionS absolute; /* absolute expression */ typedef struct { int type; - int reg; + unsigned int reg; expressionS exp; int page; } @@ -164,13 +164,13 @@ h8500_operand_info; /* Try to parse a reg name. Return the number of chars consumed. */ -static int parse_reg PARAMS ((char *, int *, int *)); +static int parse_reg PARAMS ((char *, int *, unsigned int *)); static int parse_reg (src, mode, reg) char *src; int *mode; - int *reg; + unsigned int *reg; { char *end; int len; @@ -372,9 +372,9 @@ parse_reglist (src, op) h8500_operand_info *op; { int mode; - int rn; + unsigned int rn; int mask = 0; - int rm; + unsigned int rm; int idx = 1; /* skip ( */ while (src[idx] && src[idx] != ')') diff --git a/gas/config/tc-i370.c b/gas/config/tc-i370.c index 3681da0..29b4095 100644 --- a/gas/config/tc-i370.c +++ b/gas/config/tc-i370.c @@ -1,7 +1,7 @@ /* tc-i370.c -- Assembler for the IBM 360/370/390 instruction set. Loosely based on the ppc files by Linas Vepstas <linas@linas.org> 1998, 99 - Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 - Free Software Foundation, Inc. + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, + 2005 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of GAS, the GNU Assembler. @@ -2055,7 +2055,7 @@ md_assemble (str) /* If there are fewer operands in the line then are called for by the instruction, we want to skip the optional operand. */ - nwanted = strlen (opcode->operands); + nwanted = strlen ((char *) opcode->operands); if (have_optional_index) { if (opcount < nwanted) diff --git a/gas/config/tc-i960.c b/gas/config/tc-i960.c index c9aa06b..8b0a538 100644 --- a/gas/config/tc-i960.c +++ b/gas/config/tc-i960.c @@ -1,6 +1,6 @@ /* tc-i960.c - All the i80960-specific stuff Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003 + 1999, 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc. This file is part of GAS. @@ -732,11 +732,11 @@ md_number_to_chars (buf, value, n) md_chars_to_number: convert from target byte order to host byte order. *************************************************************************** */ -static int md_chars_to_number PARAMS ((unsigned char *, int)); +static int md_chars_to_number PARAMS ((char *, int)); static int md_chars_to_number (val, n) - unsigned char *val; /* Value in target byte order */ + char *val; /* Value in target byte order */ int n; /* Number of bytes in the input */ { int retval; @@ -744,7 +744,7 @@ md_chars_to_number (val, n) for (retval = 0; n--;) { retval <<= 8; - retval |= val[n]; + retval |= (unsigned char) val[n]; } return retval; } diff --git a/gas/config/tc-ia64.c b/gas/config/tc-ia64.c index 5b7f3ee..7984133 100644 --- a/gas/config/tc-ia64.c +++ b/gas/config/tc-ia64.c @@ -1152,7 +1152,7 @@ ia64_cons_align (nbytes) } /* Output COUNT bytes to a memory location. */ -static unsigned char *vbyte_mem_ptr = NULL; +static char *vbyte_mem_ptr = NULL; void output_vbyte_mem (count, ptr, comment) @@ -1329,7 +1329,7 @@ output_P4_format (f, imask, imask_size) unsigned long imask_size; { imask[0] = UNW_P4; - (*f) (imask_size, imask, NULL); + (*f) (imask_size, (char *) imask, NULL); } static void @@ -3917,7 +3917,8 @@ static void dot_spillreg (dummy) int dummy ATTRIBUTE_UNUSED; { - int sep, ab, xy, reg, treg; + int sep; + unsigned int ab, xy, reg, treg; expressionS e1, e2; if (!in_procedure ("spillreg")) @@ -3952,7 +3953,8 @@ dot_spillmem (psprel) int psprel; { expressionS e1, e2; - int sep, ab, reg; + int sep; + unsigned int ab, reg; if (!in_procedure ("spillmem")) return; @@ -3990,7 +3992,8 @@ static void dot_spillreg_p (dummy) int dummy ATTRIBUTE_UNUSED; { - int sep, ab, xy, reg, treg; + int sep; + unsigned int ab, xy, reg, treg; expressionS e1, e2, e3; unsigned int qp; @@ -4041,7 +4044,8 @@ dot_spillmem_p (psprel) int psprel; { expressionS e1, e2, e3; - int sep, ab, reg; + int sep; + unsigned int ab, reg; unsigned int qp; if (!in_procedure ("spillmem.p")) @@ -4361,7 +4365,7 @@ dot_endp (dummy) int dummy ATTRIBUTE_UNUSED; { expressionS e; - unsigned char *ptr; + char *ptr; int bytes_per_address; long where; segT saved_seg; @@ -6348,7 +6352,8 @@ build_insn (slot, insnp) { const struct ia64_operand *odesc, *o2desc; struct ia64_opcode *idesc = slot->idesc; - bfd_signed_vma insn, val; + bfd_vma insn; + bfd_signed_vma val; const char *err; int i; diff --git a/gas/config/tc-ip2k.c b/gas/config/tc-ip2k.c index a57bc96..8a3befb 100644 --- a/gas/config/tc-ip2k.c +++ b/gas/config/tc-ip2k.c @@ -1,5 +1,5 @@ /* tc-ip2k.c -- Assembler for the Scenix IP2xxx. - Copyright (C) 2000, 2002, 2003 Free Software Foundation. + Copyright (C) 2000, 2002, 2003, 2005 Free Software Foundation. This file is part of GAS, the GNU Assembler. @@ -173,7 +173,7 @@ md_assemble (str) the PCL (pc + 2) >> 1 is odd or even. */ { enum cgen_parse_operand_result result_type; - long value; + bfd_vma value; const char *curpc_plus_2 = ".+2"; const char *err; @@ -436,7 +436,7 @@ ip2k_apply_fix3 (fixP, valueP, seg) /* Canonical name, since used a lot. */ CGEN_CPU_DESC cd = gas_cgen_cpu_desc; CGEN_INSN_INT insn_value - = cgen_get_insn_value (cd, where, + = cgen_get_insn_value (cd, (unsigned char *) where, CGEN_INSN_BITSIZE (fixP->fx_cgen.insn)); /* Preserve (DP) or (SP) specification. */ *valueP += (insn_value & 0x180); diff --git a/gas/config/tc-m68hc11.c b/gas/config/tc-m68hc11.c index 41c2f15..19d9c24 100644 --- a/gas/config/tc-m68hc11.c +++ b/gas/config/tc-m68hc11.c @@ -1,5 +1,6 @@ /* tc-m68hc11.c -- Assembler code for the Motorola 68HC11 & 68HC12. - Copyright 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Free Software Foundation, Inc. Written by Stephane Carrez (stcarrez@nerim.fr) This file is part of GAS, the GNU Assembler. @@ -2449,8 +2450,8 @@ md_assemble (char *str) struct m68hc11_opcode_def *opc; struct m68hc11_opcode *opcode; - unsigned char *op_start, *save; - unsigned char *op_end; + unsigned char *op_start, *op_end; + char *save; char name[20]; int nlen = 0; operand operands[M6811_MAX_OPERANDS]; @@ -2464,7 +2465,7 @@ md_assemble (char *str) /* Find the opcode end and get the opcode in 'name'. The opcode is forced lower case (the opcode table only has lower case op-codes). */ - for (op_start = op_end = (unsigned char *) (str); + for (op_start = op_end = (unsigned char *) str; *op_end && nlen < 20 && !is_end_of_line[*op_end] && *op_end != ' '; op_end++) { @@ -2544,7 +2545,7 @@ md_assemble (char *str) return; } save = input_line_pointer; - input_line_pointer = op_end; + input_line_pointer = (char *) op_end; if (opc) { diff --git a/gas/config/tc-maxq.c b/gas/config/tc-maxq.c index dda7ca4..8c54763 100644 --- a/gas/config/tc-maxq.c +++ b/gas/config/tc-maxq.c @@ -494,7 +494,7 @@ md_convert_frag (object_headers * headers ATTRIBUTE_UNUSED, fragS * fragP) #endif { - unsigned char *opcode; + char *opcode; offsetT target_address; offsetT opcode_address; offsetT displacement_from_opcode_start; @@ -521,9 +521,7 @@ md_convert_frag (object_headers * headers ATTRIBUTE_UNUSED, || fragP->fr_subtype == NO_PREFIX)) { /* Its a displacement. */ - char *p = (char *) &opcode[0]; - - *p = (char) displacement_from_opcode_start; + *opcode = (char) displacement_from_opcode_start; } else { @@ -542,7 +540,6 @@ md_convert_frag (object_headers * headers ATTRIBUTE_UNUSED, if (fragP->fr_subtype != SHORT_PREFIX) { RELOC_ENUM reloc_type; - unsigned char *opcode; int old_fr_fix; int size = 2; @@ -557,7 +554,6 @@ md_convert_frag (object_headers * headers ATTRIBUTE_UNUSED, if (reloc_type == 1) size = 0; old_fr_fix = fragP->fr_fix; - opcode = (unsigned char *) fragP->fr_opcode; fragP->fr_fix += (size); diff --git a/gas/config/tc-mcore.c b/gas/config/tc-mcore.c index 02f2139..7a14997 100644 --- a/gas/config/tc-mcore.c +++ b/gas/config/tc-mcore.c @@ -1845,10 +1845,10 @@ md_convert_frag (abfd, sec, fragP) segT sec ATTRIBUTE_UNUSED; register fragS * fragP; { - unsigned char * buffer; + char *buffer; int targ_addr = S_GET_VALUE (fragP->fr_symbol) + fragP->fr_offset; - buffer = (unsigned char *) (fragP->fr_fix + fragP->fr_literal); + buffer = fragP->fr_fix + fragP->fr_literal; switch (fragP->fr_subtype) { diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index ffc44cb..02ff10a 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -11075,7 +11075,7 @@ md_apply_fix3 (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) if (fixP->fx_done) { if (8 <= sizeof (valueT)) - md_number_to_chars (buf, *valP, 8); + md_number_to_chars ((char *) buf, *valP, 8); else { valueT hiv; @@ -11098,14 +11098,14 @@ md_apply_fix3 (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) value now. This can happen if we have a .word which is not resolved when it appears but is later defined. */ if (fixP->fx_done) - md_number_to_chars (buf, *valP, 4); + md_number_to_chars ((char *) buf, *valP, 4); break; case BFD_RELOC_16: /* If we are deleting this reloc entry, we must fill in the value now. */ if (fixP->fx_done) - md_number_to_chars (buf, *valP, 2); + md_number_to_chars ((char *) buf, *valP, 2); break; case BFD_RELOC_LO16: @@ -11121,7 +11121,7 @@ md_apply_fix3 (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) _("relocation overflow")); if (target_big_endian) buf += 2; - md_number_to_chars (buf, *valP, 2); + md_number_to_chars ((char *) buf, *valP, 2); } break; @@ -11147,7 +11147,7 @@ md_apply_fix3 (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) if (*valP + 0x20000 <= 0x3ffff) { insn |= (*valP >> 2) & 0xffff; - md_number_to_chars (buf, insn, 4); + md_number_to_chars ((char *) buf, insn, 4); } else if (mips_pic == NO_PIC && fixP->fx_done @@ -11169,7 +11169,7 @@ md_apply_fix3 (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) fixP->fx_done = 0; fixP->fx_addsy = section_symbol (text_section); *valP += md_pcrel_from (fixP); - md_number_to_chars (buf, insn, 4); + md_number_to_chars ((char *) buf, insn, 4); } else { @@ -12945,7 +12945,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec, fragS *fragp) fixp->fx_file = fragp->fr_file; fixp->fx_line = fragp->fr_line; - md_number_to_chars (buf, insn, 4); + md_number_to_chars ((char *) buf, insn, 4); buf += 4; } else @@ -13017,11 +13017,11 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec, fragS *fragp) i--; insn |= i; /* Branch over the jump. */ - md_number_to_chars (buf, insn, 4); + md_number_to_chars ((char *) buf, insn, 4); buf += 4; /* Nop */ - md_number_to_chars (buf, 0, 4); + md_number_to_chars ((char *) buf, 0, 4); buf += 4; if (RELAX_BRANCH_LIKELY (fragp->fr_subtype)) @@ -13040,10 +13040,10 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec, fragS *fragp) delay slot. */ insn |= i; - md_number_to_chars (buf, insn, 4); + md_number_to_chars ((char *) buf, insn, 4); buf += 4; - md_number_to_chars (buf, 0, 4); + md_number_to_chars ((char *) buf, 0, 4); buf += 4; } @@ -13062,7 +13062,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec, fragS *fragp) fixp->fx_file = fragp->fr_file; fixp->fx_line = fragp->fr_line; - md_number_to_chars (buf, insn, 4); + md_number_to_chars ((char *) buf, insn, 4); buf += 4; } else @@ -13084,13 +13084,13 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec, fragS *fragp) fixp->fx_file = fragp->fr_file; fixp->fx_line = fragp->fr_line; - md_number_to_chars (buf, insn, 4); + md_number_to_chars ((char *) buf, insn, 4); buf += 4; if (mips_opts.isa == ISA_MIPS1) { /* nop */ - md_number_to_chars (buf, 0, 4); + md_number_to_chars ((char *) buf, 0, 4); buf += 4; } @@ -13102,7 +13102,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec, fragS *fragp) fixp->fx_file = fragp->fr_file; fixp->fx_line = fragp->fr_line; - md_number_to_chars (buf, insn, 4); + md_number_to_chars ((char *) buf, insn, 4); buf += 4; /* j(al)r $at. */ @@ -13111,7 +13111,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec, fragS *fragp) else insn = 0x00200008; - md_number_to_chars (buf, insn, 4); + md_number_to_chars ((char *) buf, insn, 4); buf += 4; } } @@ -13204,12 +13204,12 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec, fragS *fragp) if (use_extend) { - md_number_to_chars (buf, 0xf000 | extend, 2); + md_number_to_chars ((char *) buf, 0xf000 | extend, 2); fragp->fr_fix += 2; buf += 2; } - md_number_to_chars (buf, insn, 2); + md_number_to_chars ((char *) buf, insn, 2); fragp->fr_fix += 2; buf += 2; } @@ -13605,6 +13605,7 @@ s_mips_end (int x ATTRIBUTE_UNUSED) else as_warn (_(".end directive missing or unknown symbol")); +#ifdef OBJ_ELF /* Create an expression to calculate the size of the function. */ if (p && cur_proc_ptr) { @@ -13620,7 +13621,6 @@ s_mips_end (int x ATTRIBUTE_UNUSED) cur_proc_ptr->func_end_sym = exp->X_add_symbol; } -#ifdef OBJ_ELF /* Generate a .pdr section. */ if (OUTPUT_FLAVOR == bfd_target_elf_flavour && ! ECOFF_DEBUGGING && mips_flag_pdr) diff --git a/gas/config/tc-msp430.c b/gas/config/tc-msp430.c index 43cc537..e75347d 100644 --- a/gas/config/tc-msp430.c +++ b/gas/config/tc-msp430.c @@ -1887,7 +1887,7 @@ md_apply_fix3 (fixS * fixp, valueT * valuep, segT seg) /* Fetch the instruction, insert the fully resolved operand value, and stuff the instruction back again. */ - where = fixp->fx_frag->fr_literal + fixp->fx_where; + where = (unsigned char *) fixp->fx_frag->fr_literal + fixp->fx_where; insn = bfd_getl16 (where); diff --git a/gas/config/tc-pj.c b/gas/config/tc-pj.c index 8092d3b..2a7951e 100644 --- a/gas/config/tc-pj.c +++ b/gas/config/tc-pj.c @@ -1,6 +1,6 @@ /*- tc-pj.c -- Assemble code for Pico Java - Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -253,8 +253,8 @@ void md_assemble (str) char *str; { - unsigned char *op_start; - unsigned char *op_end; + char *op_start; + char *op_end; pj_opc_info_t *opcode; char *output; @@ -268,8 +268,9 @@ md_assemble (str) str++; /* Find the op code end. */ - for (op_start = op_end = (unsigned char *) (str); - *op_end && !is_end_of_line[*op_end] && *op_end != ' '; + op_start = str; + for (op_end = str; + *op_end && !is_end_of_line[*op_end & 0xff] && *op_end != ' '; op_end++) nlen++; diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index 410c0f2..6f0b717 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -1,6 +1,6 @@ /* tc-ppc.c -- Assemble for the PowerPC or POWER (RS/6000) Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004 Free Software Foundation, Inc. + 2004, 2005 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of GAS, the GNU Assembler. @@ -5819,7 +5819,7 @@ md_apply_fix3 (fixP, valP, seg) if (fixP->fx_pcrel) abort (); { - unsigned char *where = fixP->fx_frag->fr_literal + fixP->fx_where; + char *where = fixP->fx_frag->fr_literal + fixP->fx_where; unsigned long val, mask; if (target_big_endian) diff --git a/gas/config/tc-ppc.h b/gas/config/tc-ppc.h index e08b12d..950d06f 100644 --- a/gas/config/tc-ppc.h +++ b/gas/config/tc-ppc.h @@ -1,6 +1,6 @@ /* tc-ppc.h -- Header file for tc-ppc.c. Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004 Free Software Foundation, Inc. + 2004, 2005 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of GAS, the GNU Assembler. @@ -90,7 +90,7 @@ extern char *ppc_target_format PARAMS ((void)); - ((FRAGP)->fr_address + (FRAGP)->fr_fix)); \ if (count != 0 && (count & 3) == 0) \ { \ - unsigned char *dest = (FRAGP)->fr_literal + (FRAGP)->fr_fix; \ + char *dest = (FRAGP)->fr_literal + (FRAGP)->fr_fix; \ \ (FRAGP)->fr_var = 4; \ if (target_big_endian) \ diff --git a/gas/config/tc-s390.c b/gas/config/tc-s390.c index 13ced8b..243910e 100644 --- a/gas/config/tc-s390.c +++ b/gas/config/tc-s390.c @@ -1602,7 +1602,7 @@ s390_insn (ignore) && (addressT) exp.X_add_number < (1ULL << 32)) || ( opformat->oplen == 2 && (addressT) exp.X_add_number < (1ULL << 16))) - md_number_to_chars (insn, exp.X_add_number, opformat->oplen); + md_number_to_chars ((char *) insn, exp.X_add_number, opformat->oplen); else as_bad (_("Invalid .insn format\n")); } @@ -1612,9 +1612,9 @@ s390_insn (ignore) && opformat->oplen == 6 && generic_bignum[3] == 0) { - md_number_to_chars (insn, generic_bignum[2], 2); - md_number_to_chars (&insn[2], generic_bignum[1], 2); - md_number_to_chars (&insn[4], generic_bignum[0], 2); + md_number_to_chars ((char *) insn, generic_bignum[2], 2); + md_number_to_chars ((char *) &insn[2], generic_bignum[1], 2); + md_number_to_chars ((char *) &insn[4], generic_bignum[0], 2); } else as_bad (_("Invalid .insn format\n")); @@ -1992,8 +1992,8 @@ md_apply_fix3 (fixP, valP, seg) if (fixP->fx_done) { /* Insert the fully resolved operand value. */ - s390_insert_operand (where, operand, (offsetT) value, - fixP->fx_file, fixP->fx_line); + s390_insert_operand ((unsigned char *) where, operand, + (offsetT) value, fixP->fx_file, fixP->fx_line); return; } diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c index 2628ff7..74f02aa 100644 --- a/gas/config/tc-sh.c +++ b/gas/config/tc-sh.c @@ -2400,7 +2400,7 @@ find_cooked_opcode (char **str_p) The pre-processor will eliminate whitespace in front of any '@' after the first argument; we may be called from assemble_ppi, so the opcode might be terminated by an '@'. */ - for (op_start = op_end = (unsigned char *) (str); + for (op_start = op_end = (unsigned char *) str; *op_end && nlen < 20 && !is_end_of_line[*op_end] && *op_end != ' ' && *op_end != '@'; @@ -2419,7 +2419,7 @@ find_cooked_opcode (char **str_p) } name[nlen] = 0; - *str_p = op_end; + *str_p = (char *) op_end; if (nlen == 0) as_bad (_("can't find opcode ")); @@ -2734,7 +2734,7 @@ assemble_ppi (char *op_end, sh_opcode_info *opcode) void md_assemble (char *str) { - unsigned char *op_end; + char *op_end; sh_operand_info operand[3]; sh_opcode_info *opcode; unsigned int size = 0; diff --git a/gas/config/tc-sh64.c b/gas/config/tc-sh64.c index 6ac4967..a95589e 100644 --- a/gas/config/tc-sh64.c +++ b/gas/config/tc-sh64.c @@ -1,5 +1,5 @@ /* tc-sh64.c -- Assemble code for the SuperH SH SHcompact and SHmedia. - Copyright 2000, 2001, 2002, 2003 Free Software Foundation. + Copyright 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation. This file is part of GAS, the GNU Assembler. @@ -691,7 +691,7 @@ shmedia_md_apply_fix3 (fixS *fixP, valueT *valp) if (fixP->fx_addsy == NULL && fixP->fx_pcrel == 0) { /* Emit error for an out-of-range value. */ - shmedia_check_limits (valp, fixP->fx_r_type, fixP); + shmedia_check_limits ((offsetT *) valp, fixP->fx_r_type, fixP); switch (fixP->fx_r_type) { diff --git a/gas/config/tc-tic4x.c b/gas/config/tc-tic4x.c index 77f2ec6..334444e 100644 --- a/gas/config/tc-tic4x.c +++ b/gas/config/tc-tic4x.c @@ -157,7 +157,7 @@ static void tic4x_insert_sym static char *tic4x_expression PARAMS ((char *, expressionS *)); static char *tic4x_expression_abs - PARAMS ((char *, int *)); + PARAMS ((char *, offsetT *)); static void tic4x_emit_char PARAMS ((char, int)); static void tic4x_seg_alloc @@ -747,7 +747,7 @@ tic4x_expression (str, exp) static char * tic4x_expression_abs (str, value) char *str; - int *value; + offsetT *value; { char *s; char *t; @@ -843,7 +843,7 @@ tic4x_bss (x) char c; char *name; char *p; - int size; + offsetT size; segT current_seg; subsegT current_subseg; symbolS *symbolP; @@ -864,7 +864,7 @@ tic4x_bss (x) tic4x_expression_abs (++input_line_pointer, &size); if (size < 0) { - as_bad (".bss size %d < 0!", size); + as_bad (".bss size %ld < 0!", (long) size); return; } subseg_set (bss_section, 0); @@ -1024,7 +1024,7 @@ tic4x_eval (x) int x ATTRIBUTE_UNUSED; { char c; - int value; + offsetT value; char *name; SKIP_WHITESPACE (); @@ -1060,7 +1060,7 @@ tic4x_sect (x) char *subsection_name; char *name; segT seg; - int num; + offsetT num; SKIP_WHITESPACE (); if (*input_line_pointer == '"') @@ -1163,7 +1163,7 @@ tic4x_usect (x) char *name; char *section_name; segT seg; - int size, alignment_flag; + offsetT size, alignment_flag; segT current_seg; subsegT current_subseg; @@ -1226,15 +1226,15 @@ static void tic4x_version (x) int x ATTRIBUTE_UNUSED; { - unsigned int temp; + offsetT temp; input_line_pointer = tic4x_expression_abs (input_line_pointer, &temp); if (!IS_CPU_TIC3X (temp) && !IS_CPU_TIC4X (temp)) - as_bad ("This assembler does not support processor generation %d", - temp); + as_bad ("This assembler does not support processor generation %ld", + (long) temp); - if (tic4x_cpu && temp != tic4x_cpu) + if (tic4x_cpu && temp != (offsetT) tic4x_cpu) as_warn ("Changing processor generation on fly not supported..."); tic4x_cpu = temp; demand_empty_rest_of_line (); @@ -2675,7 +2675,7 @@ md_atof (type, litP, sizeP) int ieee; LITTLENUM_TYPE words[MAX_LITTLENUMS]; LITTLENUM_TYPE *wordP; - unsigned char *t; + char *t; switch (type) { @@ -2718,7 +2718,7 @@ md_atof (type, litP, sizeP) if (t) input_line_pointer = t; *sizeP = prec * sizeof (LITTLENUM_TYPE); - t = litP; + /* This loops outputs the LITTLENUMs in REVERSE order; in accord with little endian byte order. */ /* SES: However it is required to put the words (32-bits) out in the @@ -3072,9 +3072,10 @@ long md_pcrel_from (fixP) fixS *fixP; { - unsigned char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; + unsigned char *buf; unsigned int op; + buf = (unsigned char *) fixP->fx_frag->fr_literal + fixP->fx_where; op = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; return ((fixP->fx_where + fixP->fx_frag->fr_address) >> 2) + diff --git a/gas/config/tc-tic80.c b/gas/config/tc-tic80.c index af4ceb4..3c4c303 100644 --- a/gas/config/tc-tic80.c +++ b/gas/config/tc-tic80.c @@ -1,5 +1,6 @@ /* tc-tic80.c -- Assemble for the TI TMS320C80 (MV) - Copyright 1996, 1997, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1996, 1997, 2000, 2001, 2002, 2005 + Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -685,7 +686,7 @@ md_assemble (str) char *str; { char *scan; - unsigned char *input_line_save; + char *input_line_save; struct tic80_opcode *opcode; expressionS myops[16]; diff --git a/gas/config/tc-v850.c b/gas/config/tc-v850.c index dd61e1a..ed59e04 100644 --- a/gas/config/tc-v850.c +++ b/gas/config/tc-v850.c @@ -1,5 +1,5 @@ /* tc-v850.c -- Assembler code for the NEC V850 - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -1291,7 +1291,7 @@ md_convert_frag (abfd, sec, fragP) /* Now create the unconditional branch + fixup to the final target. */ - md_number_to_chars (buffer + 2, 0x00000780, 4); + md_number_to_chars ((char *) buffer + 2, 0x00000780, 4); fix_new (fragP, fragP->fr_fix + 2, 4, fragP->fr_symbol, fragP->fr_offset, 1, BFD_RELOC_UNUSED + (int) fragP->fr_opcode + 1); diff --git a/gas/config/tc-vax.c b/gas/config/tc-vax.c index 4cf9e15..1b4e6f1 100644 --- a/gas/config/tc-vax.c +++ b/gas/config/tc-vax.c @@ -667,7 +667,8 @@ md_assemble (instruction_string) /* Remember where it is, in case we want to modify the op-code later. */ opcode_low_byteP = frag_more (v.vit_opcode_nbytes); memcpy (opcode_low_byteP, v.vit_opcode, v.vit_opcode_nbytes); - opcode_as_number = md_chars_to_number (opcode_as_chars = v.vit_opcode, 4); + opcode_as_chars = v.vit_opcode; + opcode_as_number = md_chars_to_number ((unsigned char *) opcode_as_chars, 4); for (operandP = v.vit_operand, expP = exp_of_operand, segP = seg_of_operand, diff --git a/gas/config/tc-w65.c b/gas/config/tc-w65.c index 9a313b2..f290354 100644 --- a/gas/config/tc-w65.c +++ b/gas/config/tc-w65.c @@ -1,5 +1,6 @@ /* tc-w65.c -- Assemble code for the W65816 - Copyright 1995, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1995, 1998, 2000, 2001, 2002, 2005 + Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -894,7 +895,7 @@ md_convert_frag (headers, seg, fragP) fragP->fr_offset); int disp = targ_addr - next_inst; - md_number_to_chars (buffer + inst_size, disp, disp_size); + md_number_to_chars ((char *) buffer + inst_size, disp, disp_size); fragP->fr_fix += disp_size + inst_size; fragP->fr_var = 0; } diff --git a/gas/config/tc-xstormy16.c b/gas/config/tc-xstormy16.c index 7928634..e27c7a7 100644 --- a/gas/config/tc-xstormy16.c +++ b/gas/config/tc-xstormy16.c @@ -517,17 +517,19 @@ xstormy16_md_apply_fix3 (fixP, valueP, seg) #if CGEN_INT_INSN_P { CGEN_INSN_INT insn_value = - cgen_get_insn_value (cd, where, CGEN_INSN_BITSIZE (insn)); + cgen_get_insn_value (cd, (unsigned char *) where, + CGEN_INSN_BITSIZE (insn)); /* ??? 0 is passed for `pc'. */ errmsg = CGEN_CPU_INSERT_OPERAND (cd) (cd, opindex, fields, &insn_value, (bfd_vma) 0); - cgen_put_insn_value (cd, where, CGEN_INSN_BITSIZE (insn), - insn_value); + cgen_put_insn_value (cd, (unsigned char *) where, + CGEN_INSN_BITSIZE (insn), insn_value); } #else /* ??? 0 is passed for `pc'. */ - errmsg = CGEN_CPU_INSERT_OPERAND (cd) (cd, opindex, fields, where, + errmsg = CGEN_CPU_INSERT_OPERAND (cd) (cd, opindex, fields, + (unsigned char *) where, (bfd_vma) 0); #endif if (errmsg) diff --git a/gas/config/tc-z8k.c b/gas/config/tc-z8k.c index 9fd4523..97f1341 100644 --- a/gas/config/tc-z8k.c +++ b/gas/config/tc-z8k.c @@ -203,7 +203,7 @@ static int the_flags; static int the_interrupt; static char * -whatreg (int *reg, char *src) +whatreg (unsigned int *reg, char *src) { if (ISDIGIT (src[1])) { @@ -631,13 +631,14 @@ get_operand (char **ptr, struct z8k_op *mode, unsigned int dst ATTRIBUTE_UNUSED) } else { - int regn; + unsigned int regn; end = parse_reg (src, &mode->mode, ®n); if (end) { - int nw, nr; + int nw; + unsigned int nr; src = end; if (*src == '(') |