I noticed this a while ago, but thought there must be a reason for it so I never asked, but I have a question about sfTcpListener_accept since I was doing some binding related work when and reminded myself about it.
Anyways, let's take a quick look at this guy.
sfSocketStatus sfTcpListener_accept(sfTcpListener* listener, sfTcpSocket** connected)
{
CSFML_CHECK_RETURN(listener, sfSocketError);
CSFML_CHECK_RETURN(connected, sfSocketError);
*connected = new sfTcpSocket;
return static_cast<sfSocketStatus>(listener->This.accept((*connected)->This));
}
Is there any reason we give this function the address of the pointer instead of just the pointer itself?
And wouldn't this do the exact same thing?
sfSocketStatus sfTcpListener_accept(sfTcpListener* listener, sfTcpSocket* connected)
{
CSFML_CHECK_RETURN(listener, sfSocketError);
CSFML_CHECK_RETURN(connected, sfSocketError);
connected = new sfTcpSocket;
return static_cast<sfSocketStatus>(listener->This.accept(connected->This));
}
I'm just curious about what the difference is.