Re: Subtle C differences - help to interpret please

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 20 Nov 2004 10:18:59 +0000, Alan Chandler
<alan@xxxxxxxxxxxxxxxxxxxxx> wrote:
> I am "code reading" the ide-cd module to try and understand how its working
> and to debug the issues I have with my cd-writer not working
> 
> I have a situation in which two routines are declared in a similar manner - I
> am not including the exact code or the right names, but an example is thus:
> 
> cdrom_start_packet_command ( ......., ide_handler_t *handler)
> {
> ...
> }
> 
> but the calling sequences of these routine is different
> 
> one call is
> 
> cdrom_start_packet_command( ...., &cdrom_seek_intr);
> 
> where cdrom_seek_intr is declared as a function
> 
> static ide_startstop_t cdrom_seek_intr(...)
> {
> }
> 
> and the other is
> 
> cdrom_start_packet_command(....., cdrom_continuation);
> 
> where cdrom_continution is defined in a similar manner, this
> 
> static ide_startstop_t cdrom_continuation(....)
> {
> }
> 
> What difference does the subtle '&' make (or the lack of it).
> 
> --
> Alan Chandler
> alan@xxxxxxxxxxxxxxxxxxxxx
> First they ignore you, then they laugh at you,
> then they fight you, then you win. --Gandhi

Because it is a function pointer.

http://www.function-pointer.org/

-- 
Manish Regmi

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux