|
|
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
|
|