From 749a6ec63a8f257c2b54511f1d7a5467ea4c38d9 Mon Sep 17 00:00:00 2001 From: jdl Date: Sun, 20 Oct 2002 16:01:10 +0000 Subject: reduce warnings pass #1 svn path=/trunk/externals/OSCx/; revision=179 --- OSC/OSC-pattern-match.c | 9 +++++++-- OSC/makefile | 1 + OSC/routeOSC.c | 3 +++ OSC/sendOSC.c | 3 ++- libOSC/Makefile | 5 +++-- libOSC/OSC-client.c | 4 ++++ send+dump/Makefile | 9 +++++---- send+dump/dumpOSC.c | 5 +++-- send+dump/htmsocket.c | 6 +++--- send+dump/sendOSC.c | 6 +++++- 10 files changed, 36 insertions(+), 15 deletions(-) diff --git a/OSC/OSC-pattern-match.c b/OSC/OSC-pattern-match.c index c3000c1..5e8226d 100644 --- a/OSC/OSC-pattern-match.c +++ b/OSC/OSC-pattern-match.c @@ -35,9 +35,14 @@ The OpenSound Control WWW page is Matt Wright, 3/16/98 Adapted from oscpattern.c, by Matt Wright and Amar Chaudhury */ -#ifdef MACOSX -#include +#ifdef UNIX + #include #endif + +// #ifdef MACOSX +// #include +// #endif + #include "OSC-common.h" #include "OSC-pattern-match.h" diff --git a/OSC/makefile b/OSC/makefile index 515e7a8..346be68 100644 --- a/OSC/makefile +++ b/OSC/makefile @@ -4,6 +4,7 @@ NAME=OSC EXT=o LIBS = -lm -lc LIBOSC = ../libOSC/libOSC.a +DEFS= -Dunix # ----------------------- Mac OS X (Darwin) ----------------------- diff --git a/OSC/routeOSC.c b/OSC/routeOSC.c index 1b3a264..4bd1185 100644 --- a/OSC/routeOSC.c +++ b/OSC/routeOSC.c @@ -61,6 +61,9 @@ The OpenSound Control WWW page is #ifdef MACOSX #include #endif +#ifdef UNIX + #include +#endif /* structure definition of your object */ #define MAX_NUM 20 diff --git a/OSC/sendOSC.c b/OSC/sendOSC.c index 7c0e228..4eb8e99 100644 --- a/OSC/sendOSC.c +++ b/OSC/sendOSC.c @@ -83,6 +83,7 @@ compiling: #include #include #include + #include #endif /////////////////////// @@ -707,7 +708,7 @@ typedArg ParseToken(char *token) { int WriteMessage(OSCbuf *buf, char *messageName, int numArgs, typedArg *args) { int j, returnVal; - const wmERROR = -1; + const int wmERROR = -1; returnVal = 0; diff --git a/libOSC/Makefile b/libOSC/Makefile index 6261b37..fb21a26 100644 --- a/libOSC/Makefile +++ b/libOSC/Makefile @@ -1,4 +1,5 @@ -CFLAGS= -O2 +CFLAGS= -O2 -Wall +DEFS= -Dunix LIB=libOSC.a LIBOBJS= ${LIB}(OSC-client.o) ${LIB}(OSC-timetag.o) @@ -6,7 +7,7 @@ LIBOBJS= ${LIB}(OSC-client.o) ${LIB}(OSC-timetag.o) all: ${LIBOBJS} .c.a: - ${CC} -c ${CFLAGS} $< + ${CC} -c ${CFLAGS} ${DEFS} $< ${AR} ${ARFLAGS} $@ $*.o rm -f $*.o diff --git a/libOSC/OSC-client.c b/libOSC/OSC-client.c index 27b07d0..2024d34 100644 --- a/libOSC/OSC-client.c +++ b/libOSC/OSC-client.c @@ -64,6 +64,10 @@ University of California, Berkeley. #include #endif +#ifdef unix + #include + #include +#endif #include "OSC-client.h" diff --git a/send+dump/Makefile b/send+dump/Makefile index 7b14a43..7521258 100644 --- a/send+dump/Makefile +++ b/send+dump/Makefile @@ -1,6 +1,7 @@ LIBOSCDIR = ../libOSC LIBOSC = ${LIBOSCDIR}/libOSC.a -CFLAGS= -O2 -I$(LIBOSCDIR) +CFLAGS= -O2 -I$(LIBOSCDIR) -Wall +DEFS= -Dunix DUMPOBJS=dumpOSC.o @@ -8,13 +9,13 @@ DUMPOBJS=dumpOSC.o both: sendOSC dumpOSC sendOSC: sendOSC.o htmsocket.o ${LIBOSC} - ${CC} -o sendOSC sendOSC.o htmsocket.o ${LIBOSC} + ${CC} ${CFLAGS} ${DEFS} -o sendOSC sendOSC.o htmsocket.o ${LIBOSC} dumpOSC: ${DUMPOBJS} - ${CC} -o $@ ${DUMPOBJS} + ${CC} ${CFLAGS} ${DEFS} -o $@ ${DUMPOBJS} dumpUDP: dumpUDP.o - ${CC} -o dumpUDP dumpUDP.o + ${CC} ${CFLAGS} ${DEFS} -o dumpUDP dumpUDP.o ${LIBOSC}: echo "You need to go to " ${LIBOSCDIR} " and do a make." diff --git a/send+dump/dumpOSC.c b/send+dump/dumpOSC.c index 143a994..083aed0 100644 --- a/send+dump/dumpOSC.c +++ b/send+dump/dumpOSC.c @@ -84,6 +84,7 @@ Technologies, University of California, Berkeley. #include #include #include +#include #ifdef NEED_SCHEDCTL_AND_LOCK #include @@ -172,7 +173,7 @@ static int initudp(int chan) } static void closeudp(int sockfd) { - close(sockfd); + close(sockfd); } static Boolean catchupflag=FALSE; @@ -692,7 +693,7 @@ printf("polldev %d\n", polldevs[j].fd); } } } /* End of while(!caught_sigint) */ - + closeudp(sockfd); out: ; } diff --git a/send+dump/htmsocket.c b/send+dump/htmsocket.c index e4f447f..cb00d4f 100644 --- a/send+dump/htmsocket.c +++ b/send+dump/htmsocket.c @@ -93,8 +93,8 @@ void *OpenHTMSocket(char *host, int portnumber) return 0; if(!host) { - char *mktemp(char *); - int clilen; + // char *mkstemp(char *); + int clilen; o->len = sizeof(ucl_addr); /* * Fill in the structure "userv_addr" with the address of the @@ -124,7 +124,7 @@ void *OpenHTMSocket(char *host, int portnumber) ucl_addr.sun_family = AF_UNIX; strcpy(ucl_addr.sun_path, UNIXDG_TMP); - mktemp(ucl_addr.sun_path); + mkstemp(ucl_addr.sun_path); clilen = sizeof(ucl_addr.sun_family) + strlen(ucl_addr.sun_path); if (bind(sockfd, (struct sockaddr *) &ucl_addr, clilen) < 0) diff --git a/send+dump/sendOSC.c b/send+dump/sendOSC.c index db188dd..d37a539 100644 --- a/send+dump/sendOSC.c +++ b/send+dump/sendOSC.c @@ -55,6 +55,10 @@ compiling: /* #include */ #include +#ifdef unix + #include + #include +#endif typedef struct { enum {INT, FLOAT, STRING} type; @@ -88,7 +92,7 @@ static int exitStatus = 0; static int useTypeTags = 1; -main(int argc, char *argv[]) { +int main(int argc, char *argv[]) { int portnumber; char *hostname = 0; void *htmsocket; -- cgit v1.2.1