mirror of
https://github.com/postgres/postgres.git
synced 2025-12-07 12:02:30 +03:00
pgindent run before PG 9.1 beta 1.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -236,7 +236,7 @@ typedef union
|
||||
#if defined(B64)
|
||||
B64 b64;
|
||||
#endif
|
||||
} C_block;
|
||||
} C_block;
|
||||
|
||||
/*
|
||||
* Convert twenty-four-bit long in host-order
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user