diff options
author | Guillem Jover <guillem@debian.org> | 2009-01-20 01:03:55 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2009-01-20 01:03:55 +0200 |
commit | d186c839db61e96d7ad66e6ce04ea02aada8f206 (patch) | |
tree | b90734c929d3bff630c0c499b1492a13ab43c6e1 /lib | |
parent | a5908b7ddb65d84650f0dab407097bdbca6a2cc2 (diff) | |
download | dpkg-d186c839db61e96d7ad66e6ce04ea02aada8f206.tar.gz |
libdpkg: Use size_t in functions taking a size argument
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dpkg-db.h | 6 | ||||
-rw-r--r-- | lib/nfmalloc.c | 4 | ||||
-rw-r--r-- | lib/varbuf.c | 8 |
3 files changed, 12 insertions, 6 deletions
diff --git a/lib/dpkg-db.h b/lib/dpkg-db.h index 9111beee2..c9c74891d 100644 --- a/lib/dpkg-db.h +++ b/lib/dpkg-db.h @@ -379,7 +379,7 @@ struct varbuf; #define VARBUF_INIT { 0, 0, NULL } extern void varbufaddc(struct varbuf *v, int c); -extern void varbufdupc(struct varbuf *v, int c, ssize_t s); +extern void varbufdupc(struct varbuf *v, int c, size_t s); int varbufprintf(struct varbuf *v, const char *fmt, ...) PRINTFFORMAT(2,3); int varbufvprintf(struct varbuf *v, const char *fmt, va_list va); void varbufinit(struct varbuf *v, size_t size); @@ -387,7 +387,7 @@ void varbufreset(struct varbuf *v); void varbufextend(struct varbuf *v); void varbuffree(struct varbuf *v); #define varbufaddstr(v, s) varbufaddbuf(v, s, strlen(s)) -extern void varbufaddbuf(struct varbuf *v, const void *s, const int l); +extern void varbufaddbuf(struct varbuf *v, const void *s, size_t l); /* varbufinit must be called exactly once before the use of each varbuf * (including before any call to varbuffree), or the variable must be @@ -446,7 +446,7 @@ int epochsdiffer(const struct versionrevision *a, /*** from nfmalloc.c ***/ extern void *nfmalloc(size_t); char *nfstrsave(const char*); -char *nfstrnsave(const char*, int); +char *nfstrnsave(const char*, size_t); void nffreeall(void); /*** from showpkg.c ***/ diff --git a/lib/nfmalloc.c b/lib/nfmalloc.c index a6950a856..5449edd90 100644 --- a/lib/nfmalloc.c +++ b/lib/nfmalloc.c @@ -60,7 +60,9 @@ char *nfstrsave(const char *string) { return obstack_copy0 (&db_obs, string, strlen(string)); } -char *nfstrnsave(const char *string, int l) { +char * +nfstrnsave(const char *string, size_t l) +{ OBSTACK_INIT; return obstack_copy0 (&db_obs, string, l); } diff --git a/lib/varbuf.c b/lib/varbuf.c index 71068a817..eecdd4525 100644 --- a/lib/varbuf.c +++ b/lib/varbuf.c @@ -35,7 +35,9 @@ varbufaddc(struct varbuf *v, int c) v->buf[v->used++]= c; } -void varbufdupc(struct varbuf *v, int c, ssize_t n) { +void +varbufdupc(struct varbuf *v, int c, size_t n) +{ size_t old_used = v->used; v->used += n; @@ -74,7 +76,9 @@ int varbufvprintf(struct varbuf *v, const char *fmt, va_list va) { return r; } -void varbufaddbuf(struct varbuf *v, const void *s, const int l) { +void +varbufaddbuf(struct varbuf *v, const void *s, size_t l) +{ int ou; ou= v->used; v->used += l; |