summaryrefslogtreecommitdiff
path: root/metaentry.c
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2014-11-25 23:49:38 +0100
committerPrzemyslaw Pawelczyk <przemoc@gmail.com>2015-02-07 23:31:43 +0100
commit31146f6d2a6518615f12bed375420a6d284fea61 (patch)
tree957f1f964f78d11d63f6edfddc5ad4393df4d423 /metaentry.c
parent00e0d24cda49e88b4b66ed5bef8213698fd262a1 (diff)
Avoid comparison between signed and unsigned integers.
This removes warnings shown during build with -Wextra flag. Signed-off-by: Przemyslaw Pawelczyk <przemoc@gmail.com>
Diffstat (limited to 'metaentry.c')
-rw-r--r--metaentry.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/metaentry.c b/metaentry.c
index 0263220..1f45fca 100644
--- a/metaentry.c
+++ b/metaentry.c
@@ -41,7 +41,7 @@
static void
mentry_free(struct metaentry *m)
{
- int i;
+ unsigned i;
if (!m)
return;
@@ -377,7 +377,8 @@ mentries_tofile(const struct metahash *mhash, const char *path)
{
FILE *to;
const struct metaentry *mentry;
- int key, i;
+ int key;
+ unsigned i;
to = fopen(path, "w");
if (!to) {
@@ -420,7 +421,7 @@ mentries_fromfile(struct metahash **mhash, const char *path)
char *max;
int fd;
struct stat sbuf;
- int i;
+ unsigned i;
if (!(*mhash))
*mhash = mhash_alloc();
@@ -513,9 +514,10 @@ out:
/* Searches haystack for an xattr matching xattr number n in needle */
int
-mentry_find_xattr(struct metaentry *haystack, struct metaentry *needle, int n)
+mentry_find_xattr(struct metaentry *haystack, struct metaentry *needle,
+ unsigned n)
{
- int i;
+ unsigned i;
for (i = 0; i < haystack->xattrs; i++) {
if (strcmp(haystack->xattr_names[i], needle->xattr_names[n]))
@@ -534,7 +536,7 @@ mentry_find_xattr(struct metaentry *haystack, struct metaentry *needle, int n)
static int
mentry_compare_xattr(struct metaentry *left, struct metaentry *right)
{
- int i;
+ unsigned i;
if (left->xattrs != right->xattrs)
return 1;