[PATCH 07/10] mountd: Avoid unnecessary type conversions

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

 



Clean up compiler warnings:

cache.c: In function ‘get_uuid’:
cache.c:256:17: warning: conversion to ‘char’ from ‘int’ may
  alter its value [-Wconversion]
cache.c:258:17: warning: conversion to ‘char’ from ‘int’ may
  alter its value [-Wconversion]
cache.c:260:16: warning: conversion to ‘char’ from ‘int’ may
  alter its value [-Wconversion]
cache.c:262:6: warning: conversion to ‘char’ from ‘int’ may
  alter its value [-Wconversion]

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 fbaa28e..e950ec6 100644
--- a/utils/mountd/cache.c
+++ b/utils/mountd/cache.c
@@ -248,7 +248,7 @@ static int get_uuid(const char *val, size_t uuidlen, char *u)
 	
 	memset(u, 0, uuidlen);
 	for ( ; *val ; val++) {
-		char c = *val;
+		int c = *val;
 		if (!isxdigit(c))
 			continue;
 		if (isalpha(c)) {
@@ -260,7 +260,7 @@ static int get_uuid(const char *val, size_t uuidlen, char *u)
 			c = c - '0' + 0;
 		if ((i&1) == 0)
 			c <<= 4;
-		u[i/2] ^= c;
+		u[i/2] ^= (char)c;
 		i++;
 		if (i == uuidlen*2)
 			i = 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