r18267@catbus: nickm | 2008-02-20 16:57:45 -0500

Suppress signed/unsigned comparison warnings in buffers.c


svn:r13624
This commit is contained in:
Nick Mathewson 2008-02-20 21:57:48 +00:00
parent 7521ef9a00
commit 384a8ab777

View File

@ -1021,7 +1021,7 @@ buf_find_pos_of_char(char ch, buf_pos_t *out)
int pos; int pos;
tor_assert(out); tor_assert(out);
if (out->chunk) if (out->chunk)
tor_assert(out->pos < out->chunk->datalen); tor_assert(out->pos < (off_t)out->chunk->datalen);
pos = out->pos; pos = out->pos;
for (chunk = out->chunk; chunk; chunk = chunk->next) { for (chunk = out->chunk; chunk; chunk = chunk->next) {
char *cp = memchr(chunk->data+pos, ch, chunk->datalen-pos); char *cp = memchr(chunk->data+pos, ch, chunk->datalen-pos);
@ -1043,7 +1043,7 @@ static INLINE int
buf_pos_inc(buf_pos_t *pos) buf_pos_inc(buf_pos_t *pos)
{ {
++pos->pos; ++pos->pos;
if (pos->pos == pos->chunk->datalen) { if (pos->pos == (off_t)pos->chunk->datalen) {
if (!pos->chunk->next) if (!pos->chunk->next)
return -1; return -1;
pos->chunk_pos += pos->chunk->datalen; pos->chunk_pos += pos->chunk->datalen;