[openbox] argument lists in functions

Mikael Magnusson mangosoft at comhem.se
Tue Mar 16 00:12:02 EST 2004

On Mon, 15 Mar 2004, John Russell wrote:

> Can someone who knows some more about the OB code than I do answer this
> question.  What is the point of having argment lists like this:
> void place_client(ObClient *client, gint *x, gint *y)
> where *x and *y are merely pointers to client->area.x and
> client->area.y.  In functions such as this, x and y are modified inside
> the functions to modify the client position or whatever it is the
> function is meant to do.  
> Why not _just_ pass in a pointer to the client?  Why not say
> void place_client(ObClient *client)
> {
> 	and then directly modify the position numbers there.  
> This function is just one example of this and I was curious to know the
> motivation behind this.  Thanks.
> John

dereferencing one pointer is faster than dereferencing two pointers (ie 
client and then x or y)

Mikael Magnusson

More information about the openbox mailing list