This inserts missing parentheses in the calculation of the comparison
result between two different inferior numbers.  The problem was found by
Philipp Rudo.
gdb/ChangeLog:
	* thread.c (tp_array_compar): Insert missing parentheses.
gdb/testsuite/ChangeLog:
	* gdb.multi/tids.exp: Test "thread apply all".
+2016-08-30  Andreas Arnez  <arnez@linux.vnet.ibm.com>
+
+       * thread.c (tp_array_compar): Insert missing parentheses.
+
 2016-08-25  Andreas Arnez  <arnez@linux.vnet.ibm.com>
 
        * xtensa-tdep.h (XTENSA_GDBARCH_TDEP_INSTANTIATE): Replace
 
+2016-08-30  Andreas Arnez  <arnez@linux.vnet.ibm.com>
+
+       * gdb.multi/tids.exp: Test "thread apply all".
+
 2016-08-29  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * gdb.base/default.exp (tty): Remove.
 
     thr_apply_info_thr "1.1-2 2.2-3" \
        "1.1 1.2 2.2 2.3"
 
+    # All threads.
+    thread_apply "all" \
+       "2.3 2.2 2.1 1.3 1.2 1.1"
+    thread_apply "all -ascending" \
+       "1.1 1.2 1.3 2.1 2.2 2.3"
+
     # Now test using GDB convenience variables.
 
     gdb_test "p \$inf = 1" " = 1"
 
 
   if (a->inf->num != b->inf->num)
     {
-      return ((a->inf->num > b->inf->num) - (a->inf->num < b->inf->num)
+      return (((a->inf->num > b->inf->num) - (a->inf->num < b->inf->num))
              * (tp_array_compar_ascending ? +1 : -1));
     }