From 1b23b30b29eebbe7c9953f2a7470f31a0feb8702 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sat, 17 Dec 2011 23:39:47 +0000 Subject: Clean up whitespace. --- winsup/cygwin/libc/inet_addr.c | 12 ++++++------ winsup/cygwin/libc/minires.c | 26 +++++++++++++------------- winsup/cygwin/libc/rcmd.cc | 2 +- winsup/cygwin/libc/strfmon.c | 4 ++-- winsup/cygwin/libc/strptime.cc | 16 ++++++++-------- 5 files changed, 30 insertions(+), 30 deletions(-) (limited to 'winsup/cygwin/libc') diff --git a/winsup/cygwin/libc/inet_addr.c b/winsup/cygwin/libc/inet_addr.c index d80705257..24028ad95 100644 --- a/winsup/cygwin/libc/inet_addr.c +++ b/winsup/cygwin/libc/inet_addr.c @@ -1,7 +1,7 @@ /* * Copyright (c) 1983, 1990, 1993 * The Regents of the University of California. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -29,14 +29,14 @@ /* * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -92,7 +92,7 @@ __FBSDID("$FreeBSD$"); #include "port_after.h" #endif -/* +/* * Check whether "cp" is a valid ascii representation * of an Internet address and convert to a binary address. * Returns 1 if the address is valid, 0 if not. @@ -134,7 +134,7 @@ cygwin_inet_aton(const char *cp, struct in_addr *addr) { val = (val * base) + (c - '0'); c = *++cp; digit = 1; - } else if (base == 16 && isascii(c) && + } else if (base == 16 && isascii(c) && isxdigit((unsigned char)c)) { val = (val << 4) | (c + 10 - (islower((unsigned char)c) ? 'a' : 'A')); diff --git a/winsup/cygwin/libc/minires.c b/winsup/cygwin/libc/minires.c index 725112761..b88f039b7 100644 --- a/winsup/cygwin/libc/minires.c +++ b/winsup/cygwin/libc/minires.c @@ -451,11 +451,11 @@ int res_nsend( res_state statp, const unsigned char * MsgPtr, return ((os_query_t *) statp->os_query)(statp, DomName, Class, Type, AnsPtr, AnsLength); } else { - /* dn_expand sets errno */ + /* dn_expand sets errno */ statp->res_h_errno = NETDB_INTERNAL; return -1; } - } + } /* Close the socket if it had been opened before a fork. Reuse of pid's cannot hurt */ @@ -488,7 +488,7 @@ int res_nsend( res_state statp, const unsigned char * MsgPtr, This routine runs through the retry loop for each incorrect answer. It is thus extremely likely that such attacks will cause a TRY_AGAIN return, probably causing the calling program to retry after a delay. - + Note that valid late or duplicate answers to a previous questions also cause a retry, although this is minimized by flushing the socket before sending the new question. @@ -498,8 +498,8 @@ int res_nsend( res_state statp, const unsigned char * MsgPtr, while ((rslt = cygwin_recvfrom( statp->sockfd, AnsPtr, AnsLength, 0, NULL, NULL)) >= 0) { DPRINTF(debug, "Flushed %d bytes\n", rslt); } - DPRINTF(debug && (errno != EWOULDBLOCK), - "Unexpected errno for flushing recvfrom: %s", strerror(errno)); + DPRINTF(debug && (errno != EWOULDBLOCK), + "Unexpected errno for flushing recvfrom: %s", strerror(errno)); /* Send the message */ rslt = cygwin_sendto(statp->sockfd, MsgPtr, MsgLength, 0, @@ -540,8 +540,8 @@ int res_nsend( res_state statp, const unsigned char * MsgPtr, return -1; } DPRINTF(debug, "recvfrom: %d bytes from %08x\n", rslt, dnsSockAddr.sin_addr.s_addr); - /* - Prepare to retry with tcp + /* + Prepare to retry with tcp */ for (tcp = 0; tcp < 2; tcp++) { /* Check if this is the expected message from the expected server */ @@ -561,11 +561,11 @@ int res_nsend( res_state statp, const unsigned char * MsgPtr, && (rslt >= MsgLength) && (memcmp(MsgPtr + HFIXEDSZ, AnsPtr + HFIXEDSZ, MsgLength - HFIXEDSZ) == 0)))) { if ((AnsPtr[3] & ERR_MASK) == NOERROR) { - if ((AnsPtr[2] & TC) && (tcp == 0) && !(statp->options & RES_IGNTC)) { + if ((AnsPtr[2] & TC) && (tcp == 0) && !(statp->options & RES_IGNTC)) { /* Truncated. Try TCP */ rslt = get_tcp(&statp->nsaddr_list[wServ], MsgPtr, MsgLength, AnsPtr, AnsLength, statp->options & RES_DEBUG); - continue /* Tcp loop */; + continue /* Tcp loop */; } else if ((AnsPtr[6] | AnsPtr[7])!= 0) return rslt; @@ -588,7 +588,7 @@ int res_nsend( res_state statp, const unsigned char * MsgPtr, case FORMERR: statp->res_h_errno = HOST_NOT_FOUND; break; - case SERVFAIL: + case SERVFAIL: statp->res_h_errno = TRY_AGAIN; break; default: @@ -644,7 +644,7 @@ int res_nmkquery (res_state statp, /* Fill the header */ PUTSHORT(statp->id, buf); - PUTSHORT(RD, buf); + PUTSHORT(RD, buf); PUTSHORT(1, buf); /* Number of questions */ for (i = 0; i < 3; i++) PUTSHORT(0, buf); /* Number of answers */ @@ -655,14 +655,14 @@ int res_nmkquery (res_state statp, PUTSHORT(qclass, buf); /* Update id. The current query adds entropy to the next query id */ - for (id4 = qtype, i = 0, ptr = dnameptr; *ptr; ptr++, i += 3) + for (id4 = qtype, i = 0, ptr = dnameptr; *ptr; ptr++, i += 3) id4 ^= *ptr << (i & 0xF); i = 1 + statp->id % 15; /* Between 1 and 16 */ /* id dependent rotation, also brings MSW to LSW */ id4 = (id4 << i) ^ (id4 >> (16 - i)) ^ (id4 >> (32 - i)); if ((short) id4) statp->id ^= (short) id4; - else + else statp->id++; /* Force change */ return len + (HFIXEDSZ + QFIXEDSZ); /* packet size */ diff --git a/winsup/cygwin/libc/rcmd.cc b/winsup/cygwin/libc/rcmd.cc index a09157797..8012790ec 100644 --- a/winsup/cygwin/libc/rcmd.cc +++ b/winsup/cygwin/libc/rcmd.cc @@ -430,7 +430,7 @@ iruserok_sa(const void *ra, int rlen, int superuser, const char *ruser, struct sockaddr_storage ss; /* avoid alignment issue */ - if (rlen > (int) sizeof(ss)) + if (rlen > (int) sizeof(ss)) return(-1); memcpy(&ss, ra, rlen); raddr = (struct sockaddr *)&ss; diff --git a/winsup/cygwin/libc/strfmon.c b/winsup/cygwin/libc/strfmon.c index 79f8ab461..d06bbabf6 100644 --- a/winsup/cygwin/libc/strfmon.c +++ b/winsup/cygwin/libc/strfmon.c @@ -296,9 +296,9 @@ strfmon(char * __restrict s, size_t maxsize, const char * __restrict format, * * = 0 - parentheses enclose the quantity and the * $currency_symbol - * = 1 - the sign string precedes the quantity and the + * = 1 - the sign string precedes the quantity and the * $currency_symbol - * = 2 - the sign string succeeds the quantity and the + * = 2 - the sign string succeeds the quantity and the * $currency_symbol * = 3 - the sign string precedes the $currency_symbol * = 4 - the sign string succeeds the $currency_symbol diff --git a/winsup/cygwin/libc/strptime.cc b/winsup/cygwin/libc/strptime.cc index 66c249e9a..ca059842a 100644 --- a/winsup/cygwin/libc/strptime.cc +++ b/winsup/cygwin/libc/strptime.cc @@ -275,21 +275,21 @@ find_alt_digits (const unsigned char *bp, alt_digits_t *adi, uint *pval) return NULL; } -static int +static int is_leap_year (int year) -{ +{ return (year % 4) == 0 && ((year % 100) != 0 || (year % 400) == 0); -} +} -static int +static int first_day (int year) -{ +{ int ret = 4; - + while (--year >= 1970) ret = (ret + 365 + is_leap_year (year)) % 7; - return ret; -} + return ret; +} /* This simplifies the calls to conv_num enormously. */ #define ALT_DIGITS ((alt_format & ALT_O) ? *alt_digits : NULL) -- cgit v1.2.3