This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] xtensa: make map_suffix_reloc_to_operator return operatorT
- From: Trevor Saunders <tbsaunde at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 24 May 2016 12:50:57 -0000
- Subject: [binutils-gdb] xtensa: make map_suffix_reloc_to_operator return operatorT
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=cc34adb29049afb367107bad78b163d7deddac3e
commit cc34adb29049afb367107bad78b163d7deddac3e
Author: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
Date: Mon May 23 00:39:47 2016 -0400
xtensa: make map_suffix_reloc_to_operator return operatorT
It always returns an element of the enum operatorT, so it should be clearer to
make that the return type.
gas/ChangeLog:
2016-05-24 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
* config/tc-xtensa.c (struct suffix_reloc_map): Change type of field
operator to operatorT.
(map_suffix_reloc_to_operator): Change return type to operatorT.
Diff:
---
gas/ChangeLog | 6 ++++++
gas/config/tc-xtensa.c | 8 ++++----
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 48cb3cb..3fae338 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,11 @@
2016-05-24 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
+ * config/tc-xtensa.c (struct suffix_reloc_map): Change type of field
+ operator to operatorT.
+ (map_suffix_reloc_to_operator): Change return type to operatorT.
+
+2016-05-24 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
+
* config/tc-d30v.c (find_format): Change type of X_op to operatorT.
2016-05-24 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
index 94411c3..40137ff 100644
--- a/gas/config/tc-xtensa.c
+++ b/gas/config/tc-xtensa.c
@@ -364,7 +364,7 @@ struct suffix_reloc_map
const char *suffix;
int length;
bfd_reloc_code_real_type reloc;
- unsigned char operator;
+ operatorT operator;
};
#define SUFFIX_MAP(str, reloc, op) { str, sizeof (str) - 1, reloc, op }
@@ -1773,11 +1773,11 @@ xtensa_elf_suffix (char **str_p, expressionS *exp_p)
/* Find the matching operator type. */
-static unsigned char
+static operatorT
map_suffix_reloc_to_operator (bfd_reloc_code_real_type reloc)
{
struct suffix_reloc_map *sfx;
- unsigned char operator = (unsigned char) -1;
+ operatorT operator = O_illegal;
for (sfx = &suffix_relocs[0]; sfx->suffix; sfx++)
{
@@ -1787,7 +1787,7 @@ map_suffix_reloc_to_operator (bfd_reloc_code_real_type reloc)
break;
}
}
- gas_assert (operator != (unsigned char) -1);
+ gas_assert (operator != O_illegal);
return operator;
}