POV-Ray : Newsgroups : povray.off-topic : This is great : Re: This is great Server Time
5 Sep 2024 21:27:44 EDT (-0400)
  Re: This is great  
From: clipka
Date: 24 Aug 2009 09:03:01
Message: <4a928f85$1@news.povray.org>
Invisible schrieb:
> The way I read it, they had a structure with two integers and a void 
> pointer. "But we couldn't just add an extra integer field, because we'd 
> have to change a few thousand other functions." I'm not seeing why 
> changing a structure to have a new field which is only used in certain 
> places is a problem.

It wasn't a structure: It was a callback function signature.

That is, there was some module to dispatch events; other modules would 
ask this dispatcher module to call particular functions, as in "if a 
controller button press comes in, please call me back; my address is XYZ".

Of course the dispatcher function would have to know what parameters to 
pass to the function stored at address XYZ. For this purpose, all such 
callback functions would conform to the same set of parameters - in this 
case two integers and a pointer.

Something along these lines.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.