Fix make_cleanup_dtor signature to match declaration

Message ID 1417559541-32531-1-git-send-email-simon.marchi@ericsson.com
State Committed
Headers

Commit Message

Simon Marchi Dec. 2, 2014, 10:32 p.m. UTC
  The definition does not use the typedef for the dtor function pointer
type that the declaration uses.  It's a cosmetic-only change.

ChangeLog:

	* common/cleanups.c (make_cleanup_dtor): Use typedef for dtor
	type.
---
 gdb/common/cleanups.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Joel Brobecker Dec. 3, 2014, 3:55 a.m. UTC | #1
> The definition does not use the typedef for the dtor function pointer
> type that the declaration uses.  It's a cosmetic-only change.
> 
> ChangeLog:
> 
> 	* common/cleanups.c (make_cleanup_dtor): Use typedef for dtor
> 	type.

I would argue that this goes beyong cosmetic-only in terms of
the benefits, so quite desirable. This is OK.

Thank you!
  
Simon Marchi Dec. 3, 2014, 1:57 p.m. UTC | #2
On 2014-12-02 10:55 PM, Joel Brobecker wrote:
>> The definition does not use the typedef for the dtor function pointer
>> type that the declaration uses.  It's a cosmetic-only change.
>>
>> ChangeLog:
>>
>> 	* common/cleanups.c (make_cleanup_dtor): Use typedef for dtor
>> 	type.
> 
> I would argue that this goes beyong cosmetic-only in terms of
> the benefits, so quite desirable. This is OK.
> 
> Thank you!

Thanks, pushed!
  

Patch

diff --git a/gdb/common/cleanups.c b/gdb/common/cleanups.c
index 80271fd..8678114 100644
--- a/gdb/common/cleanups.c
+++ b/gdb/common/cleanups.c
@@ -124,7 +124,7 @@  make_cleanup (make_cleanup_ftype *function, void *arg)
 
 struct cleanup *
 make_cleanup_dtor (make_cleanup_ftype *function, void *arg,
-		   void (*dtor) (void *))
+		   make_cleanup_dtor_ftype *dtor)
 {
   return make_my_cleanup2 (&cleanup_chain,
 			   function, arg, dtor);