]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove unnecessary ternary operator in m32c-tdep.c
authorSimon Marchi <simon.marchi@ericsson.com>
Tue, 21 Aug 2018 14:47:47 +0000 (10:47 -0400)
committerSimon Marchi <simon.marchi@ericsson.com>
Tue, 21 Aug 2018 14:47:47 +0000 (10:47 -0400)
Bug 17816 pointed out a useless use of the ternary operator:

  case 0x0: sd.reg = (size == 1 ? &st->r0 : &st->r0); break;

I believe that this is right.  If size is 1, the instruction refers to
part of r0, while if size is 2, the instruction refers to the whole of
r0.

gdb/ChangeLog:

PR gdb/17816
* m32c-tdep.c (m32c_decode_srcdest4): Remove unnecessary ternary
operator.

gdb/ChangeLog
gdb/m32c-tdep.c

index ff4d1cb54834d1b148119ea2fc9e37d7339491d1..9173bf94611401b7271fcbe9fc6f520e999cd7eb 100644 (file)
@@ -1,3 +1,9 @@
+2018-08-21  Simon Marchi  <simon.marchi@ericsson.com>
+
+       PR gdb/17816
+       * m32c-tdep.c (m32c_decode_srcdest4): Remove unnecessary ternary
+       operator.
+
 2018-08-19  Simon Marchi  <simon.marchi@polymtl.ca>
 
        * solib-svr4.c (svr4_exec_displacement): Fix formatting.
index fc6277ef5c1235441ba5fa3804568626f190ecab..6fa24452da961c073d97ec0bd8b8db23deda9f6f 100644 (file)
@@ -1236,7 +1236,7 @@ m32c_decode_srcdest4 (struct m32c_pv_state *st,
 
   switch (code)
     {
-    case 0x0: sd.reg = (size == 1 ? &st->r0 : &st->r0); break;
+    case 0x0: sd.reg = &st->r0; break;
     case 0x1: sd.reg = (size == 1 ? &st->r0 : &st->r1); break;
     case 0x2: sd.reg = (size == 1 ? &st->r1 : &st->r2); break;
     case 0x3: sd.reg = (size == 1 ? &st->r1 : &st->r3); break;