From 62f5da377920c4e7823c4f8b8fb3673c9c2739e9 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 7 Jan 2011 21:06:06 -0600 Subject: Fix some more simple conversion "errors" None of these warn at the normal "-Wall -Werror" level, but casts do occur that we are fine with. Make them explicit to silence some warnings when using "-Wconversion". Signed-off-by: Dan McGee --- lib/libalpm/deps.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/libalpm/deps.c') diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index 1bf2e87f..3d4b1df4 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -350,8 +350,9 @@ int _alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep) /* This is a bit tricker than the old code for performance reasons. To * prevent the need to copy and duplicate strings, strncmp only the name * portion if they are the same length, since there is a version and - * operator in play here. */ - size_t namelen = provver - provision; + * operator in play here. Cast is to silence sign conversion warning; + * we know provver >= provision if we are here. */ + size_t namelen = (size_t)(provver - provision); provver += 1; satisfy = (strlen(dep->name) == namelen && strncmp(provision, dep->name, namelen) == 0 -- cgit v1.2.3-24-g4f1b