This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] nds32: remove a sentinal


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0708347f66e1d8e01b215fb1fe71f634249c5fc9

commit 0708347f66e1d8e01b215fb1fe71f634249c5fc9
Author: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
Date:   Sat May 28 18:16:47 2016 -0400

    nds32: remove a sentinal
    
    gas/ChangeLog:
    
    2016-06-27  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
    
    	* config/tc-nds32.c (md_begin): Use ARRAY_SIZE instead of a sentinal
    	element in relax_table.

Diff:
---
 gas/ChangeLog         |  5 +++++
 gas/config/tc-nds32.c | 19 +++++--------------
 2 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/gas/ChangeLog b/gas/ChangeLog
index 30bd8be..5f85ad5 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2016-06-27  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
+
+	* config/tc-nds32.c (md_begin): Use ARRAY_SIZE instead of a sentinal
+	element in relax_table.
+
 2016-06-25  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
 
 	* config/tc-aarch64.c: Make the type of reg_entry::type
diff --git a/gas/config/tc-nds32.c b/gas/config/tc-nds32.c
index 643f06d..a7e348d 100644
--- a/gas/config/tc-nds32.c
+++ b/gas/config/tc-nds32.c
@@ -1859,17 +1859,7 @@ static relax_info_t relax_table[] =
         {0, 0, 0, 0}
       } /* BR_RANGE_U4G */
     }						/* relax_fixup */
-  },
-  {
-    NULL, 					/* opcode */
-    0,						/* br_range */
-    {{0, 0, 0, FALSE}}, 			/* cond_field */
-    {{0}},					/* relax_code_seq */
-    {{{0, 0, 0, FALSE}}},			/* relax_code_condition */
-    {0}, 					/* relax_code_size */
-    {0}, 					/* relax_branch_isize */
-    {{{0, 0, 0, 0}}},				/* relax_fixup */
-  },
+  }
 };
 
 /* GAS definitions for command-line options.  */
@@ -3983,7 +3973,7 @@ void
 md_begin (void)
 {
   struct nds32_keyword *k;
-  relax_info_t *relax_info;
+  unsigned int i;
 
   bfd_set_arch_mach (stdoutput, TARGET_ARCH, nds32_baseline);
 
@@ -3998,8 +3988,9 @@ md_begin (void)
 
   /* Initial branch hash table.  */
   nds32_relax_info_hash = hash_new ();
-  for (relax_info = relax_table; relax_info->opcode; relax_info++)
-    hash_insert (nds32_relax_info_hash, relax_info->opcode, relax_info);
+  for (i = 0; i < ARRAY_SIZE (relax_table); i++)
+    hash_insert (nds32_relax_info_hash, relax_table[i].opcode,
+		 &relax_table[i]);
 
   /* Initial relax hint hash table.  */
   nds32_hint_hash = hash_new ();


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]