diff --git a/realtime/src/buffer/src/platform_includes.h b/realtime/src/buffer/src/platform_includes.h index 6f145da..2c523e4 100644 --- a/realtime/src/buffer/src/platform_includes.h +++ b/realtime/src/buffer/src/platform_includes.h @@ -8,6 +8,7 @@ /* these platforms will always use a similar gcc compiler */ #if defined (PLATFORM_LINUX) || defined (PLATFORM_OSX) #include + #include #include #include #include diff --git a/realtime/src/buffer/src/rdaserver.c b/realtime/src/buffer/src/rdaserver.c index 73103c2..d0b92d3 100644 --- a/realtime/src/buffer/src/rdaserver.c +++ b/realtime/src/buffer/src/rdaserver.c @@ -720,7 +720,7 @@ void *_rdaserver_thread(void *arg) { /* Check if we have a new client connection */ if (sel>0 && FD_ISSET(SC->server_socket, &readSet)) { struct sockaddr_in sa; - int size_sa = sizeof(sa); + socklen_t size_sa = sizeof(sa); SOCKET newSock; newSock = accept(SC->server_socket, (struct sockaddr *)&sa, &size_sa); diff --git a/realtime/src/buffer/src/tcprequest.c b/realtime/src/buffer/src/tcprequest.c index 5dbb6db..f0c0864 100644 --- a/realtime/src/buffer/src/tcprequest.c +++ b/realtime/src/buffer/src/tcprequest.c @@ -60,7 +60,7 @@ int tcprequest(int server, const message_t *request, message_t **response_ptr) { /* send the request to the server, first the message definition */ /* FIXME: bufwrite expects unsigned int, gets size_t. Similar for return. */ if ((n = bufwrite(server, request->def, sizeof(messagedef_t)))!=sizeof(messagedef_t)) { - fprintf(stderr, "write size = %d, should be %d\n", n, sizeof(messagedef_t)); + fprintf(stderr, "write size = %d, should be %ld\n", n, sizeof(messagedef_t)); /* FIXME: n is unsigned, %d indicates signed ints. */ goto cleanup; } @@ -74,7 +74,7 @@ int tcprequest(int server, const message_t *request, message_t **response_ptr) { /* read the response from the server, first the message definition */ if ((n = bufread(server, response->def, sizeof(messagedef_t))) != sizeof(messagedef_t)) { - fprintf(stderr, "packet size = %d, should be %d\n", n, sizeof(messagedef_t)); + fprintf(stderr, "packet size = %d, should be %ld\n", n, sizeof(messagedef_t)); goto cleanup; } diff --git a/realtime/src/buffer/src/tcpserver.c b/realtime/src/buffer/src/tcpserver.c index 712f925..0fe96ad 100644 --- a/realtime/src/buffer/src/tcpserver.c +++ b/realtime/src/buffer/src/tcpserver.c @@ -50,10 +50,9 @@ void *tcpserver(void *arg) { /* these variables are for the socket */ struct sockaddr_in sa; int s, c; - int b; + socklen_t b; int optval; /* struct timeval timeout; */ - int oldcancelstate, oldcanceltype; #ifdef WIN32 unsigned long enable = 0; @@ -243,7 +242,7 @@ void *tcpserver(void *arg) { /* deal with the incoming connection on the TCP socket in a seperate thread */ /* rc = pthread_create(&tid, &attr, tcpsocket, (void *)c); */ - rc = pthread_create(&tid, NULL, tcpsocket, (void *)c); + rc = pthread_create(&tid, NULL, tcpsocket, (void *) &c); if (rc) { if (verbose>0) fprintf(stderr, "tcpserver: return code from pthread_create() is %d\n", rc); @@ -261,7 +260,7 @@ void *tcpserver(void *arg) { } cleanup: - printf(""); + puts(""); pthread_cleanup_pop(1); return NULL; } diff --git a/realtime/src/buffer/src/tcpsocket.c b/realtime/src/buffer/src/tcpsocket.c index 7b79991..bc43677 100644 --- a/realtime/src/buffer/src/tcpsocket.c +++ b/realtime/src/buffer/src/tcpsocket.c @@ -52,7 +52,6 @@ void cleanup_tcpsocket(void *arg) { void *tcpsocket(void *arg) { int n; int status = 0, verbose = 0; - int oldcancelstate, oldcanceltype; #ifdef ENABLE_POLLING struct pollfd fds; @@ -67,7 +66,7 @@ void *tcpsocket(void *arg) { threadlocal.fd = -1; /* the connection to the client has been made by the server */ - client = (int)arg; + client = *((int *)arg); /* this will be closed at cleanup */ threadlocal.fd = client; @@ -120,7 +119,7 @@ void *tcpsocket(void *arg) { #endif if ((n = bufread(client, request->def, sizeof(messagedef_t))) != sizeof(messagedef_t)) { - if (verbose>0) fprintf(stderr, "tcpsocket: packet size = %d, should be %d\n", n, sizeof(messagedef_t)); + if (verbose>0) fprintf(stderr, "tcpsocket: packet size = %d, should be %ld\n", n, sizeof(messagedef_t)); goto cleanup; } @@ -165,7 +164,7 @@ void *tcpsocket(void *arg) { if (swap) ft_swap_from_native(reqCommand, response); /* we don't need the request anymore */ - cleanup_message(&request); + cleanup_message((void **)&request); request = NULL; /* merge response->def and response->buf if they are small, so we can send it in one go over TCP */ @@ -186,7 +185,7 @@ void *tcpsocket(void *arg) { FREE(merged); } else { if ((n = bufwrite(client, response->def, sizeof(messagedef_t)))!=sizeof(messagedef_t)) { - if (verbose>0) fprintf(stderr, "tcpsocket: write size = %d, should be %d\n", n, sizeof(messagedef_t)); + if (verbose>0) fprintf(stderr, "tcpsocket: write size = %d, should be %ld\n", n, sizeof(messagedef_t)); goto cleanup; } if ((n = bufwrite(client, response->buf, respBufSize))!=respBufSize) { @@ -195,16 +194,16 @@ void *tcpsocket(void *arg) { } } - cleanup_message(&response); + cleanup_message((void **)&response); response = NULL; } /* while (1) */ cleanup: - printf(""); /* otherwise the pthread_cleanup_pop won't compile */ + puts(""); /* otherwise the pthread_cleanup_pop won't compile */ if (response!=NULL) - cleanup_message(&response); + cleanup_message((void **)&response); response = NULL; /* SK: prevent double free in following pthread_cleanup_pop */ pthread_cleanup_pop(1); diff --git a/realtime/src/buffer/src/util.c b/realtime/src/buffer/src/util.c index 812343e..29cc0a1 100644 --- a/realtime/src/buffer/src/util.c +++ b/realtime/src/buffer/src/util.c @@ -369,7 +369,7 @@ int open_unix_connection(const char *name) { * */ -//#define EPOCHFILETIME (116444736000000000i64) +/*#define EPOCHFILETIME (116444736000000000i64)*/ #define EPOCHFILETIME ((INT64_T) 116444736000000000LL) #ifdef COMPILER_LCC