From 0669c9bfac7aead01f1400444e691d542f7645c2 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 1 Jun 2008 21:47:31 -0500 Subject: 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 --- lib/libalpm/delta.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/libalpm/delta.h') 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 /* 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 */ -- cgit v1.2.3