ruby-changes:19370
From: nobu <ko1@a...>
Date: Tue, 3 May 2011 04:05:13 +0900 (JST)
Subject: [ruby-changes:19370] Ruby:r31410 (trunk): * win32/win32.c: remove trailing spaces and no-cuddle "else".
nobu 2011-05-03 04:05:03 +0900 (Tue, 03 May 2011) New Revision: 31410 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31410 Log: * win32/win32.c: remove trailing spaces and no-cuddle "else". Modified files: trunk/win32/win32.c Index: win32/win32.c =================================================================== --- win32/win32.c (revision 31409) +++ win32/win32.c (revision 31410) @@ -1343,7 +1343,7 @@ return tail; } -// +// // Check a command string to determine if it has I/O redirection // characters that require it to be executed by a command interpreter // @@ -1403,7 +1403,7 @@ return ptr; } -int +int rb_w32_cmdvector(const char *cmd, char ***vec) { int globbing, len; @@ -1431,9 +1431,9 @@ // // Ok, parse the command line, building a list of CmdLineElements. // When we've finished, and it's an input command (meaning that it's - // the processes argv), we'll do globing and then build the argument + // the processes argv), we'll do globing and then build the argument // vector. - // The outer loop does one interation for each element seen. + // The outer loop does one interation for each element seen. // The inner loop does one interation for each character in the element. // @@ -1470,7 +1470,7 @@ case '?': case '[': case '{': - // + // // record the fact that this element has a wildcard character // N.B. Don't glob if inside a single quoted string // @@ -1484,7 +1484,7 @@ case '\"': // // if we're already in a string, see if this is the - // terminating close-quote. If it is, we're finished with + // terminating close-quote. If it is, we're finished with // the string, but not neccessarily with the element. // If we're not already in a string, start one. // @@ -1520,7 +1520,7 @@ if (done) --len; // - // if it's an input vector element and it's enclosed by quotes, + // if it's an input vector element and it's enclosed by quotes, // we can remove them. // @@ -1582,10 +1582,10 @@ } // - // Almost done! + // Almost done! // Count up the elements, then allocate space for a vector of pointers // (argv) and a string table for the elements. - // + // for (elements = 0, strsz = 0, curr = cmdhead; curr; curr = curr->next) { elements++; @@ -1605,7 +1605,7 @@ for (vptr = *vec; *vptr; ++vptr); return vptr - *vec; } - + // // make vptr point to the start of the buffer // and ptr point to the area we'll consider the string table. @@ -1646,7 +1646,7 @@ // // The idea here is to read all the directory names into a string table // (separated by nulls) and when one of the other dir functions is called -// return the pointer to the current file name. +// return the pointer to the current file name. // #define GetBit(bits, i) ((bits)[(i) / CHAR_BIT] & (1 << (i) % CHAR_BIT)) @@ -1738,7 +1738,7 @@ // // bump the string table size by enough for the - // new name and it's null terminator + // new name and it's null terminator // tmpW = realloc(p->start, (idx + len) * sizeof(WCHAR)); if (!tmpW) { @@ -1928,7 +1928,8 @@ return &(dirp->dirstr); - } else + } + else return NULL; } @@ -2194,7 +2195,7 @@ } // -// Since the errors returned by the socket error function +// Since the errors returned by the socket error function // WSAGetLastError() are not known by the library routine strerror // we have to roll our own. // @@ -2294,7 +2295,7 @@ int setuid(rb_uid_t uid) -{ +{ return (uid == ROOT_UID ? 0 : -1); } @@ -2373,14 +2374,14 @@ dst->capa = (src->fdset->fd_count / FD_SETSIZE + 1) * FD_SETSIZE; dst->fdset = xrealloc(dst->fdset, sizeof(unsigned int) + sizeof(SOCKET) * dst->capa); } - + memcpy(dst->fdset->fd_array, src->fdset->fd_array, src->fdset->fd_count * sizeof(src->fdset->fd_array[0])); } // // Networking trampolines -// These are used to avoid socket startup/shutdown overhead in case +// These are used to avoid socket startup/shutdown overhead in case // the socket routines aren't used. // @@ -2411,7 +2412,7 @@ } memmove( &src->fd_array[s], - &src->fd_array[s+1], + &src->fd_array[s+1], sizeof(src->fd_array[0]) * (--src->fd_count - s)); } else s++; @@ -3005,7 +3006,7 @@ } int WSAAPI -rb_w32_sendto(int fd, const char *buf, int len, int flags, +rb_w32_sendto(int fd, const char *buf, int len, int flags, const struct sockaddr *to, int tolen) { return overlapped_socket_io(FALSE, fd, (char *)buf, len, flags, @@ -3171,7 +3172,7 @@ }); return r; } - + #undef shutdown int WSAAPI @@ -3615,7 +3616,8 @@ if (options == WNOHANG) { timeout = 0; - } else { + } + else { timeout = INFINITE; } @@ -3956,7 +3958,8 @@ if (IsWinNT()) { if (MoveFileExW(oldpath, newpath, MOVEFILE_REPLACE_EXISTING)) res = 0; - } else { + } + else { for (;;) { if (!DeleteFileW(newpath) && GetLastError() != ERROR_FILE_NOT_FOUND) break; @@ -4519,8 +4522,7 @@ if (enough_to_get(stream->FILE_COUNT)) { c = (unsigned char)*stream->FILE_READPTR++; } - else - { + else { c = _filbuf(stream); #if defined __BORLANDC__ if ((c == EOF) && (errno == EPIPE)) { @@ -4539,8 +4541,7 @@ if (enough_to_put(stream->FILE_COUNT)) { c = (unsigned char)(*stream->FILE_READPTR++ = (char)c); } - else - { + else { c = _flsbuf(c, stream); catch_interrupt(); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/