]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
mount.nfs: Eliminate compiler warnings in utils/mount/version.h
authorChuck Lever <chuck.lever@oracle.com>
Wed, 13 Oct 2010 15:50:57 +0000 (11:50 -0400)
committerSteve Dickson <steved@redhat.com>
Thu, 14 Oct 2010 14:26:59 +0000 (10:26 -0400)
Clean up.

In file included from mount.c:50:
version.h: In function linux_version_code:
version.h:48: warning: conversion to unsigned int from int may
    change the sign of the result
version.h:48: warning: conversion to unsigned int from int may
    change the sign of the result
version.h:48: warning: conversion to unsigned int from int may
    change the sign of the result

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
utils/mount/version.h

index 46552a1775be5682b602a85e30f3d25823d118dd..af61a6f3295996b8d7f160e25fb8e134bbae8751 100644 (file)
@@ -42,9 +42,9 @@ static inline unsigned int linux_version_code(void)
        if (uname(&my_utsname))
                return 0;
 
-       p = atoi(strtok(my_utsname.release, "."));
-       q = atoi(strtok(NULL, "."));
-       r = atoi(strtok(NULL, "."));
+       p = (unsigned int)atoi(strtok(my_utsname.release, "."));
+       q = (unsigned int)atoi(strtok(NULL, "."));
+       r = (unsigned int)atoi(strtok(NULL, "."));
        return MAKE_VERSION(p, q, r);
 }