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/graph.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/libalpm/graph.h') diff --git a/lib/libalpm/graph.h b/lib/libalpm/graph.h index 3078e25f..72a7136f 100644 --- a/lib/libalpm/graph.h +++ b/lib/libalpm/graph.h @@ -17,6 +17,8 @@ * along with this program. If not, see . */ +#include /* off_t */ + #include "alpm_list.h" #include "util.h" /* MALLOC() */ #include "alpm.h" @@ -24,7 +26,7 @@ struct __pmgraph_t { char state; /* 0: untouched, -1: entered, other: leaving time */ void *data; - unsigned long int weight; /* weight of the node */ + off_t weight; /* weight of the node */ struct __pmgraph_t *parent; /* where did we come from? */ alpm_list_t *children; alpm_list_t *childptr; /* points to a child in children list */ -- cgit v1.2.3-24-g4f1b