Indentation

This commit is contained in:
mpc
2004-08-09 10:56:14 +00:00
committed by zzz
parent e1264de514
commit 953de3f1f2

View File

@@ -131,16 +131,16 @@ samerr_t sam_connect(sam_sess_t *session, const char *samhost, uint16_t samport,
samerr_t rc; samerr_t rc;
if (style == SAM_STREAM) { if (style == SAM_STREAM) {
if (sam_closeback == NULL || sam_connectback == NULL || if (sam_closeback == NULL || sam_connectback == NULL
sam_databack == NULL || sam_diedback == NULL || || sam_databack == NULL || sam_diedback == NULL
sam_logback == NULL || sam_namingback == NULL || || sam_logback == NULL || sam_namingback == NULL
sam_statusback == NULL) { || sam_statusback == NULL) {
SAMLOGS("Please set callback functions before connecting"); SAMLOGS("Please set callback functions before connecting");
return SAM_CALLBACKS_UNSET; return SAM_CALLBACKS_UNSET;
} }
} else if (style == SAM_DGRAM) { } else if (style == SAM_DGRAM) {
if (sam_dgramback == NULL || sam_diedback == NULL || if (sam_dgramback == NULL || sam_diedback == NULL
sam_logback == NULL || sam_namingback == NULL) { || sam_logback == NULL || sam_namingback == NULL) {
SAMLOGS("Please set callback functions before connecting"); SAMLOGS("Please set callback functions before connecting");
return SAM_CALLBACKS_UNSET; return SAM_CALLBACKS_UNSET;
} }
@@ -667,7 +667,6 @@ static bool sam_readable(sam_sess_t *session)
sam_diedback(session); sam_diedback(session);
return false; return false;
} }
/* it seems like there should be a better way to do this (i.e. not select)*/
FD_ZERO(&rset); FD_ZERO(&rset);
FD_SET(session->sock, &rset); FD_SET(session->sock, &rset);
tv.tv_sec = 0; tv.tv_sec = 0;
@@ -957,10 +956,11 @@ retry:
} }
a.s_addr = ((struct in_addr *)h->h_addr)->s_addr; a.s_addr = ((struct in_addr *)h->h_addr)->s_addr;
#ifdef NO_INET_NTOP #ifdef NO_INET_NTOP
/* inet_ntoa() was very poorly designed! */
char *tmp; char *tmp;
tmp = inet_ntoa(a); tmp = inet_ntoa(a);
assert(tmp != NULL); assert(tmp != NULL);
strlcpy(ipaddr, tmp, INET_ADDRSTRLEN); /* inet_ntoa() was very poorly designed */ strlcpy(ipaddr, tmp, INET_ADDRSTRLEN);
return true; return true;
#else #else
if (inet_ntop(AF_INET, &a, ipaddr, INET_ADDRSTRLEN) != NULL) { if (inet_ntop(AF_INET, &a, ipaddr, INET_ADDRSTRLEN) != NULL) {
@@ -1251,7 +1251,7 @@ const char *sam_winsock_strerror(int code)
return "This is a nonrecoverable error"; return "This is a nonrecoverable error";
case WSANO_DATA: case WSANO_DATA:
return "Valid name, no data record of requested type"; return "Valid name, no data record of requested type";
/* None of this shit compiles under Mingw - who knows why... /* None of this shit compiles under Mingw - who knows why...
case WSA_INVALID_HANDLE: case WSA_INVALID_HANDLE:
return "Specified event object handle is invalid"; return "Specified event object handle is invalid";
case WSA_INVALID_PARAMETER: case WSA_INVALID_PARAMETER:
@@ -1269,8 +1269,7 @@ const char *sam_winsock_strerror(int code)
case WSAINVALIDPROVIDER: case WSAINVALIDPROVIDER:
return "Invalid service provider version number"; return "Invalid service provider version number";
case WSAPROVIDERFAILEDINIT: case WSAPROVIDERFAILEDINIT:
return "Unable to initialize a service provider"; return "Unable to initialize a service provider"; */
*/
case WSASYSCALLFAILURE: case WSASYSCALLFAILURE:
return "System call failure"; return "System call failure";
default: default: