diff options
| author | Bruce Momjian | 2011-04-10 15:42:00 +0000 |
|---|---|---|
| committer | Bruce Momjian | 2011-04-10 15:42:00 +0000 |
| commit | bf50caf105a901c4f83ac1df3cdaf910c26694a4 (patch) | |
| tree | dac42d7795070f107eefb085c500f86a4d35f92f /src/port | |
| parent | 9a8b73147c07e02e10e0d0a34aa99d72e3336fb2 (diff) | |
pgindent run before PG 9.1 beta 1.
Diffstat (limited to 'src/port')
| -rw-r--r-- | src/port/chklocale.c | 2 | ||||
| -rw-r--r-- | src/port/crypt.c | 2 | ||||
| -rw-r--r-- | src/port/dirmod.c | 2 | ||||
| -rw-r--r-- | src/port/exec.c | 2 | ||||
| -rw-r--r-- | src/port/getaddrinfo.c | 8 | ||||
| -rw-r--r-- | src/port/inet_net_ntop.c | 10 | ||||
| -rw-r--r-- | src/port/path.c | 19 | ||||
| -rw-r--r-- | src/port/pgmkdirp.c | 12 | ||||
| -rw-r--r-- | src/port/snprintf.c | 50 | ||||
| -rw-r--r-- | src/port/unsetenv.c | 4 |
10 files changed, 56 insertions, 55 deletions
diff --git a/src/port/chklocale.c b/src/port/chklocale.c index 62932c2005..e4f3dc99e0 100644 --- a/src/port/chklocale.c +++ b/src/port/chklocale.c @@ -333,7 +333,7 @@ pg_get_encoding_from_locale(const char *ctype, bool write_message) ereport(WARNING, (errmsg("could not determine encoding for locale \"%s\": codeset is \"%s\"", ctype, sys), - errdetail("Please report this to <pgsql-bugs@postgresql.org>."))); + errdetail("Please report this to <pgsql-bugs@postgresql.org>."))); #endif } diff --git a/src/port/crypt.c b/src/port/crypt.c index 7f18e1d2a7..9347d3b47c 100644 --- a/src/port/crypt.c +++ b/src/port/crypt.c @@ -236,7 +236,7 @@ typedef union #if defined(B64) B64 b64; #endif -} C_block; +} C_block; /* * Convert twenty-four-bit long in host-order diff --git a/src/port/dirmod.c b/src/port/dirmod.c index b6a5564c2c..17fd96573d 100644 --- a/src/port/dirmod.c +++ b/src/port/dirmod.c @@ -211,7 +211,7 @@ typedef struct WORD PrintNameOffset; WORD PrintNameLength; WCHAR PathBuffer[1]; -} REPARSE_JUNCTION_DATA_BUFFER; +} REPARSE_JUNCTION_DATA_BUFFER; #define REPARSE_JUNCTION_DATA_BUFFER_HEADER_SIZE \ FIELD_OFFSET(REPARSE_JUNCTION_DATA_BUFFER, SubstituteNameOffset) diff --git a/src/port/exec.c b/src/port/exec.c index 6027917b57..21a951c424 100644 --- a/src/port/exec.c +++ b/src/port/exec.c @@ -358,7 +358,7 @@ pipe_read_line(char *cmd, char *line, int maxsize) if (fgets(line, maxsize, pgver) == NULL) { perror("fgets failure"); - pclose(pgver); /* no error checking */ + pclose(pgver); /* no error checking */ return NULL; } diff --git a/src/port/getaddrinfo.c b/src/port/getaddrinfo.c index fabd50dddb..db19878ae1 100644 --- a/src/port/getaddrinfo.c +++ b/src/port/getaddrinfo.c @@ -329,7 +329,7 @@ gai_strerror(int errcode) return "Not enough memory"; #endif #ifdef EAI_NODATA -#if !defined(WIN64) && !defined(WIN32_ONLY_COMPILER) /* MSVC/WIN64 duplicate */ +#if !defined(WIN64) && !defined(WIN32_ONLY_COMPILER) /* MSVC/WIN64 duplicate */ case EAI_NODATA: return "No host data of that type was found"; #endif @@ -390,9 +390,9 @@ getnameinfo(const struct sockaddr * sa, int salen, if (sa->sa_family == AF_INET) { if (inet_net_ntop(AF_INET, &((struct sockaddr_in *) sa)->sin_addr, - sa->sa_family == AF_INET ? 32 : 128, - node, nodelen) == NULL) - return EAI_MEMORY; + sa->sa_family == AF_INET ? 32 : 128, + node, nodelen) == NULL) + return EAI_MEMORY; } else return EAI_MEMORY; diff --git a/src/port/inet_net_ntop.c b/src/port/inet_net_ntop.c index 7ed3867c05..9c3c93b8ec 100644 --- a/src/port/inet_net_ntop.c +++ b/src/port/inet_net_ntop.c @@ -78,11 +78,11 @@ char * inet_net_ntop(int af, const void *src, int bits, char *dst, size_t size) { /* - * We need to cover both the address family constants used by the PG - * inet type (PGSQL_AF_INET and PGSQL_AF_INET6) and those used by the - * system libraries (AF_INET and AF_INET6). We can safely assume - * PGSQL_AF_INET == AF_INET, but the INET6 constants are very likely - * to be different. If AF_INET6 isn't defined, silently ignore it. + * We need to cover both the address family constants used by the PG inet + * type (PGSQL_AF_INET and PGSQL_AF_INET6) and those used by the system + * libraries (AF_INET and AF_INET6). We can safely assume PGSQL_AF_INET + * == AF_INET, but the INET6 constants are very likely to be different. + * If AF_INET6 isn't defined, silently ignore it. */ switch (af) { diff --git a/src/port/path.c b/src/port/path.c index df2c4e7be6..0d40a0bb9c 100644 --- a/src/port/path.c +++ b/src/port/path.c @@ -374,21 +374,22 @@ path_is_relative_and_below_cwd(const char *path) else if (path_contains_parent_reference(path)) return false; #ifdef WIN32 + /* - * On Win32, a drive letter _not_ followed by a slash, e.g. 'E:abc', is - * relative to the cwd on that drive, or the drive's root directory - * if that drive has no cwd. Because the path itself cannot tell us - * which is the case, we have to assume the worst, i.e. that it is not - * below the cwd. We could use GetFullPathName() to find the full path - * but that could change if the current directory for the drive changes - * underneath us, so we just disallow it. + * On Win32, a drive letter _not_ followed by a slash, e.g. 'E:abc', is + * relative to the cwd on that drive, or the drive's root directory if + * that drive has no cwd. Because the path itself cannot tell us which is + * the case, we have to assume the worst, i.e. that it is not below the + * cwd. We could use GetFullPathName() to find the full path but that + * could change if the current directory for the drive changes underneath + * us, so we just disallow it. */ else if (isalpha((unsigned char) path[0]) && path[1] == ':' && - !IS_DIR_SEP(path[2])) + !IS_DIR_SEP(path[2])) return false; #endif else - return true; + return true; } /* diff --git a/src/port/pgmkdirp.c b/src/port/pgmkdirp.c index b65db5e969..84367f7c9b 100644 --- a/src/port/pgmkdirp.c +++ b/src/port/pgmkdirp.c @@ -9,18 +9,18 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * 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. + * 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 - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) diff --git a/src/port/snprintf.c b/src/port/snprintf.c index 88cb4d4c2b..9f719505f4 100644 --- a/src/port/snprintf.c +++ b/src/port/snprintf.c @@ -108,7 +108,7 @@ typedef struct /* bufend == NULL is for sprintf, where we assume buf is big enough */ FILE *stream; /* eventual output destination, or NULL */ int nchars; /* # chars already sent to stream */ -} PrintfTarget; +} PrintfTarget; /* * Info about the type and value of a formatting parameter. Note that we @@ -124,7 +124,7 @@ typedef enum ATYPE_LONGLONG, ATYPE_DOUBLE, ATYPE_CHARPTR -} PrintfArgType; +} PrintfArgType; typedef union { @@ -133,11 +133,11 @@ typedef union int64 ll; double d; char *cptr; -} PrintfArgValue; +} PrintfArgValue; -static void flushbuffer(PrintfTarget * target); -static int dopr(PrintfTarget * target, const char *format, va_list args); +static void flushbuffer(PrintfTarget *target); +static int dopr(PrintfTarget *target, const char *format, va_list args); int @@ -257,7 +257,7 @@ pg_printf(const char *fmt,...) /* call this only when stream is defined */ static void -flushbuffer(PrintfTarget * target) +flushbuffer(PrintfTarget *target) { size_t nc = target->bufptr - target->bufstart; @@ -268,29 +268,29 @@ flushbuffer(PrintfTarget * target) static void fmtstr(char *value, int leftjust, int minlen, int maxwidth, - int pointflag, PrintfTarget * target); -static void fmtptr(void *value, PrintfTarget * target); + int pointflag, PrintfTarget *target); +static void fmtptr(void *value, PrintfTarget *target); static void fmtint(int64 value, char type, int forcesign, int leftjust, int minlen, int zpad, int precision, int pointflag, - PrintfTarget * target); -static void fmtchar(int value, int leftjust, int minlen, PrintfTarget * target); + PrintfTarget *target); +static void fmtchar(int value, int leftjust, int minlen, PrintfTarget *target); static void fmtfloat(double value, char type, int forcesign, int leftjust, int minlen, int zpad, int precision, int pointflag, - PrintfTarget * target); -static void dostr(const char *str, int slen, PrintfTarget * target); -static void dopr_outch(int c, PrintfTarget * target); + PrintfTarget *target); +static void dostr(const char *str, int slen, PrintfTarget *target); +static void dopr_outch(int c, PrintfTarget *target); static int adjust_sign(int is_negative, int forcesign, int *signvalue); static void adjust_padlen(int minlen, int vallen, int leftjust, int *padlen); static void leading_pad(int zpad, int *signvalue, int *padlen, - PrintfTarget * target); -static void trailing_pad(int *padlen, PrintfTarget * target); + PrintfTarget *target); +static void trailing_pad(int *padlen, PrintfTarget *target); /* * dopr(): poor man's version of doprintf */ static int -dopr(PrintfTarget * target, const char *format, va_list args) +dopr(PrintfTarget *target, const char *format, va_list args) { const char *format_start = format; int ch; @@ -764,7 +764,7 @@ pg_strnlen(const char *str, size_t maxlen) static void fmtstr(char *value, int leftjust, int minlen, int maxwidth, - int pointflag, PrintfTarget * target) + int pointflag, PrintfTarget *target) { int padlen, vallen; /* amount to pad */ @@ -792,7 +792,7 @@ fmtstr(char *value, int leftjust, int minlen, int maxwidth, } static void -fmtptr(void *value, PrintfTarget * target) +fmtptr(void *value, PrintfTarget *target) { int vallen; char convert[64]; @@ -806,7 +806,7 @@ fmtptr(void *value, PrintfTarget * target) static void fmtint(int64 value, char type, int forcesign, int leftjust, int minlen, int zpad, int precision, int pointflag, - PrintfTarget * target) + PrintfTarget *target) { uint64 base; int dosign; @@ -883,7 +883,7 @@ fmtint(int64 value, char type, int forcesign, int leftjust, } static void -fmtchar(int value, int leftjust, int minlen, PrintfTarget * target) +fmtchar(int value, int leftjust, int minlen, PrintfTarget *target) { int padlen = 0; /* amount to pad */ @@ -903,7 +903,7 @@ fmtchar(int value, int leftjust, int minlen, PrintfTarget * target) static void fmtfloat(double value, char type, int forcesign, int leftjust, int minlen, int zpad, int precision, int pointflag, - PrintfTarget * target) + PrintfTarget *target) { int signvalue = 0; int vallen; @@ -932,7 +932,7 @@ fmtfloat(double value, char type, int forcesign, int leftjust, } static void -dostr(const char *str, int slen, PrintfTarget * target) +dostr(const char *str, int slen, PrintfTarget *target) { while (slen > 0) { @@ -959,7 +959,7 @@ dostr(const char *str, int slen, PrintfTarget * target) } static void -dopr_outch(int c, PrintfTarget * target) +dopr_outch(int c, PrintfTarget *target) { if (target->bufend != NULL && target->bufptr >= target->bufend) { @@ -998,7 +998,7 @@ adjust_padlen(int minlen, int vallen, int leftjust, int *padlen) static void -leading_pad(int zpad, int *signvalue, int *padlen, PrintfTarget * target) +leading_pad(int zpad, int *signvalue, int *padlen, PrintfTarget *target) { if (*padlen > 0 && zpad) { @@ -1031,7 +1031,7 @@ leading_pad(int zpad, int *signvalue, int *padlen, PrintfTarget * target) static void -trailing_pad(int *padlen, PrintfTarget * target) +trailing_pad(int *padlen, PrintfTarget *target) { while (*padlen < 0) { diff --git a/src/port/unsetenv.c b/src/port/unsetenv.c index 248cead79d..339e172593 100644 --- a/src/port/unsetenv.c +++ b/src/port/unsetenv.c @@ -31,8 +31,8 @@ unsetenv(const char *name) * that we zap the actual environ member. However, there are some libc * implementations (notably recent BSDs) that do not obey SUS but copy the * presented string. This method fails on such platforms. Hopefully all - * such platforms have unsetenv() and thus won't be using this hack. - * See: http://www.greenend.org.uk/rjk/2008/putenv.html + * such platforms have unsetenv() and thus won't be using this hack. See: + * http://www.greenend.org.uk/rjk/2008/putenv.html * * Note that repeatedly setting and unsetting a var using this code will * leak memory. |
