fix compile warnings in libOSC

This commit is contained in:
niels
2015-07-25 17:34:03 +02:00
parent 6cf5b5809c
commit cc643c67dd
6 changed files with 15 additions and 59 deletions

View File

@@ -2,6 +2,6 @@
struct NetworkReturnAddressStruct { struct NetworkReturnAddressStruct {
struct sockaddr_in cl_addr; struct sockaddr_in cl_addr;
int clilen; unsigned int clilen;
int sockfd; int sockfd;
}; };

View File

@@ -51,6 +51,7 @@ The OpenSound Control WWW page is
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <stdint.h> #include <stdint.h>
#include <sys/types.h> #include <sys/types.h>

View File

@@ -40,18 +40,8 @@ The OpenSound Control WWW page is
#include <libOSC/OSC-timetag.h> #include <libOSC/OSC-timetag.h>
#include <libOSC/OSC-priority-queue.h> #include <libOSC/OSC-priority-queue.h>
#include <stdint.h> #include <stdint.h>
#include <sys/time.h>
#define PRINT_PRIORITY_QUEUE
#ifdef DEBUG_OSC_PRIORITY_QUEUE
#define PRINT_PRIORITY_QUEUE
#endif
#if defined(PRINT_PRIORITY_QUEUE) || defined(DEBUG_OSC_PRIORITY_QUEUE)
#include <stdio.h> #include <stdio.h>
void OSCQueuePrint(OSCQueue q); #include <sys/time.h>
#endif
#define CAPACITY 1000 #define CAPACITY 1000
@@ -73,9 +63,6 @@ OSCQueue OSCNewQueue(int maxItems, void *(*InitTimeMalloc)(int numBytes)) {
result->n = 0; result->n = 0;
#ifdef DEBUG_OSC_PRIORITY_QUEUE
OSCQueuePrint(result);
#endif
return result; return result;
} }
@@ -84,10 +71,6 @@ int OSCQueueInsert(OSCQueue q, OSCSchedulableObject new) {
q->list[q->n] = new; q->list[q->n] = new;
++(q->n); ++(q->n);
#ifdef DEBUG_OSC_PRIORITY_QUEUE
printf("OSCQueueInsert: just inserted %p\n", new);
OSCQueuePrint(q);
#endif
return TRUE; return TRUE;
} }
@@ -102,10 +85,6 @@ OSCTimeTag OSCQueueEarliestTimeTag(OSCQueue q) {
} }
} }
#ifdef DEBUG_OSC_PRIORITY_QUEUE
printf("OSCQueueEarliestTimeTag: about to return %llx\n", smallest);
OSCQueuePrint(q);
#endif
return smallest; return smallest;
} }
@@ -128,11 +107,6 @@ OSCSchedulableObject OSCQueueRemoveEarliest(OSCQueue q) {
return NULL; return NULL;
} }
#ifdef DEBUG_OSC_PRIORITY_QUEUE
printf("OSCQueueRemoveEarliest: begin\n");
OSCQueuePrint(q);
#endif
smallestIndex = 0; smallestIndex = 0;
for (i = 1; i < q->n; ++i) { for (i = 1; i < q->n; ++i) {
if (OSCTT_Compare(q->list[smallestIndex]->timetag, q->list[i]->timetag) > 0) { if (OSCTT_Compare(q->list[smallestIndex]->timetag, q->list[i]->timetag) > 0) {
@@ -144,28 +118,9 @@ OSCSchedulableObject OSCQueueRemoveEarliest(OSCQueue q) {
RemoveElement(smallestIndex, q); RemoveElement(smallestIndex, q);
#ifdef DEBUG_OSC_PRIORITY_QUEUE
printf("OSCQueueRemoveEarliest: done\n");
OSCQueuePrint(q);
#endif
return result; return result;
} }
#ifdef PRINT_PRIORITY_QUEUE
void OSCQueuePrint(OSCQueue q) {
int i;
printf("OSC Priority queue at %p has %d elements:\n", q, q->n);
for (i = 0; i < q->n; ++i) {
printf(" list[%2d] is %p, timetag = %llx\n", i, q->list[i], q->list[i]->timetag);
}
printf("\n\n");
}
#endif
void OSCQueueScanStart(OSCQueue q) { void OSCQueueScanStart(OSCQueue q) {
q->scanIndex = 0; q->scanIndex = 0;
} }

View File

@@ -35,15 +35,15 @@ The OpenSound Control WWW page is
Adapted from OSC-addressability.c (and seriously cleaned up!) Adapted from OSC-addressability.c (and seriously cleaned up!)
*/ */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <stdint.h> #include <stdint.h>
#include <sys/time.h> #include <sys/time.h>
#include <libOSC/OSC-common.h> #include <libOSC/OSC-common.h>
@@ -821,7 +821,7 @@ Boolean OSCScheduleInternalMessages(OSCTimeTag when, int numMessages,
} }
Boolean NetworkPacketWaiting(OSCPacketBuffer packet) { Boolean NetworkPacketWaiting(OSCPacketBuffer packet) {
int n;
NetworkReturnAddressPtr na = OSCPacketBufferGetClientAddr(packet); NetworkReturnAddressPtr na = OSCPacketBufferGetClientAddr(packet);
// if( use_mcast_ ) // if( use_mcast_ )

View File

@@ -87,7 +87,7 @@ int OSCPaddedStrlen(const char *s) {
} }
char *OSCPaddedStrcpy(char *target, const char *source) { char *OSCPaddedStrcpy(char *target, const char *source) {
while ( (*target++) = (*source++)) { while ( *target++ = *source++ ) {
/* do nothing */ /* do nothing */
} }

View File

@@ -17,7 +17,7 @@ typedef int int4; /* 4 byte int */
typedef struct NetworkReturnAddressStruct_t { typedef struct NetworkReturnAddressStruct_t {
struct sockaddr_in cl_addr; /* client information */ struct sockaddr_in cl_addr; /* client information */
struct sockaddr_in my_addr; /* us */ struct sockaddr_in my_addr; /* us */
int clilen; unsigned int clilen;
int sockfd; int sockfd;
fd_set readfds; fd_set readfds;
struct timeval tv; struct timeval tv;