X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b46b1d59d6f69ad80dcf5955375578a6504d100a..b724bafee0cbbb5c587d11e82a18c8ea5b060f26:/src/common/selectdispatcher.cpp diff --git a/src/common/selectdispatcher.cpp b/src/common/selectdispatcher.cpp index 4cbb7225bb..2a96b33453 100644 --- a/src/common/selectdispatcher.cpp +++ b/src/common/selectdispatcher.cpp @@ -23,10 +23,11 @@ #include "wx/module.h" #include "wx/timer.h" #include "wx/unix/private.h" -#include "wx/log.h" #ifndef WX_PRECOMP #include "wx/hash.h" + #include "wx/log.h" + #include "wx/intl.h" #endif #ifdef HAVE_SYS_SELECT_H @@ -78,7 +79,7 @@ bool wxSelectSets::HasFD(int fd) const { for ( int n = 0; n < Max; n++ ) { - if ( wxFD_ISSET(fd, &m_fds[n]) ) + if ( wxFD_ISSET(fd, (fd_set*) &m_fds[n]) ) return true; } @@ -97,7 +98,7 @@ bool wxSelectSets::SetFD(int fd, int flags) wxLogTrace(wxSelectDispatcher_Trace, _T("Registered fd %d for %s events"), fd, ms_names[n]); } - else if ( wxFD_ISSET(fd, &m_fds[n]) ) + else if ( wxFD_ISSET(fd, (fd_set*) &m_fds[n]) ) { wxFD_CLR(fd, &m_fds[n]); wxLogTrace(wxSelectDispatcher_Trace, @@ -117,7 +118,7 @@ void wxSelectSets::Handle(int fd, wxFDIOHandler& handler) const { for ( int n = 0; n < Max; n++ ) { - if ( wxFD_ISSET(fd, &m_fds[n]) ) + if ( wxFD_ISSET(fd, (fd_set*) &m_fds[n]) ) { wxLogTrace(wxSelectDispatcher_Trace, _T("Got %s event on fd %d"), ms_names[n], fd); @@ -159,7 +160,7 @@ wxSelectDispatcher::wxSelectDispatcher() bool wxSelectDispatcher::RegisterFD(int fd, wxFDIOHandler *handler, int flags) { - if ( !wxFDIODispatcher::RegisterFD(fd, handler, flags) ) + if ( !wxMappedFDIODispatcher::RegisterFD(fd, handler, flags) ) return false; if ( !m_sets.SetFD(fd, flags) ) @@ -173,7 +174,7 @@ bool wxSelectDispatcher::RegisterFD(int fd, wxFDIOHandler *handler, int flags) bool wxSelectDispatcher::ModifyFD(int fd, wxFDIOHandler *handler, int flags) { - if ( !wxFDIODispatcher::ModifyFD(fd, handler, flags) ) + if ( !wxMappedFDIODispatcher::ModifyFD(fd, handler, flags) ) return false; wxASSERT_MSG( fd <= m_maxFD, _T("logic error: registered fd > m_maxFD?") ); @@ -181,10 +182,8 @@ bool wxSelectDispatcher::ModifyFD(int fd, wxFDIOHandler *handler, int flags) return m_sets.SetFD(fd, flags); } -wxFDIOHandler *wxSelectDispatcher::UnregisterFD(int fd, int flags) +bool wxSelectDispatcher::UnregisterFD(int fd, int flags) { - wxFDIOHandler * const handler = wxFDIODispatcher::UnregisterFD(fd, flags); - m_sets.ClearFD(fd, flags); // remove the handler if we don't need it any more @@ -204,7 +203,7 @@ wxFDIOHandler *wxSelectDispatcher::UnregisterFD(int fd, int flags) } } - return handler; + return true; } void wxSelectDispatcher::ProcessSets(const wxSelectSets& sets) @@ -251,7 +250,7 @@ void wxSelectDispatcher::RunLoop(int timeout) // continue if we were interrupted by a signal, else bail out if ( errno != EINTR ) { - wxLogSysError(_("Failed to monitor IO channels")); + wxLogSysError(_("Failed to monitor I/O channels")); return; } break;