summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--metaentry.c14
-rw-r--r--metaentry.h2
-rw-r--r--metastore.c2
-rw-r--r--utils.c4
4 files changed, 12 insertions, 10 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;
diff --git a/metaentry.h b/metaentry.h
index 09a58a9..82ac6f4 100644
--- a/metaentry.h
+++ b/metaentry.h
@@ -68,7 +68,7 @@ void mentries_fromfile(struct metahash **mhash, const char *path);
/* Searches haystack for an xattr matching xattr number n in needle */
int mentry_find_xattr(struct metaentry *haystack,
struct metaentry *needle,
- int n);
+ unsigned n);
#define DIFF_NONE 0x00
#define DIFF_OWNER 0x01
diff --git a/metastore.c b/metastore.c
index de1bf07..323525a 100644
--- a/metastore.c
+++ b/metastore.c
@@ -112,7 +112,7 @@ compare_fix(struct metaentry *real, struct metaentry *stored, int cmp)
gid_t gid = -1;
uid_t uid = -1;
struct utimbuf tbuf;
- int i;
+ unsigned i;
if (!real && !stored) {
msg(MSG_ERROR, "%s called with incorrect arguments\n",
diff --git a/utils.c b/utils.c
index a96e56e..0369612 100644
--- a/utils.c
+++ b/utils.c
@@ -121,7 +121,7 @@ void
write_int(uint64_t value, size_t len, FILE *to)
{
char buf[len];
- int i;
+ size_t i;
for (i = 0; i < len; i++)
buf[i] = ((value >> (8 * i)) & 0xff);
@@ -147,7 +147,7 @@ uint64_t
read_int(char **from, size_t len, const char *max)
{
uint64_t result = 0;
- int i;
+ size_t i;
if (*from + len > max) {
msg(MSG_CRITICAL,