diff options
author | Dan McGee <dan@archlinux.org> | 2008-06-01 21:47:31 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2008-06-04 15:38:47 -0500 |
commit | 0669c9bfac7aead01f1400444e691d542f7645c2 (patch) | |
tree | f5dc76963236bd50126d7b4e570969c14e066a03 /lib/libalpm/delta.h | |
parent | 62b4195c7680f9d404e175eb0869182efdd09ef2 (diff) | |
download | pacman-0669c9bfac7aead01f1400444e691d542f7645c2.tar.xz |
Use correct C type for file sizes
We have been using unsigned long as a file size type for a while, which
works but isn't quite correct and could easily break. Worse was probably our
use of int in the download callback functions, which could be restrictive
for packages > 2GB in size.
Switch all file size variables to use off_t, which is the preferred type for
file sizes. Note that at least on Linux, all applications compiled against
libalpm must now be sure to use large file support, where _FILE_OFFSET_BITS
is defined to be 64 or there will be some weird issues that crop up.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/delta.h')
-rw-r--r-- | lib/libalpm/delta.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/libalpm/delta.h b/lib/libalpm/delta.h index 33d47e1e..5bb86b94 100644 --- a/lib/libalpm/delta.h +++ b/lib/libalpm/delta.h @@ -19,6 +19,8 @@ #ifndef _ALPM_DELTA_H #define _ALPM_DELTA_H +#include <sys/types.h> /* off_t */ + #include "alpm.h" struct __pmdelta_t { @@ -35,14 +37,14 @@ struct __pmdelta_t { /** md5sum of the delta file */ char *delta_md5; /** filesize of the delta file */ - unsigned long delta_size; + off_t delta_size; /** download filesize of the delta file */ - unsigned long download_size; + off_t download_size; }; pmdelta_t *_alpm_delta_parse(char *line); void _alpm_delta_free(pmdelta_t *delta); -unsigned long _alpm_shortest_delta_path(alpm_list_t *deltas, +off_t _alpm_shortest_delta_path(alpm_list_t *deltas, const char *to, const char *to_md5, alpm_list_t **path); #endif /* _ALPM_DELTA_H */ |