gdb/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Fri, 20 Nov 2009 20:01:08 +0000 (20:01 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Fri, 20 Nov 2009 20:01:08 +0000 (20:01 +0000)
* breakpoint.c (bp_location_compare): Change parameter a to ap and b to
bp.  New variables a and b.
(bp_location_compare_for_qsort): Remove.
(update_global_location_list): Use now bp_location_compare.

gdb/ChangeLog
gdb/breakpoint.c

index 1a4fcd7..a74e149 100644 (file)
@@ -1,5 +1,12 @@
 2009-11-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
+       * breakpoint.c (bp_location_compare): Change parameter a to ap and b to
+       bp.  New variables a and b.
+       (bp_location_compare_for_qsort): Remove.
+       (update_global_location_list): Use now bp_location_compare.
+
+2009-11-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
        Fix repeated rwatch output.
        * amd64-linux-nat.c (amd64_linux_dr_set, amd64_linux_dr_set_control)
        (amd64_linux_dr_set_addr, amd64_linux_dr_reset_addr)
index d879b57..bca923e 100644 (file)
@@ -8112,15 +8112,17 @@ breakpoint_auto_delete (bpstat bs)
   }
 }
 
-/* A comparison function for bp_location A and B being interfaced to qsort.
+/* A comparison function for bp_location AP and BP being interfaced to qsort.
    Sort elements primarily by their ADDRESS (no matter what does
    breakpoint_address_is_meaningful say for its OWNER), secondarily by ordering
    first bp_permanent OWNERed elements and terciarily just ensuring the array
    is sorted stable way despite qsort being an instable algorithm.  */
 
 static int
-bp_location_compare (struct bp_location *a, struct bp_location *b)
+bp_location_compare (const void *ap, const void *bp)
 {
+  struct bp_location *a = *(void **) ap;
+  struct bp_location *b = *(void **) bp;
   int a_perm = a->owner->enable_state == bp_permanent;
   int b_perm = b->owner->enable_state == bp_permanent;
 
@@ -8141,17 +8143,6 @@ bp_location_compare (struct bp_location *a, struct bp_location *b)
   return (a > b) - (a < b);
 }
 
-/* Interface bp_location_compare as the COMPAR parameter of qsort function.  */
-
-static int
-bp_location_compare_for_qsort (const void *ap, const void *bp)
-{
-  struct bp_location *a = *(void **) ap;
-  struct bp_location *b = *(void **) bp;
-
-  return bp_location_compare (a, b);
-}
-
 /* Set bp_location_placed_address_before_address_max and
    bp_location_shadow_len_after_address_max according to the current content of
    the bp_location array.  */
@@ -8235,7 +8226,7 @@ update_global_location_list (int should_insert)
     for (loc = b->loc; loc; loc = loc->next)
       *locp++ = loc;
   qsort (bp_location, bp_location_count, sizeof (*bp_location),
-        bp_location_compare_for_qsort);
+        bp_location_compare);
 
   bp_location_target_extensions_update ();