diff options
author | fcolin | 2008-05-19 15:51:08 +0000 |
---|---|---|
committer | fcolin | 2008-05-19 15:51:08 +0000 |
commit | bf7759a7bf2530612cfe9cfb66ac700b72ee34b6 (patch) | |
tree | 4550b8b8279148fe2d7d7f39ef1aff3221c21193 /src | |
parent | 09f82d4e1e6dd1672b272c314c42d5cf30c91ea8 (diff) | |
download | ivy-c-bf7759a7bf2530612cfe9cfb66ac700b72ee34b6.zip ivy-c-bf7759a7bf2530612cfe9cfb66ac700b72ee34b6.tar.gz ivy-c-bf7759a7bf2530612cfe9cfb66ac700b72ee34b6.tar.bz2 ivy-c-bf7759a7bf2530612cfe9cfb66ac700b72ee34b6.tar.xz |
correction pb comparaison unsigned/singed
Diffstat (limited to 'src')
-rw-r--r-- | src/intervalRegexp.c | 2 | ||||
-rw-r--r-- | src/ivyfifo.c | 14 | ||||
-rw-r--r-- | src/ivyfifo.h | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/intervalRegexp.c b/src/intervalRegexp.c index cbe4f32..a513178 100644 --- a/src/intervalRegexp.c +++ b/src/intervalRegexp.c @@ -193,7 +193,7 @@ static NextMax nextMax (const char *min, const char *max) char revMin[32], revMax[32]; size_t nbDigitsMin, nbDigitsMax; size_t rankRev=0, rankForw, rank=0; - int i; + size_t i; int currMax; nbDigitsMin = strlen (min); diff --git a/src/ivyfifo.c b/src/ivyfifo.c index e427f1d..c60596b 100644 --- a/src/ivyfifo.c +++ b/src/ivyfifo.c @@ -17,7 +17,7 @@ static void IvyFifoRealloc(IvyFifoBuffer *f, unsigned int neededSize); -static unsigned int IvyFifoGenericRead(IvyFifoBuffer *f, const int buf_size, +static unsigned int IvyFifoGenericRead(IvyFifoBuffer *f, const unsigned int buf_size, void (*func)(void*, void*, int), void* dest); static void IvyFifoDrain(IvyFifoBuffer *f, int size); @@ -77,7 +77,7 @@ unsigned int IvyFifoAvail(const IvyFifoBuffer *f) return (IvyFifoSize (f)- IvyFifoLength (f)); } -unsigned int IvyFifoRead (IvyFifoBuffer *f, char *buf, int buf_size) +unsigned int IvyFifoRead (IvyFifoBuffer *f, char *buf, unsigned int buf_size) { return IvyFifoGenericRead(f, buf_size, NULL, buf); } @@ -104,7 +104,7 @@ void IvyFifoRealloc (IvyFifoBuffer *f, unsigned int new_size) } } -void IvyFifoWrite (IvyFifoBuffer *f, const char *buf, int size) +void IvyFifoWrite (IvyFifoBuffer *f, const char *buf, unsigned int size) { if (size >= IvyFifoAvail (f)) { IvyFifoRealloc(f, size + IvyFifoLength (f)); @@ -113,7 +113,7 @@ void IvyFifoWrite (IvyFifoBuffer *f, const char *buf, int size) return ; } do { - int len = MIN(f->end - f->wptr, size); + unsigned int len = MIN((unsigned int)(f->end - f->wptr), size); memcpy(f->wptr, buf, len); f->wptr += len; if (f->wptr >= f->end) @@ -124,13 +124,13 @@ void IvyFifoWrite (IvyFifoBuffer *f, const char *buf, int size) } -unsigned int IvyFifoGenericRead (IvyFifoBuffer *f, const int buf_size, void (*func)(void*, void*, int), void* dest) +unsigned int IvyFifoGenericRead (IvyFifoBuffer *f, const unsigned int buf_size, void (*func)(void*, void*, int), void* dest) { unsigned int bytesToRead, retV; retV = bytesToRead = MIN(buf_size, IvyFifoLength(f)); do { - int len = MIN(f->end - f->rptr, bytesToRead); + unsigned int len = MIN((unsigned int)(f->end - f->rptr), bytesToRead); if (func) { func (dest, f->rptr, len); } else { @@ -149,7 +149,7 @@ unsigned int IvyFifoSendSocket (IvyFifoBuffer *f, const int fd) unsigned int maxLen, realLen; do { - maxLen = MIN ((f->end - f->rptr), IvyFifoLength(f)); + maxLen = MIN ((unsigned int)(f->end - f->rptr), IvyFifoLength(f)); #ifdef WIN32 realLen = send (fd, f->rptr, maxLen, 0); #else diff --git a/src/ivyfifo.h b/src/ivyfifo.h index 14d0106..148d2b5 100644 --- a/src/ivyfifo.h +++ b/src/ivyfifo.h @@ -22,13 +22,13 @@ unsigned int IvyFifoSize(const IvyFifoBuffer *f); unsigned int IvyFifoAvail(const IvyFifoBuffer *f); -unsigned int IvyFifoRead(IvyFifoBuffer *f, char *buf, int buf_size); +unsigned int IvyFifoRead(IvyFifoBuffer *f, char *buf, unsigned int buf_size); unsigned int IvyFifoSendSocket (IvyFifoBuffer *f, const int fd); int IvyFifoIsFull (const IvyFifoBuffer *f) ; -void IvyFifoWrite(IvyFifoBuffer *f, const char *buf, int size); +void IvyFifoWrite(IvyFifoBuffer *f, const char *buf, unsigned int size); |