Replaced C-style casts found by GCC in HAL, wpilibc, and JNI (#211)

This commit is contained in:
Tyler Veness
2016-08-24 21:39:16 -07:00
committed by Peter Johnson
parent 2ec6132fcb
commit 93b486b6ba
16 changed files with 45 additions and 34 deletions

View File

@@ -175,7 +175,7 @@ void CameraServer::Serve() {
address.sin_addr.s_addr = htonl(INADDR_ANY);
address.sin_port = htons(kPort);
if (bind(sock, (struct sockaddr*)&address, sizeof(address)) == -1)
if (bind(sock, reinterpret_cast<sockaddr*>(&address), sizeof(address)) == -1)
wpi_setErrnoError();
if (listen(sock, 10) == -1) wpi_setErrnoError();
@@ -183,8 +183,8 @@ void CameraServer::Serve() {
while (true) {
socklen_t clientAddressLen = sizeof(clientAddress);
int conn =
accept(sock, (struct sockaddr*)&clientAddress, &clientAddressLen);
int conn = accept(sock, reinterpret_cast<sockaddr*>(&clientAddress),
&clientAddressLen);
if (conn == -1) {
wpi_setErrnoError();
continue;