This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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]

FYI: use VEC_cleanup in breakpoint.c


I'm checking this in.

While looking at something else I noticed a spot in breakpoint.c where
we could use VEC_cleanup rather than a custom function.

Tom

2011-08-08  Tom Tromey  <tromey@redhat.com>

	* breakpoint.c (clean_up_filters): Remove.
	(catch_syscall_split_args): Use VEC_cleanup.

Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.608
diff -u -r1.608 breakpoint.c
--- breakpoint.c	4 Aug 2011 19:10:11 -0000	1.608
+++ breakpoint.c	8 Aug 2011 15:50:50 -0000
@@ -9937,21 +9937,13 @@
   b->language = language_ada;
 }
 
-/* Cleanup function for a syscall filter list.  */
-static void
-clean_up_filters (void *arg)
-{
-  VEC(int) *iter = *(VEC(int) **) arg;
-  VEC_free (int, iter);
-}
-
 /* Splits the argument using space as delimiter.  Returns an xmalloc'd
    filter list, or NULL if no filtering is required.  */
 static VEC(int) *
 catch_syscall_split_args (char *arg)
 {
   VEC(int) *result = NULL;
-  struct cleanup *cleanup = make_cleanup (clean_up_filters, &result);
+  struct cleanup *cleanup = make_cleanup (VEC_cleanup (int), &result);
 
   while (*arg != '\0')
     {


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