diff options
-rw-r--r-- | lib/ChangeLog | 5 | ||||
-rw-r--r-- | lib/stream.c | 18 | ||||
-rw-r--r-- | lib/stream.h | 26 |
3 files changed, 27 insertions, 22 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog index 81865fb3..2459f927 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,8 @@ +2005-02-12 Paul Jakma <paul.jakma@sun.com> + + * stream.h: Unsigned long updated to size_t + * stream.c: ditto + 2005-02-09 Paul Jakma <paul.jakma@sun.com> * stream.h: Remove putp. Update reference to putp with endp. diff --git a/lib/stream.c b/lib/stream.c index 7a8bc458..ebeea333 100644 --- a/lib/stream.c +++ b/lib/stream.c @@ -66,19 +66,19 @@ stream_free (struct stream *s) XFREE (MTYPE_STREAM, s); } -unsigned long +size_t stream_get_getp (struct stream *s) { return s->getp; } -unsigned long +size_t stream_get_endp (struct stream *s) { return s->endp; } -unsigned long +size_t stream_get_size (struct stream *s) { return s->size; @@ -86,7 +86,7 @@ stream_get_size (struct stream *s) /* Stream structre' stream pointer related functions. */ void -stream_set_getp (struct stream *s, unsigned long pos) +stream_set_getp (struct stream *s, size_t pos) { s->getp = pos; } @@ -125,7 +125,7 @@ stream_getc (struct stream *s) /* Get next character from the stream. */ u_char -stream_getc_from (struct stream *s, unsigned long from) +stream_getc_from (struct stream *s, size_t from) { u_char c; @@ -146,7 +146,7 @@ stream_getw (struct stream *s) /* Get next word from the stream. */ u_int16_t -stream_getw_from (struct stream *s, unsigned long from) +stream_getw_from (struct stream *s, size_t from) { u_int16_t w; @@ -234,14 +234,14 @@ stream_putl (struct stream *s, u_int32_t l) } int -stream_putc_at (struct stream *s, unsigned long putp, u_char c) +stream_putc_at (struct stream *s, size_t putp, u_char c) { s->data[putp] = c; return 1; } int -stream_putw_at (struct stream *s, unsigned long putp, u_int16_t w) +stream_putw_at (struct stream *s, size_t putp, u_int16_t w) { s->data[putp] = (u_char)(w >> 8); s->data[putp + 1] = (u_char) w; @@ -249,7 +249,7 @@ stream_putw_at (struct stream *s, unsigned long putp, u_int16_t w) } int -stream_putl_at (struct stream *s, unsigned long putp, u_int32_t l) +stream_putl_at (struct stream *s, size_t putp, u_int32_t l) { s->data[putp] = (u_char)(l >> 24); s->data[putp + 1] = (u_char)(l >> 16); diff --git a/lib/stream.h b/lib/stream.h index c7e4ffbf..2936f46b 100644 --- a/lib/stream.h +++ b/lib/stream.h @@ -33,19 +33,19 @@ struct stream unsigned char *data; /* Get pointer. */ - unsigned long getp; + size_t getp; /* End of pointer. */ - unsigned long endp; + size_t endp; /* Data size. */ - unsigned long size; + size_t size; }; /* First in first out queue structure. */ struct stream_fifo { - unsigned long count; + size_t count; struct stream *head; struct stream *tail; @@ -61,31 +61,31 @@ struct stream_fifo struct stream *stream_new (size_t); void stream_free (struct stream *); -unsigned long stream_get_getp (struct stream *); -unsigned long stream_get_endp (struct stream *); -unsigned long stream_get_size (struct stream *); +size_t stream_get_getp (struct stream *); +size_t stream_get_endp (struct stream *); +size_t stream_get_size (struct stream *); u_char *stream_get_data (struct stream *); -void stream_set_getp (struct stream *, unsigned long); +void stream_set_getp (struct stream *, size_t); void stream_forward_getp (struct stream *, int); void stream_forward_endp (struct stream *, int); void stream_put (struct stream *, void *, size_t); int stream_putc (struct stream *, u_char); -int stream_putc_at (struct stream *, unsigned long, u_char); +int stream_putc_at (struct stream *, size_t, u_char); int stream_putw (struct stream *, u_int16_t); -int stream_putw_at (struct stream *, unsigned long, u_int16_t); +int stream_putw_at (struct stream *, size_t, u_int16_t); int stream_putl (struct stream *, u_int32_t); -int stream_putl_at (struct stream *, unsigned long, u_int32_t); +int stream_putl_at (struct stream *, size_t, u_int32_t); int stream_put_ipv4 (struct stream *, u_int32_t); int stream_put_in_addr (struct stream *, struct in_addr *); int stream_put_prefix (struct stream *, struct prefix *); void stream_get (void *, struct stream *, size_t); u_char stream_getc (struct stream *); -u_char stream_getc_from (struct stream *, unsigned long); +u_char stream_getc_from (struct stream *, size_t); u_int16_t stream_getw (struct stream *); -u_int16_t stream_getw_from (struct stream *, unsigned long); +u_int16_t stream_getw_from (struct stream *, size_t); u_int32_t stream_getl (struct stream *); u_int32_t stream_get_ipv4 (struct stream *); |