The following commit has been merged in the master branch: commit d186c839db61e96d7ad66e6ce04ea02aada8f206 Author: Guillem Jover <guil...@debian.org> Date: Tue Jan 20 01:03:55 2009 +0200
libdpkg: Use size_t in functions taking a size argument diff --git a/ChangeLog b/ChangeLog index ad1ddf5..82859e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-01-20 Guillem Jover <guil...@debian.org> + + * lib/dpkg-db.h (varbufdupc): Use size_t instead of ssize_t. + (varbufaddbuf): Use size_t instead of const int. + (nfstrnsave): Use size_t instead of int. + 2009-01-14 Guillem Jover <guil...@debian.org> * man/start-stop-daemon.8: Document new option --procsched. diff --git a/lib/dpkg-db.h b/lib/dpkg-db.h index 9111bee..c9c7489 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 a6950a8..5449edd 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 71068a8..eecdd45 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; -- dpkg's main repository -- To UNSUBSCRIBE, email to debian-dpkg-cvs-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org