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 sockaddr_in cl_addr;
int clilen;
unsigned int clilen;
int sockfd;
};

View File

@@ -51,6 +51,7 @@ The OpenSound Control WWW page is
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdint.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-priority-queue.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>
void OSCQueuePrint(OSCQueue q);
#endif
#include <sys/time.h>
#define CAPACITY 1000
@@ -73,9 +63,6 @@ OSCQueue OSCNewQueue(int maxItems, void *(*InitTimeMalloc)(int numBytes)) {
result->n = 0;
#ifdef DEBUG_OSC_PRIORITY_QUEUE
OSCQueuePrint(result);
#endif
return result;
}
@@ -84,10 +71,6 @@ int OSCQueueInsert(OSCQueue q, OSCSchedulableObject new) {
q->list[q->n] = new;
++(q->n);
#ifdef DEBUG_OSC_PRIORITY_QUEUE
printf("OSCQueueInsert: just inserted %p\n", new);
OSCQueuePrint(q);
#endif
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;
}
@@ -128,11 +107,6 @@ OSCSchedulableObject OSCQueueRemoveEarliest(OSCQueue q) {
return NULL;
}
#ifdef DEBUG_OSC_PRIORITY_QUEUE
printf("OSCQueueRemoveEarliest: begin\n");
OSCQueuePrint(q);
#endif
smallestIndex = 0;
for (i = 1; i < q->n; ++i) {
if (OSCTT_Compare(q->list[smallestIndex]->timetag, q->list[i]->timetag) > 0) {
@@ -144,28 +118,9 @@ OSCSchedulableObject OSCQueueRemoveEarliest(OSCQueue q) {
RemoveElement(smallestIndex, q);
#ifdef DEBUG_OSC_PRIORITY_QUEUE
printf("OSCQueueRemoveEarliest: done\n");
OSCQueuePrint(q);
#endif
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) {
q->scanIndex = 0;
}

View File

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

View File

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

View File

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