This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: Avoid signed/unsigned warnings in tc-arm.c
Zack Weinberg wrote:
Khem Raj wrote:
OK. Here is revised patch based on Zack's comments. How about this one?
I can't approve this, but it looks good to me. Just a few notes on ChangeLog
writing:
1) Don't send a ChangeLog as a diff. By the time the patch is applied, it
won't apply cleanly.
2) Say what happened, not why. In this case, a correct change log would read
* tc-arm.c (struct arm_it): Make operands.reg and operands.imm signed.
(parse_operands): Make second argument an unsigned const char *.
(do_shift): Make Rm signed.
zw
Thanks for reviewing it. Here is renewed patch and Zack's suggestion on
changelog entry verbatim.
Regards
Khem
gas/ChangeLog
2005-06-23 Khem Raj <kraj@mvista.com>
* tc-arm.c (struct arm_it): Make operands.reg and operands.imm signed.
(parse_operands): Make second argument an unsigned const char *.
(do_shift): Make Rm signed.
? diff
? doc/as.info
Index: config/tc-arm.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-arm.c,v
retrieving revision 1.210
diff -u -r1.210 tc-arm.c
--- config/tc-arm.c 13 Jun 2005 15:34:37 -0000 1.210
+++ config/tc-arm.c 24 Jun 2005 17:02:00 -0000
@@ -225,8 +225,8 @@
struct
{
- unsigned reg;
- unsigned imm;
+ int reg;
+ int imm;
unsigned present : 1; /* operand present */
unsigned isreg : 1; /* operand was a register */
unsigned immisreg : 1; /* .imm field is a second register */
@@ -3567,7 +3567,7 @@
structure. Returns SUCCESS or FAIL depending on whether the
specified grammar matched. */
static int
-parse_operands (char *str, const char *pattern)
+parse_operands (char *str, unsigned const char *pattern)
{
unsigned const char *upat = pattern;
char *backtrack_pos = 0;
@@ -5015,7 +5015,7 @@
static void
do_shift (void)
{
- unsigned int Rm = (inst.operands[1].present
+ int Rm = (inst.operands[1].present
? inst.operands[1].reg
: inst.operands[0].reg);