From f44ec6e458a2dc88e6508c8daad19a8f1fd5fc15 Mon Sep 17 00:00:00 2001 From: cilibrar Date: Sat, 21 Aug 2004 12:04:59 +0000 Subject: [PATCH] Fixed warnings. --- src/Makefile.am | 2 +- src/opencnvdriver.c | 14 +++++++------- src/openedf.c | 2 +- src/openedf.h | 3 +++ src/writebdf.c | 8 ++++---- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index c4bcda2..25c2ff8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -6,7 +6,7 @@ AM_CPPFLAGS= -I. bin_PROGRAMS = nsd modeegdriver readedf writeedf opencnvdriver writebdf nsd_SOURCES = nsd.c nsutil.c nsnet.c monitor.c monitor.h cmdhandler.c \ -openedf.c config.h cmdhandler.h edfmacros.h nsd.h nsnet.h nsutil.h openedf.h pctimer.h +openedf.c config.h cmdhandler.h edfmacros.h nsd.h nsnet.h nsutil.h openedf.h pctimer.h stringtable.c stringtable.h modeegdriver_SOURCES = modeegdriver.c nsser.c nsutil.c openedf.c \ nsnet.c monitor.c monitor.h \ diff --git a/src/opencnvdriver.c b/src/opencnvdriver.c index 7d83159..a259bd1 100755 --- a/src/opencnvdriver.c +++ b/src/opencnvdriver.c @@ -132,7 +132,7 @@ static struct EDFDecodedConfig current; */ int isValidPacket(unsigned short chan, long *samples) { - int i; +// int i; // if (chan != 2 && chan != 4 && chan !=5 && chan != 6) return 0; // for (i = 0; i < chan; i++) { // if (samples[i] > 16777216) return 0; @@ -151,7 +151,7 @@ void eatCharacter(unsigned char c) /// place to store eeg data long vals[MAXCHANNELS]; int didMatch = 0; - int ns=3; + //int ns=3; /// has the protocol been detected and validated ? if (hasMatchedProtocol) { didMatch = doesMatchOpenCNV(c, vals); @@ -211,7 +211,7 @@ void handleSamples(int packetCounter, int chan, long *vals) { char buf[MAXLEN]; ///< network socket buffer int bufPos = 0; - long ChannelValue; + //long ChannelValue; int i; #ifdef DEBUGGING printf("Got good packet with counter %d, %d chan\n", packetCounter, chan); @@ -354,9 +354,9 @@ int main(int argc, char **argv) char linebuf[MAXLEN+1]; // fifo command buffer int writepos = 0; - int readpos = 0; + //int readpos = 0; int len; - unsigned int lpos = 0; + //unsigned int lpos = 0; rprintf("OpenCNV Driver v. %s-%s\n", VERSION, OSTYPESTR); @@ -400,8 +400,8 @@ int main(int argc, char **argv) /// current=openCNVCfg; setEDFHeaderBytes(¤t); - strcpy(current.hdr.recordingStartDate, getDMY()); - strcpy(current.hdr.recordingStartTime, getHMS()); + strcpy(current.hdr.recordingStartDate, getDMY()); + strcpy(current.hdr.recordingStartTime, getHMS()); // assert(isValidREDF(result)); // makeREDFConfig(¤t, &openCNVCfg); // write configuration into string diff --git a/src/openedf.c b/src/openedf.c index 81f43b0..cc7c893 100644 --- a/src/openedf.c +++ b/src/openedf.c @@ -366,7 +366,7 @@ const char *getHMS(void) int makeREDFConfig(struct EDFDecodedConfig *result, const struct EDFDecodedConfig *source) { - int newSamples, i; + //int newSamples, i; *result = *source; /* if (source->hdr.dataRecordSeconds != 1.0) { diff --git a/src/openedf.h b/src/openedf.h index 2ac2f92..a9fb033 100644 --- a/src/openedf.h +++ b/src/openedf.h @@ -128,5 +128,8 @@ int makeREDFConfig(struct EDFDecodedConfig *result, const struct EDFDecodedConfi /* Returns a text description of the last error */ const char *getLastError(void); +const char *getDMY(void); +const char *getHMS(void); + #endif diff --git a/src/writebdf.c b/src/writebdf.c index 59fa1d2..476b96f 100755 --- a/src/writebdf.c +++ b/src/writebdf.c @@ -158,8 +158,8 @@ void writeBufferToFile() void handleSamples(int packetCounter, int channels) { static int lastPacketCounter = 0; - int i,j; - unsigned char c1,c2,c3; + int i; + unsigned char c1,c2,c3=0; if (lastPacketCounter + 1 != packetCounter && packetCounter != 0 && lastPacketCounter != 0) { rprintf("May have missed packet: got packetCounters %d and %d\n", lastPacketCounter, packetCounter); } @@ -224,7 +224,7 @@ int main(int argc, char **argv) fd_set toread; int linePos = 0; int i; - double tStart,tEnde; + double tStart; sock_t sock_fd; int retval; @@ -338,7 +338,7 @@ int main(int argc, char **argv) while ( (tStart+opts.seconds) > pctimer() ) { char *cur; int curParam = 0; - int devNum, packetCounter=0, channels=0; + int packetCounter=0, channels=0; rselect(sock_fd+1, &toread, NULL, NULL); linePos = readline(sock_fd, lineBuf, sizeof(EDFPacket), &ib); if (isEOF(sock_fd, &ib)) {