Commit f2fdfe7c authored by David Lawrence's avatar David Lawrence
Browse files

Silence "end-of-loop condition not reached" warnings from Solaris compiler

parent bb6ead0a
165. [cleanup] Silence "end-of-loop condition not reached" warnings
from Solaris compiler.
164. [cleanup] Added functions isc_file_fopen(), isc_file_fclose(),
164. [func] Added functions isc_file_fopen(), isc_file_fclose(),
isc_file_fseek(), isc_file_fread(), isc_file_fwrite(),
isc_file_fflush(), isc_file_ffsync(), isc_file_remove()
to encapsulate nonportable usage of errno and fflush().
163. [func] Added result codes ISC_R_FILENOTFOUND and ISC_R_FILEEXISTS.
163. [func] Added result codes ISC_R_FILENOTFOUND and
ISC_R_FILEEXISTS.
162. [bug] Ensure proper range for arguments to ctype.h functions.
......
......@@ -71,16 +71,21 @@
* Fail unconditionally with result 'code', which must not
* be ISC_R_SUCCESS. The reason for failure presumably has
* been logged already.
*
* The test is there to keep the Solaris compiler from complaining
* about "end-of-loop code not reached".
*/
#define FAIL(code) \
do { \
result = (code); \
goto failure; \
if (code != ISC_R_SUCCESS) goto failure; \
} while (0)
/*
* Fail unconditionally and log as a client error.
* The test against ISC_R_SUCCESS is there to keep the Solaris compiler
* from complaining about "end-of-loop code not reached".
*/
#define FAILC(code, msg) \
do { \
......@@ -88,11 +93,13 @@
isc_log_write(NOTIFY_PROTOCOL_LOGARGS, \
"notify failed: %s (%s)", \
msg, isc_result_totext(code)); \
goto failure; \
if (code != ISC_R_SUCCESS) goto failure; \
} while (0)
/*
* Fail unconditionally and log as a server error.
* The test against ISC_R_SUCCESS is there to keep the Solaris compiler
* from complaining about "end-of-loop code not reached".
*/
#define FAILS(code, msg) \
do { \
......@@ -100,7 +107,7 @@
isc_log_write(NOTIFY_PROTOCOL_LOGARGS, \
"notify error: %s: %s", \
msg, isc_result_totext(code)); \
goto failure; \
if (code != ISC_R_SUCCESS) goto failure; \
} while (0)
/**************************************************************************/
......
......@@ -89,16 +89,21 @@
* Fail unconditionally with result 'code', which must not
* be ISC_R_SUCCESS. The reason for failure presumably has
* been logged already.
*
* The test against ISC_R_SUCCESS is there to keep the Solaris compiler
* from complaining about "end-of-loop code not reached".
*/
#define FAIL(code) \
do { \
result = (code); \
goto failure; \
if (code != ISC_R_SUCCESS) goto failure; \
} while (0)
/*
* Fail unconditionally and log as a client error.
* The test against ISC_R_SUCCESS is there to keep the Solaris compiler
* from complaining about "end-of-loop code not reached".
*/
#define FAILC(code, msg) \
do { \
......@@ -106,11 +111,13 @@
isc_log_write(UPDATE_PROTOCOL_LOGARGS, \
"dynamic update failed: %s (%s)", \
msg, isc_result_totext(code)); \
goto failure; \
if (code != ISC_R_SUCCESS) goto failure; \
} while (0)
/*
* Fail unconditionally and log as a server error.
* The test against ISC_R_SUCCESS is there to keep the Solaris compiler
* from complaining about "end-of-loop code not reached".
*/
#define FAILS(code, msg) \
do { \
......@@ -118,7 +125,7 @@
isc_log_write(UPDATE_PROTOCOL_LOGARGS, \
"dynamic update error: %s: %s", \
msg, isc_result_totext(code)); \
goto failure; \
if (code != ISC_R_SUCCESS) goto failure; \
} while (0)
/**************************************************************************/
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: xfrout.c,v 1.60 2000/05/08 14:33:01 tale Exp $ */
/* $Id: xfrout.c,v 1.61 2000/05/10 03:33:52 tale Exp $ */
#include <config.h>
......@@ -62,6 +62,8 @@
/*
* Fail unconditionally and log as a client error.
* The test against ISC_R_SUCCESS is there to keep the Solaris compiler
* from complaining about "end-of-loop code not reached".
*/
#define FAILC(code, msg) \
do { \
......@@ -70,7 +72,7 @@
NS_LOGMODULE_XFER_OUT, ISC_LOG_INFO, \
"bad zone transfer request: %s (%s)", \
msg, isc_result_totext(code)); \
goto failure; \
if (result != ISC_R_SUCCESS) goto failure; \
} while (0)
#define CHECK(op) \
......
......@@ -55,7 +55,15 @@ static isc_boolean_t bind8_compat = ISC_TRUE; /* XXX config */
#define JOURNAL_DEBUG_LOGARGS(n) \
JOURNAL_COMMON_LOGARGS, ISC_LOG_DEBUG(n)
#define FAIL(code) do { result = (code); goto failure; } while (0)
/*
* It would be non-sensical (or at least obtuse) to use FAIL() with an
* ISC_R_SUCCESS code, but the test is there to keep the Solaris compiler
* from complaining about "end-of-loop code not reached".
*/
#define FAIL(code) \
do { result = (code); \
if (result != ISC_R_SUCCESS) goto failure; \
} while (0)
#define CHECK(op) \
do { result = (op); \
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: xfrin.c,v 1.67 2000/05/08 19:23:22 tale Exp $ */
/* $Id: xfrin.c,v 1.68 2000/05/10 03:33:54 tale Exp $ */
#include <config.h>
......@@ -45,10 +45,20 @@
* Incoming AXFR and IXFR.
*/
#define FAIL(code) do { result = (code); goto failure; } while (0)
#define CHECK(op) do { result = (op); \
if (result != ISC_R_SUCCESS) goto failure; \
} while (0)
/*
* It would be non-sensical (or at least obtuse) to use FAIL() with an
* ISC_R_SUCCESS code, but the test is there to keep the Solaris compiler
* from complaining about "end-of-loop code not reached".
*/
#define FAIL(code) \
do { result = (code); \
if (result != ISC_R_SUCCESS) goto failure; \
} while (0)
#define CHECK(op) \
do { result = (op); \
if (result != ISC_R_SUCCESS) goto failure; \
} while (0)
/*
* The states of the *XFR state machine. We handle both IXFR and AXFR
......
......@@ -3,7 +3,7 @@
* The Berkeley Software Design Inc. software License Agreement specifies
* the terms and conditions for redistribution.
*
* BSDI $Id: getaddrinfo.c,v 1.15 2000/04/28 02:08:12 tale Exp $
* BSDI $Id: getaddrinfo.c,v 1.16 2000/05/10 03:33:56 tale Exp $
*/
#include <config.h>
......@@ -219,7 +219,9 @@ lwres_getaddrinfo(const char *hostname, const char *servname,
if (lwres_net_aton(hostname, (struct in_addr *)abuf)) {
if (family == AF_INET6) {
/* Convert to a V4 mapped address */
/*
* Convert to a V4 mapped address.
*/
struct in6_addr *a6 = (struct in6_addr *)abuf;
memcpy(&a6->s6_addr[12], &a6->s6_addr[0], 4);
memset(&a6->s6_addr[10], 0xff, 2);
......@@ -319,7 +321,9 @@ set_order(family, net_order)
order = getenv("NET_ORDER");
found = 0;
while (order != NULL) {
/* We ignore any unknown names. */
/*
* We ignore any unknown names.
*/
tok = lwres_strsep(&order, ":");
if (strcasecmp(tok, "inet6") == 0) {
if ((found & FOUND_IPV6) == 0)
......@@ -333,7 +337,9 @@ set_order(family, net_order)
}
}
/* Add in anything that we didn't find */
/*
* Add in anything that we didn't find.
*/
if ((found & FOUND_IPV4) == 0)
*net_order++ = add_ipv4;
if ((found & FOUND_IPV6) == 0)
......@@ -345,11 +351,18 @@ set_order(family, net_order)
static char v4_loop[4] = { 127, 0, 0, 1 };
#define ERR(x) do { result = (x); goto cleanup; } while (0)
/*
* The test against 0 is there to keep the Solaris compiler
* from complaining about "end-of-loop code not reached".
*/
#define ERR(code) \
do { result = (code); \
if (result != 0) goto cleanup; \
} while (0)
static int
add_ipv4(const char *hostname, int flags, struct addrinfo **aip,
int socktype, int port)
int socktype, int port)
{
struct addrinfo *ai;
lwres_context_t *lwrctx = NULL;
......@@ -551,10 +564,14 @@ ai_reverse(struct addrinfo *oai) {
nai = NULL;
while (oai) {
/* grab one off the old list */
/*
* Grab one off the old list.
*/
tai = oai;
oai = oai->ai_next;
/* put it on the front of the new list */
/*
* Put it on the front of the new list.
*/
tai->ai_next = nai;
nai = tai;
}
......
......@@ -74,7 +74,14 @@ static struct afd {
#define ENI_FAMILY 5
#define ENI_SALEN 6
#define ERR(x) do { result = (x); goto cleanup; } while (0)
/*
* The test against 0 is there to keep the Solaris compiler
* from complaining about "end-of-loop code not reached".
*/
#define ERR(code) \
do { result = (code); \
if (result != 0) goto cleanup; \
} while (0)
int
lwres_getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment