]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
silence compiler
authorMark Andrews <marka@isc.org>
Thu, 16 Sep 2004 07:02:53 +0000 (07:02 +0000)
committerMark Andrews <marka@isc.org>
Thu, 16 Sep 2004 07:02:53 +0000 (07:02 +0000)
lib/bind/inet/inet_makeaddr.c
lib/bind/nameser/ns_print.c
lib/lwres/print.c

index 1d20619b9922f45771f88778ed551bf896368771..6e4ecc37ccabd304194da59694fe8b34ed291001 100644 (file)
@@ -51,16 +51,16 @@ struct in_addr
 inet_makeaddr(net, host)
        u_long net, host;
 {
-       u_long addr;
+       struct in_addr a;
 
        if (net < 128U)
-               addr = (net << IN_CLASSA_NSHIFT) | (host & IN_CLASSA_HOST);
+               a.s_addr = (net << IN_CLASSA_NSHIFT) | (host & IN_CLASSA_HOST);
        else if (net < 65536U)
-               addr = (net << IN_CLASSB_NSHIFT) | (host & IN_CLASSB_HOST);
+               a.s_addr = (net << IN_CLASSB_NSHIFT) | (host & IN_CLASSB_HOST);
        else if (net < 16777216L)
-               addr = (net << IN_CLASSC_NSHIFT) | (host & IN_CLASSC_HOST);
+               a.s_addr = (net << IN_CLASSC_NSHIFT) | (host & IN_CLASSC_HOST);
        else
-               addr = net | host;
-       addr = htonl(addr);
-       return (*(struct in_addr *)&addr);
+               a.s_addr = net | host;
+       a.s_addr = htonl(a.s_addr);
+       return (a);
 }
index 10a40932990fee58a596534e4d24b58a418bbc76..d74e878a5aa0d7653f5ab2e4e949d000954101fe 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: ns_print.c,v 1.8 2004/09/16 00:56:12 marka Exp $";
+static const char rcsid[] = "$Id: ns_print.c,v 1.9 2004/09/16 07:02:52 marka Exp $";
 #endif
 
 /* Import. */
@@ -706,7 +706,7 @@ ns_sprintrrf(const u_char *msg, size_t msglen,
        char *p;
 
        len = SPRINTF((tmp, "\\# %u%s\t; %s", (unsigned)(edata - rdata),
-                      rdlen != 0 ? " (" : "", comment));
+                      rdlen != 0U ? " (" : "", comment));
        T(addstr(tmp, len, &buf, &buflen));
        while (rdata < edata) {
                p = tmp;
index 767a65b21c1a88c629c62d5406193c60e2508134..7f4cea233f8214ae216396dbc4dd604b5e249ce4 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: print.c,v 1.3 2004/09/16 01:01:27 marka Exp $ */
+/* $Id: print.c,v 1.4 2004/09/16 07:02:53 marka Exp $ */
 
 #include <config.h>
 
@@ -201,7 +201,7 @@ lwres__print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
                case 'x':
                case 'X':
                doint:
-                       if (precision != 0)
+                       if (precision != 0U)
                                zero = 0;
                        switch (*format) {
                        case 'n':
@@ -276,7 +276,7 @@ lwres__print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
                                        tmpui = va_arg(ap, unsigned int);
                                if (alt) {
                                        head = "0x";
-                                       if (precision > 2)
+                                       if (precision > 2U)
                                                precision -= 2;
                                }
                                sprintf(buf, "%llx", tmpui);
@@ -291,19 +291,19 @@ lwres__print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
                                        tmpui = va_arg(ap, unsigned int);
                                if (alt) {
                                        head = "0X";
-                                       if (precision > 2)
+                                       if (precision > 2U)
                                                precision -= 2;
                                }
                                sprintf(buf, "%llX", tmpui);
                                goto printint;
                        printint:
-                               if (precision != 0 || width != 0) {
+                               if (precision != 0U || width != 0U) {
                                        length = strlen(buf);
                                        if (length < precision)
                                                zeropad = precision - length;
                                        else if (length < width && zero)
                                                zeropad = width - length;
-                                       if (width != 0) {
+                                       if (width != 0U) {
                                                pad = width - length -
                                                      zeropad - strlen(head);
                                                if (pad < 0)
@@ -348,7 +348,7 @@ lwres__print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
                        cp = va_arg(ap, char *);
                        REQUIRE(cp != NULL);
 
-                       if (precision != 0) {
+                       if (precision != 0U) {
                                /*
                                 * cp need not be NULL terminated.
                                 */
@@ -357,13 +357,13 @@ lwres__print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
 
                                n = precision;
                                tp = cp;
-                               while (n != 0 && *tp != '\0')
+                               while (n != 0U && *tp != '\0')
                                        n--, tp++;
                                length = precision - n;
                        } else {
                                length = strlen(cp);
                        }
-                       if (width != 0) {
+                       if (width != 0U) {
                                pad = width - length;
                                if (pad < 0)
                                        pad = 0;
@@ -375,8 +375,8 @@ lwres__print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
                                        size--;
                                        pad--;
                                }
-                       if (precision != 0)
-                               while (precision > 0 && *cp != '\0' &&
+                       if (precision != 0U)
+                               while (precision > 0U && *cp != '\0' &&
                                       size > 1U) {
                                        *str++ = *cp++;
                                        size--;
@@ -395,14 +395,14 @@ lwres__print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
                        break;
                case 'c':
                        c = va_arg(ap, int);
-                       if (width > 0) {
+                       if (width > 0U) {
                                count += width;
                                width--;
                                if (left) {
                                        *str++ = c;
                                        size--;
                                }
-                               while (width-- > 0 && size > 1U) {
+                               while (width-- > 0U && size > 1U) {
                                        *str++ = ' ';
                                        size--;
                                }
@@ -424,7 +424,7 @@ lwres__print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
                        length = strlen(buf);
                        if (precision > length)
                                zeropad = precision - length;
-                       if (width > 0) {
+                       if (width > 0U) {
                                pad = width - length - zeropad;
                                if (pad < 0)
                                        pad = 0;
@@ -494,7 +494,7 @@ lwres__print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
                         * if we cap the precision at 512 we will not
                         * overflow buf.
                         */
-                       if (precision > 512)
+                       if (precision > 512U)
                                precision = 512;
                        sprintf(fmt, "%%%s%s.%lu%s%c", alt ? "#" : "",
                                plus ? "+" : space ? " " : "",
@@ -516,7 +516,7 @@ lwres__print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
                                        sprintf(buf, fmt, dbl);
                                }
                                length = strlen(buf);
-                               if (width > 0) {
+                               if (width > 0U) {
                                        pad = width - length;
                                        if (pad < 0)
                                                pad = 0;