This is the mail archive of the gdb-patches@sources.redhat.com 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]

Re: RFC: Killing some warnings


On Feb 11,  2:59am, Paul Hilfinger wrote:

> 	* hpux-thread.c (save_inferior_pid): Change call to make_cleanup
> 	to make arguments conform.
> 	(restore_inferior_pid): Change signature to that expected by
> 	make_cleanup.
[...]
> *************** static struct target_ops hpux_thread_ops
> *** 102,114 ****
>   static struct cleanup *
>   save_inferior_pid (void)
>   {
> !   return make_cleanup (restore_inferior_pid, inferior_pid);
>   }
>   
>   static void
> ! restore_inferior_pid (int pid)
>   {
> !   inferior_pid = pid;
>   }
>   
>   static int find_active_thread (void);
> --- 102,114 ----
>   static struct cleanup *
>   save_inferior_pid (void)
>   {
> !   return make_cleanup (restore_inferior_pid, (void*) inferior_pid);
>   }
>   
>   static void
> ! restore_inferior_pid (void* pid)
>   {
> !   inferior_pid = (int) pid;
>   }
>   
>   static int find_active_thread (void);

Personally, I'd prefer to see these changed to avoid the casts to (void *)
and (int).  See the implementation in lin-thread.c (and also elsewhere)
for an example.

(If we ever get around to merging my pid/tid/lwp megapatch, these are
cleaned up everywhere.  I.e, there is one implementation that all files
which need to do this sort of thing use.)

Kevin


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