[PATCH 03/10] mountd: Eliminate unnecessary type conversions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Clean up compiler warnings:

cache.c:332:16: warning: conversion to ‘int’ from ‘size_t’ may alter
  its value [-Wconversion]
cache.c:339:9: warning: conversion to ‘size_t’ from ‘int’ may change
  the sign of the result [-Wsign-conversion]
cache.c: In function ‘subexport’:
cache.c:354:17: warning: conversion to ‘int’ from ‘size_t’ may alter
  its value [-Wconversion]
cache.c:357:9: warning: conversion to ‘size_t’ from ‘int’ may change
  the sign of the result [-Wsign-conversion]

Seen with gcc version 4.6.3 20120306 (Red Hat 4.6.3-2) (GCC) .

Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx>
---

 utils/mountd/cache.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
index 6de05f1..70e1aa4 100644
--- a/utils/mountd/cache.c
+++ b/utils/mountd/cache.c
@@ -329,7 +329,7 @@ static char *next_mnt(void **v, char *p)
 {
 	FILE *f;
 	struct mntent *me;
-	int l = strlen(p);
+	size_t l = strlen(p);
 	if (*v == NULL) {
 		f = setmntent("/etc/mtab", "r");
 		*v = f;
@@ -351,7 +351,7 @@ static char *next_mnt(void **v, char *p)
 static bool subexport(struct exportent *e1, struct exportent *e2)
 {
 	char *p1 = e1->e_path, *p2 = e2->e_path;
-	int l2 = strlen(p2);
+	size_t l2 = strlen(p2);
 
 	return e2->e_flags & NFSEXP_CROSSMOUNT
 	       && strncmp(p1, p2, l2) == 0

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux