From: Erez Zadok Date: Fri, 7 Oct 2005 18:55:29 +0000 (+0000) Subject: * fsinfo/fsi_util.c (set_ether_if), amd/map.c (unmount_mp), X-Git-Tag: am-utils-6_2a1~15 X-Git-Url: https://git.fsl.cs.stonybrook.edu/?a=commitdiff_plain;h=7b91d364a1217a31c3b36f8c759abe924dec90cc;p=am-utils-6.0.git * fsinfo/fsi_util.c (set_ether_if), amd/map.c (unmount_mp), libamu/xutil.c (expand_error), libamu/strutil.c (xsnprintf): avoid comparison between signed and unsigned integers. --- diff --git a/ChangeLog b/ChangeLog index 99fa8b6..85caab5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2005-10-07 Erez Zadok + * fsinfo/fsi_util.c (set_ether_if), amd/map.c (unmount_mp), + libamu/xutil.c (expand_error), libamu/strutil.c (xsnprintf): avoid + comparison between signed and unsigned integers. + * conf/autofs/autofs_solaris_v1.h, conf/autofs/autofs_solaris_v1.c (autofs_strdup_space_hack): move "space_hack" function from static inline in header, into the only source file that needs it. This diff --git a/amd/map.c b/amd/map.c index f1993ec..2c15648 100644 --- a/amd/map.c +++ b/amd/map.c @@ -900,7 +900,7 @@ unmount_mp(am_node *mp) time_t last = mp->am_parent->am_attr.ns_u.ns_attr_u.na_mtime.nt_seconds; clocktime(&mp->am_parent->am_attr.ns_u.ns_attr_u.na_mtime); /* defensive programming... can't we assert the above condition? */ - if (last == mp->am_parent->am_attr.ns_u.ns_attr_u.na_mtime.nt_seconds) + if (last == (time_t) mp->am_parent->am_attr.ns_u.ns_attr_u.na_mtime.nt_seconds) mp->am_parent->am_attr.ns_u.ns_attr_u.na_mtime.nt_seconds++; } #endif /* not MNT2_NFS_OPT_SYMTTL */ diff --git a/fsinfo/fsi_util.c b/fsinfo/fsi_util.c index 3167a39..1da927d 100644 --- a/fsinfo/fsi_util.c +++ b/fsinfo/fsi_util.c @@ -451,7 +451,7 @@ set_ether_if(ether_if *ep, int k, char *v) case EF_INADDR:{ ep->e_inaddr.s_addr = inet_addr(v); - if ((int) ep->e_inaddr.s_addr == INADDR_NONE) + if ((int) ep->e_inaddr.s_addr == (int) INADDR_NONE) yyerror("malformed IP dotted quad: %s", v); XFREE(v); } diff --git a/libamu/mount_fs.c b/libamu/mount_fs.c index 26bfea9..e3b6b84 100644 --- a/libamu/mount_fs.c +++ b/libamu/mount_fs.c @@ -301,7 +301,7 @@ again: # ifdef HAVE_MNTENT_T_MNT_TIME_STRING { /* allocate enough space for a long */ size_t l = 13 * sizeof(char); - char *str = (char *) xmalloc(l) + char *str = (char *) xmalloc(l); xsnprintf(str, l, "%ld", time((time_t *) NULL)); mnt->mnt_time = str; } diff --git a/libamu/strutil.c b/libamu/strutil.c index 17ddc7c..b63d869 100644 --- a/libamu/strutil.c +++ b/libamu/strutil.c @@ -254,7 +254,7 @@ xvsnprintf(char *str, size_t size, const char *format, va_list ap) * possible infinite recursion between plog() and xvsnprintf(). If it * ever happens, it'd indicate a bug in Amd. */ - if (ret < 0 || ret >= size) { /* error or truncation occured */ + if (ret < 0 || (size_t) ret >= size) { /* error or truncation occured */ static int maxtrunc; /* hack to avoid inifinite loop */ if (++maxtrunc > 10) #if defined(DEBUG) && (defined(HAVE_C99_VARARGS_MACROS) || defined(HAVE_GCC_VARARGS_MACROS)) diff --git a/libamu/xutil.c b/libamu/xutil.c index 176db0e..1320160 100644 --- a/libamu/xutil.c +++ b/libamu/xutil.c @@ -297,7 +297,7 @@ expand_error(const char *f, char *e, size_t maxlen) int error = errno; int len = 0; - for (p = f, q = e; (*q = *p) && len < maxlen; len++, q++, p++) { + for (p = f, q = e; (*q = *p) && (size_t) len < maxlen; len++, q++, p++) { if (p[0] == '%' && p[1] == 'm') { xstrlcpy(q, strerror(error), maxlen); len += strlen(q) - 1;