diff --git a/third_party/homebrew_formula.rb b/Formula/homebrew_formula.rb similarity index 100% rename from third_party/homebrew_formula.rb rename to Formula/homebrew_formula.rb diff --git a/ixwebsocket/IXSocket.cpp b/ixwebsocket/IXSocket.cpp index 780ce5a4..76b4d234 100644 --- a/ixwebsocket/IXSocket.cpp +++ b/ixwebsocket/IXSocket.cpp @@ -45,7 +45,7 @@ namespace ix { if (_sockfd == -1) { - if (onPollCallback) onPollCallback(PollResultType_Error); + if (onPollCallback) onPollCallback(PollResultType::Error); return; } @@ -82,14 +82,14 @@ namespace ix int ret = ::select(nfds + 1, &rfds, &wfds, nullptr, (timeoutMs < 0) ? nullptr : &timeout); - PollResultType pollResult = PollResultType_ReadyForRead; + PollResultType pollResult = PollResultType::ReadyForRead; if (ret < 0) { - pollResult = PollResultType_Error; + pollResult = PollResultType::Error; } else if (ret == 0) { - pollResult = PollResultType_Timeout; + pollResult = PollResultType::Timeout; } else if (interruptFd != -1 && FD_ISSET(interruptFd, &rfds)) { @@ -97,20 +97,20 @@ namespace ix if (value == kSendRequest) { - pollResult = PollResultType_SendRequest; + pollResult = PollResultType::SendRequest; } else if (value == kCloseRequest) { - pollResult = PollResultType_CloseRequest; + pollResult = PollResultType::CloseRequest; } } else if (sockfd != -1 && readyToRead && FD_ISSET(sockfd, &rfds)) { - pollResult = PollResultType_ReadyForRead; + pollResult = PollResultType::ReadyForRead; } else if (sockfd != -1 && !readyToRead && FD_ISSET(sockfd, &wfds)) { - pollResult = PollResultType_ReadyForWrite; + pollResult = PollResultType::ReadyForWrite; } return pollResult; @@ -257,7 +257,7 @@ namespace ix { // Wait with a 1ms timeout until the socket is ready to read. // This way we are not busy looping - if (isReadyToRead(1) == PollResultType_Error) + if (isReadyToRead(1) == PollResultType::Error) { return false; } @@ -326,7 +326,7 @@ namespace ix // Wait with a 1ms timeout until the socket is ready to read. // This way we are not busy looping - if (isReadyToRead(1) == PollResultType_Error) + if (isReadyToRead(1) == PollResultType::Error) { return std::make_pair(false, std::string()); } diff --git a/ixwebsocket/IXSocket.h b/ixwebsocket/IXSocket.h index 3df86292..4bfae38d 100644 --- a/ixwebsocket/IXSocket.h +++ b/ixwebsocket/IXSocket.h @@ -25,14 +25,14 @@ namespace ix { class SelectInterrupt; - enum PollResultType + enum class PollResultType { - PollResultType_ReadyForRead = 0, - PollResultType_ReadyForWrite = 1, - PollResultType_Timeout = 2, - PollResultType_Error = 3, - PollResultType_SendRequest = 4, - PollResultType_CloseRequest = 5 + ReadyForRead = 0, + ReadyForWrite = 1, + Timeout = 2, + Error = 3, + SendRequest = 4, + CloseRequest = 5 }; class Socket { diff --git a/ixwebsocket/IXWebSocketTransport.cpp b/ixwebsocket/IXWebSocketTransport.cpp index 406b9b80..485ec589 100644 --- a/ixwebsocket/IXWebSocketTransport.cpp +++ b/ixwebsocket/IXWebSocketTransport.cpp @@ -189,7 +189,7 @@ namespace ix // If (1) heartbeat is enabled, and (2) no data was received or // send for a duration exceeding our heart-beat period, send a // ping to the server. - if (pollResult == PollResultType_Timeout && + if (pollResult == PollResultType::Timeout && heartBeatPeriodExceeded()) { std::stringstream ss; @@ -198,7 +198,7 @@ namespace ix } // Make sure we send all the buffered data // there can be a lot of it for large messages. - else if (pollResult == PollResultType_SendRequest) + else if (pollResult == PollResultType::SendRequest) { while (!isSendBufferEmpty() && !_requestInitCancellation) { @@ -206,19 +206,19 @@ namespace ix // This way we are not busy looping PollResultType result = _socket->isReadyToWrite(10); - if (result == PollResultType_Error) + if (result == PollResultType::Error) { _socket->close(); setReadyState(CLOSED); break; } - else if (result == PollResultType_ReadyForWrite) + else if (result == PollResultType::ReadyForWrite) { sendOnSocket(); } } } - else if (pollResult == PollResultType_ReadyForRead) + else if (pollResult == PollResultType::ReadyForRead) { while (true) { @@ -244,11 +244,11 @@ namespace ix } } } - else if (pollResult == PollResultType_Error) + else if (pollResult == PollResultType::Error) { _socket->close(); } - else if (pollResult == PollResultType_CloseRequest) + else if (pollResult == PollResultType::CloseRequest) { _socket->close(); } diff --git a/makefile b/makefile index 710d42dc..b6906259 100644 --- a/makefile +++ b/makefile @@ -39,7 +39,7 @@ test: python test/run.py ws_test: all - (cd ws ; sh test_ws.sh) + (cd ws ; bash test_ws.sh) # For the fork that is configured with appveyor rebase_upstream: