@@ -52,7 +52,7 @@ const char *fossil_nstream_last_error(void) {
52
52
return fossil_last_error ;
53
53
}
54
54
55
- static int fossil_socket_init () {
55
+ static int fossil_socket_init (void ) {
56
56
#ifdef _WIN32
57
57
WSADATA wsa ;
58
58
return WSAStartup (MAKEWORD (2 ,2 ), & wsa );
@@ -61,7 +61,7 @@ static int fossil_socket_init() {
61
61
#endif
62
62
}
63
63
64
- static void fossil_socket_cleanup () {
64
+ static void fossil_socket_cleanup (void ) {
65
65
#ifdef _WIN32
66
66
WSACleanup ();
67
67
#endif
@@ -246,7 +246,7 @@ int fossil_nstream_listen(fossil_nstream_t *stream, const char *host, int port)
246
246
}
247
247
248
248
stream -> socket_fd = fossil_create_socket (stream -> protocol );
249
- if (stream -> socket_fd < 0 ) {
249
+ if (stream -> socket_fd == ( socket_t ) - 1 ) {
250
250
return -1 ;
251
251
}
252
252
@@ -332,7 +332,7 @@ ssize_t fossil_nstream_send(fossil_nstream_t *stream, const void *buffer, size_t
332
332
}
333
333
334
334
ssize_t fossil_nstream_recv (fossil_nstream_t * stream , void * buffer , size_t size ) {
335
- if (!stream || stream -> socket_fd < 0 ) {
335
+ if (!stream || stream -> socket_fd == ( socket_t ) - 1 ) {
336
336
fossil_set_last_error ("Invalid stream or socket" );
337
337
return -1 ;
338
338
}
@@ -348,7 +348,7 @@ ssize_t fossil_nstream_recv(fossil_nstream_t *stream, void *buffer, size_t size)
348
348
}
349
349
350
350
void fossil_nstream_close (fossil_nstream_t * stream ) {
351
- if (!stream || ( socket_t )( stream -> socket_fd ) < 0 ) return ;
351
+ if (!stream || stream -> socket_fd == ( socket_t ) - 1 ) return ;
352
352
#ifdef _WIN32
353
353
closesocket (stream -> socket_fd );
354
354
#else
0 commit comments