summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/alpm_list.h
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2010-12-08 06:13:36 +0100
committerDan McGee <dan@archlinux.org>2011-01-08 04:15:46 +0100
commitf966f3a8344cd96bd675c79a5c470c66920b890c (patch)
treec97116b7cc0ca1dca8bed3f050ab18dc28a05585 /lib/libalpm/alpm_list.h
parent4bc6ed56aa48784c8caf56c3a6fb1a3c972d221c (diff)
downloadpacman-f966f3a8344cd96bd675c79a5c470c66920b890c.tar.gz
pacman-f966f3a8344cd96bd675c79a5c470c66920b890c.tar.xz
Use size_t for alpm_list sizes
There is a lot of swtiching between size_t and int for alpm_list sizes in the codebase. Start converting these to all be size_t by adjusting the return type of alpm_list_count and fixing all additional warnings given by -Wconversion that are generated by this change. Dan: a few more small changes to ensure things compile, adjusting some printf format string characters to accommodate the larger size on x86_64. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/alpm_list.h')
-rw-r--r--lib/libalpm/alpm_list.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libalpm/alpm_list.h b/lib/libalpm/alpm_list.h
index c52742c9..ee85a5dd 100644
--- a/lib/libalpm/alpm_list.h
+++ b/lib/libalpm/alpm_list.h
@@ -56,7 +56,7 @@ alpm_list_t *alpm_list_add(alpm_list_t *list, void *data);
alpm_list_t *alpm_list_add_sorted(alpm_list_t *list, void *data, alpm_list_fn_cmp fn);
alpm_list_t *alpm_list_join(alpm_list_t *first, alpm_list_t *second);
alpm_list_t *alpm_list_mmerge(alpm_list_t *left, alpm_list_t *right, alpm_list_fn_cmp fn);
-alpm_list_t *alpm_list_msort(alpm_list_t *list, int n, alpm_list_fn_cmp fn);
+alpm_list_t *alpm_list_msort(alpm_list_t *list, size_t n, alpm_list_fn_cmp fn);
alpm_list_t *alpm_list_remove(alpm_list_t *haystack, const void *needle, alpm_list_fn_cmp fn, void **data);
alpm_list_t *alpm_list_remove_str(alpm_list_t *haystack, const char *needle, char **data);
alpm_list_t *alpm_list_remove_dupes(const alpm_list_t *list);
@@ -67,13 +67,13 @@ alpm_list_t *alpm_list_reverse(alpm_list_t *list);
/* item accessors */
alpm_list_t *alpm_list_first(const alpm_list_t *list);
-alpm_list_t *alpm_list_nth(const alpm_list_t *list, int n);
+alpm_list_t *alpm_list_nth(const alpm_list_t *list, size_t n);
alpm_list_t *alpm_list_next(const alpm_list_t *list);
alpm_list_t *alpm_list_last(const alpm_list_t *list);
void *alpm_list_getdata(const alpm_list_t *entry);
/* misc */
-int alpm_list_count(const alpm_list_t *list);
+size_t alpm_list_count(const alpm_list_t *list);
void *alpm_list_find(const alpm_list_t *haystack, const void *needle, alpm_list_fn_cmp fn);
void *alpm_list_find_ptr(const alpm_list_t *haystack, const void *needle);
char *alpm_list_find_str(const alpm_list_t *haystack, const char *needle);