linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: steved@redhat.com
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 03/10] mountd: Eliminate unnecessary type conversions
Date: Mon, 22 Oct 2012 12:06:04 -0400	[thread overview]
Message-ID: <20121022160604.4552.21104.stgit@lebasque.1015granger.net> (raw)
In-Reply-To: <20121022160140.4552.34477.stgit@lebasque.1015granger.net>

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@oracle.com>
---

 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


  parent reply	other threads:[~2012-10-22 16:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-22 16:05 [PATCH 00/10] nfs-utils compiler warning clean ups Chuck Lever
2012-10-22 16:05 ` [PATCH 01/10] nfs-utils: Eliminate dereferencing type punned pointers Chuck Lever
2012-10-22 16:05 ` [PATCH 02/10] mountd: Avoid unnecessary type conversions Chuck Lever
2012-10-22 16:06 ` Chuck Lever [this message]
2012-10-22 16:06 ` [PATCH 04/10] mountd: Make local functions static Chuck Lever
2012-10-22 16:06 ` [PATCH 05/10] mountd: Avoid unnecessary type conversions Chuck Lever
2012-10-22 16:06 ` [PATCH 06/10] " Chuck Lever
2012-10-22 16:06 ` [PATCH 07/10] " Chuck Lever
2012-10-22 16:06 ` [PATCH 08/10] rpc.gssd: Squelch compiler warning Chuck Lever
2012-10-22 16:07 ` [PATCH 09/10] " Chuck Lever
2012-10-22 16:07 ` [PATCH 10/10] rpc.gssd: Squelch compiler error Chuck Lever
2012-10-22 17:27 ` [PATCH 00/10] nfs-utils compiler warning clean ups Steve Dickson
2012-10-22 17:31   ` Chuck Lever
2012-10-30 19:36 ` Steve Dickson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121022160604.4552.21104.stgit@lebasque.1015granger.net \
    --to=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=steved@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).