diff options
author | Alan Modra <amodra@gmail.com> | 2002-12-12 21:34:53 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2002-12-12 21:34:53 +0000 |
commit | 167795c45257ffcd940985513321496028f5fc00 (patch) | |
tree | 9f1a710689ed67eef1eacd66b0fb72421aff4a59 /gas/config/tc-tic80.c | |
parent | 78a33af2ee420f41bf871968204b7e9adfcbf7cd (diff) | |
download | binutils-gdb-167795c45257ffcd940985513321496028f5fc00.tar.gz |
* config/tc-tic30.c: #include stdarg.h or varargs.h.
(debug): Rewrite using VA_* macros.
(md_estimate_size_before_relax): Add ATTRIBUTE_UNUSED to args.
(md_convert_frag): Likewise.
(md_parse_option): Likewise.
(md_show_usage): Likewise.
(md_undefined_symbol): Likewise.
(tc_gen_reloc): Likewise.
(md_operand): Likewise.
(tc_aout_pre_write_hook): Delete.
(struct tic30_insn): Make "operands" unsigned.
(struct tic30_par_insn): Likewise.
(md_assemble): Likewise for "count", "i" and "numops".
(tic30_parallel_insn): Likewise for vars here.
(tic30_operand): Likewise. Remove useless unsigned >= 0 comparison.
* config/tc-tic30.h (tc_aout_pre_write_hook): Define as empty.
* config/tc-tic80.c (obj_coff_section): Delete declaration.
(md_estimate_size_before_relax): Add ATTRIBUTE_UNUSED on args.
(md_undefined_symbol): Likewise.
(md_parse_option): Likewise.
(md_convert_frag): Likewise.
(tc_coff_symbol_emit_hook): Likewise.
(md_atof): Remove declaration of atof_ieee.
(const_overflow): Warning fixes, tidy.
(get_operands): Delete unused vars.
(internal_error_a): Adjust format string to expect a long for arg.
(find_opcode): Warning fixes, simplify.
(build_insn): Cast internal_error_a arg.
(md_begin): Likewise.
(md_apply_fix3): Likewise.
(md_assemble): Delete unused var.
* config/tc-tic80.h (tc_coff_fix2rtype): Prototype.
Diffstat (limited to 'gas/config/tc-tic80.c')
-rw-r--r-- | gas/config/tc-tic80.c | 70 |
1 files changed, 33 insertions, 37 deletions
diff --git a/gas/config/tc-tic80.c b/gas/config/tc-tic80.c index c34a5e107a8..0ec638228b5 100644 --- a/gas/config/tc-tic80.c +++ b/gas/config/tc-tic80.c @@ -26,7 +26,7 @@ as_fatal (_("internal error:%s:%d: %s\n"), __FILE__, __LINE__, what) #define internal_error_a(what,arg) \ - as_fatal (_("internal error:%s:%d: %s %d\n"), __FILE__, __LINE__, what, arg) + as_fatal (_("internal error:%s:%d: %s %ld\n"), __FILE__, __LINE__, what, arg) /* Generic assembler global variables which must be defined by all targets. */ @@ -57,8 +57,6 @@ const char FLT_CHARS[] = "fF"; function to call to execute this pseudo-op integer arg to pass to the function */ -extern void obj_coff_section (); - const pseudo_typeS md_pseudo_table[] = { { "align", s_align_bytes, 4 }, /* Do byte alignment, default is a 4 byte boundary */ { "word", cons, 4 }, /* FIXME: Should this be machine independent? */ @@ -85,8 +83,8 @@ static int tic80_relax = 0; int md_estimate_size_before_relax (fragP, segment_type) - fragS *fragP; - segT segment_type; + fragS *fragP ATTRIBUTE_UNUSED; + segT segment_type ATTRIBUTE_UNUSED; { internal_error (_("Relaxation is a luxury we can't afford")); return (-1); @@ -96,7 +94,7 @@ md_estimate_size_before_relax (fragP, segment_type) symbolS * md_undefined_symbol (name) - char *name; + char *name ATTRIBUTE_UNUSED; { return 0; } @@ -118,7 +116,6 @@ md_atof (type, litP, sizeP) LITTLENUM_TYPE words[MAX_LITTLENUMS]; LITTLENUM_TYPE *wordP; char *t; - char *atof_ieee (); switch (type) { @@ -170,20 +167,21 @@ const_overflow (num, bits, flags) int retval = 0; /* Only need to check fields less than 32 bits wide. */ - if (bits < 32) - if (flags & TIC80_OPERAND_SIGNED) - { - max = (1 << (bits - 1)) - 1; - min = - (1 << (bits - 1)); - retval = ((long) num > max) || ((long) num < min); - } - else - { - max = (1 << bits) - 1; - min = 0; - retval = (num > max) || (num < min); - } - return (retval); + if (bits >= 32) + return retval; + + if (flags & TIC80_OPERAND_SIGNED) + { + max = (1 << (bits - 1)) - 1; + min = - (1 << (bits - 1)); + retval = (long) num > max || (long) num < min; + } + else + { + max = (1 << bits) - 1; + retval = num > (unsigned long) max; + } + return retval; } /* get_operands () parses a string of operands and fills in a passed @@ -201,8 +199,6 @@ get_operands (exp) { char *p = input_line_pointer; int numexp = 0; - int mflag = 0; - int sflag = 0; int parens = 0; while (*p) @@ -426,9 +422,9 @@ find_opcode (opcode, myops) expression that supplies additional information about the operand, such as ":m" or ":s" modifiers. Check to see that the operand matches this requirement. */ - if (!((num & TIC80_OPERAND_M_SI) && (flags & TIC80_OPERAND_M_SI) - || (num & TIC80_OPERAND_M_LI) && (flags & TIC80_OPERAND_M_LI) - || (num & TIC80_OPERAND_SCALED) && (flags & TIC80_OPERAND_SCALED))) + if (!((num & flags & TIC80_OPERAND_M_SI) + || (num & flags & TIC80_OPERAND_M_LI) + || (num & flags & TIC80_OPERAND_SCALED))) { match = 0; } @@ -465,7 +461,7 @@ find_opcode (opcode, myops) case O_logical_or: case O_max: default: - internal_error_a (_("unhandled expression type"), X_op); + internal_error_a (_("unhandled expression type"), (long) X_op); } } if (!match) @@ -709,7 +705,7 @@ build_insn (opcode, opers) else { internal_error_a (_("unhandled operand modifier"), - opers[expi].X_add_number); + (long) opers[expi].X_add_number); } break; case O_big: @@ -750,7 +746,7 @@ build_insn (opcode, opers) case O_logical_or: case O_max: default: - internal_error_a (_("unhandled expression"), X_op); + internal_error_a (_("unhandled expression"), (long) X_op); break; } } @@ -779,7 +775,6 @@ md_assemble (str) unsigned char *input_line_save; struct tic80_opcode *opcode; expressionS myops[16]; - unsigned long insn; /* Ensure there is something there to assemble. */ assert (str); @@ -890,7 +885,8 @@ md_begin () valu = PDS_VALUE (pdsp) & ~TIC80_OPERAND_MASK; break; default: - internal_error_a (_("unhandled predefined symbol bits"), symtype); + internal_error_a (_("unhandled predefined symbol bits"), + (long) symtype); break; } symbol_table_insert (symbol_create (PDS_NAME (pdsp), segment, valu, @@ -925,7 +921,7 @@ size_t md_longopts_size = sizeof (md_longopts); int md_parse_option (c, arg) int c; - char *arg; + char *arg ATTRIBUTE_UNUSED; { switch (c) { @@ -1000,7 +996,7 @@ md_apply_fix3 (fixP, valP, seg) break; default: internal_error_a (_("unhandled relocation type in fixup"), - fixP->fx_r_type); + (long) fixP->fx_r_type); break; } @@ -1034,9 +1030,9 @@ md_pcrel_from (fixP) void md_convert_frag (headers, seg, fragP) - object_headers *headers; - segT seg; - fragS *fragP; + object_headers *headers ATTRIBUTE_UNUSED; + segT seg ATTRIBUTE_UNUSED; + fragS *fragP ATTRIBUTE_UNUSED; { internal_error (_("md_convert_frag() not implemented yet")); abort (); @@ -1044,7 +1040,7 @@ md_convert_frag (headers, seg, fragP) void tc_coff_symbol_emit_hook (ignore) - symbolS *ignore; + symbolS *ignore ATTRIBUTE_UNUSED; { } |