Fixed a const issue in SelectorBase::GetSocketReady on Mac OS X

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1296 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
LaurentGom 2009-12-02 18:41:22 +00:00
parent 35cfe7a8e4
commit cf9ffb0d27

View File

@ -107,11 +107,14 @@ unsigned int SelectorBase::Wait(float timeout)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SocketHelper::SocketType SelectorBase::GetSocketReady(unsigned int index) const SocketHelper::SocketType SelectorBase::GetSocketReady(unsigned int index) const
{ {
// We have to drop the const for FD_ISSET
fd_set* set = const_cast<fd_set*>(&mySetReady);
// The standard FD_xxx interface doesn't define a direct access, // The standard FD_xxx interface doesn't define a direct access,
// so we must go through the whole set to find the socket we're looking for // so we must iterate through the whole set to find the socket that we're looking for
for (int i = 0; i < myMaxSocket + 1; ++i) for (int i = 0; i < myMaxSocket + 1; ++i)
{ {
if (FD_ISSET(i, &mySetReady)) if (FD_ISSET(i, set))
{ {
// Current socket is ready, but is it the index-th one ? // Current socket is ready, but is it the index-th one ?
if (index > 0) if (index > 0)