diff --git a/nsock/src/nsock_core.c b/nsock/src/nsock_core.c index 9e41af4d7..64a2859f1 100644 --- a/nsock/src/nsock_core.c +++ b/nsock/src/nsock_core.c @@ -223,7 +223,7 @@ static void update_events(msiod * iod, mspool *ms, int ev_inc, int ev_dec) { * loop just after its addition. */ static int iod_add_event(msiod *iod, msevent *nse) { - switch(nse->type) { + switch (nse->type) { case NSE_TYPE_CONNECT: case NSE_TYPE_CONNECT_SSL: if (iod->first_connect) @@ -334,7 +334,7 @@ void handle_connect_result(mspool *ms, msevent *nse, enum nse_status status) { if (getsockopt(iod->sd, SOL_SOCKET, SO_ERROR, (char *)&optval, &optlen) != 0) optval = socket_errno(); /* Stupid Solaris */ - switch(optval) { + switch (optval) { case 0: nse->status = NSE_STATUS_SUCCESS; break; @@ -750,7 +750,7 @@ void handle_read_result(mspool *ms, msevent *nse, enum nse_status status) { if (rc > 0) { nse->iod->read_count += rc; /* We decide whether we have read enough to return */ - switch(nse->readinfo.read_type) { + switch (nse->readinfo.read_type) { case NSOCK_READ: nse->status = NSE_STATUS_SUCCESS; nse->event_done = 1; @@ -809,7 +809,7 @@ void handle_pcap_read_result(mspool *ms, msevent *nse, enum nse_status status) { msiod *iod = nse->iod; mspcap *mp = (mspcap *)iod->pcap; - switch(status) { + switch (status) { case NSE_STATUS_TIMEOUT: nse->status = NSE_STATUS_TIMEOUT; nse->event_done = 1; @@ -942,7 +942,7 @@ void process_event(mspool *nsp, gh_list *evlist, msevent *nse, int ev) { nsock_log_debug_all(nsp, "Processing event %lu", nse->id); if (!nse->event_done) { - switch(nse->type) { + switch (nse->type) { case NSE_TYPE_CONNECT: case NSE_TYPE_CONNECT_SSL: if (ev != EV_NONE) @@ -1157,7 +1157,7 @@ void nsp_add_event(mspool *nsp, msevent *nse) { nsp->events_pending++; /* Now we do the event type specific actions */ - switch(nse->type) { + switch (nse->type) { case NSE_TYPE_CONNECT: case NSE_TYPE_CONNECT_SSL: if (!nse->event_done) { @@ -1253,7 +1253,7 @@ void nsock_trace_handler_callback(mspool *ms, msevent *nse) { errstr[0] = '\0'; /* Some types have special tracing treatment */ - switch(nse->type) { + switch (nse->type) { case NSE_TYPE_CONNECT: case NSE_TYPE_CONNECT_SSL: nsock_log_info(ms, "Callback: %s %s %sfor EID %li [%s]", diff --git a/nsock/src/nsock_event.c b/nsock/src/nsock_event.c index 52c30444f..20f4d6a0f 100644 --- a/nsock/src/nsock_event.c +++ b/nsock/src/nsock_event.c @@ -141,7 +141,7 @@ static void first_ev_next(msevent *nse, gh_list_elem **first) { } void update_first_events(msevent *nse) { - switch(get_event_id_type(nse->id)) { + switch (get_event_id_type(nse->id)) { case NSE_TYPE_CONNECT: case NSE_TYPE_CONNECT_SSL: first_ev_next(nse, &nse->iod->first_connect); @@ -191,7 +191,7 @@ int nsock_event_cancel(nsock_pool ms_pool, nsock_event_id id, int notify) { nsock_log_info(nsp, "Event #%li (type %s) cancelled", id, nse_type2str(type)); /* First we figure out what list it is in */ - switch(type) { + switch (type) { case NSE_TYPE_CONNECT: event_list = &nsp->connect_events; break; @@ -261,7 +261,7 @@ int msevent_cancel(mspool *nsp, msevent *nse, gh_list *event_list, gh_list_elem /* Now that we found the event... we go through the motions of cleanly * cancelling it */ - switch(nse->type) { + switch (nse->type) { case NSE_TYPE_CONNECT: case NSE_TYPE_CONNECT_SSL: handle_connect_result(nsp, nse, NSE_STATUS_CANCELLED); @@ -477,7 +477,7 @@ void msevent_delete(mspool *nsp, msevent *nse) { /* Takes an nse_type (as returned by nse_type() and returns a static string name * that you can use for printing, etc. */ const char *nse_type2str(enum nse_type type) { - switch(type) { + switch (type) { case NSE_TYPE_CONNECT: return "CONNECT"; case NSE_TYPE_CONNECT_SSL: return "SSL-CONNECT"; case NSE_TYPE_READ: return "READ"; @@ -492,7 +492,7 @@ const char *nse_type2str(enum nse_type type) { /* Takes an nse_status (as returned by nse_status() and returns a static string * name that you can use for printing, etc. */ const char *nse_status2str(enum nse_status status) { - switch(status) { + switch (status) { case NSE_STATUS_NONE: return "NONE"; case NSE_STATUS_SUCCESS: return "SUCCESS"; case NSE_STATUS_ERROR: return "ERROR"; diff --git a/nsock/src/nsock_pcap.c b/nsock/src/nsock_pcap.c index 5ba9f0210..d724f20ee 100644 --- a/nsock/src/nsock_pcap.c +++ b/nsock/src/nsock_pcap.c @@ -276,7 +276,7 @@ int nsock_pcap_get_l3_offset(pcap_t *pt, int *dl) { /* XXX NOTE: * if a new offset ever exceeds the current max (24), adjust MAX_LINK_HEADERSZ in libnetutil/netutil.h */ - switch(datalink) { + switch (datalink) { case DLT_EN10MB: offset = 14; break; case DLT_IEEE802: offset = 22; break; #ifdef __amigaos__ @@ -372,7 +372,7 @@ int do_actual_pcap_read(msevent *nse) { assert(fs_length(&(nse->iobuf)) == 0); rc = pcap_next_ex(mp->pt, &pkt_header, &pkt_data); - switch(rc) { + switch (rc) { case 1: /* read good packet */ #ifdef PCAP_RECV_TIMEVAL_VALID npp.ts = pkt_header->ts;