mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Run pgindent on 9.2 source tree in preparation for first 9.3
commit-fest.
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
* This file supplies pg_erand48(), pg_lrand48(), and pg_srand48(), which
|
||||
* are just like erand48(), lrand48(), and srand48() except that we use
|
||||
* our own implementation rather than the one provided by the operating
|
||||
* system. We used to test for an operating system version rather than
|
||||
* system. We used to test for an operating system version rather than
|
||||
* unconditionally using our own, but (1) some versions of Cygwin have a
|
||||
* buggy erand48() that always returns zero and (2) as of 2011, glibc's
|
||||
* erand48() is strangely coded to be almost-but-not-quite thread-safe,
|
||||
|
@@ -10,7 +10,7 @@
|
||||
* src/port/fls.c
|
||||
*
|
||||
* This file was taken from FreeBSD to provide an implementation of fls()
|
||||
* for platforms that lack it. Note that the operating system's version may
|
||||
* for platforms that lack it. Note that the operating system's version may
|
||||
* be substantially more efficient than ours, since some platforms have an
|
||||
* assembly instruction that does exactly this.
|
||||
*
|
||||
@@ -25,18 +25,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)
|
||||
@@ -54,11 +54,11 @@
|
||||
int
|
||||
fls(int mask)
|
||||
{
|
||||
int bit;
|
||||
int bit;
|
||||
|
||||
if (mask == 0)
|
||||
return (0);
|
||||
for (bit = 1; mask != 1; bit++)
|
||||
mask = (unsigned int)mask >> 1;
|
||||
mask = (unsigned int) mask >> 1;
|
||||
return (bit);
|
||||
}
|
||||
|
@@ -328,7 +328,7 @@ gai_strerror(int errcode)
|
||||
case EAI_MEMORY:
|
||||
return "Not enough memory";
|
||||
#endif
|
||||
#if defined(EAI_NODATA) && EAI_NODATA != EAI_NONAME /* MSVC/WIN64 duplicate */
|
||||
#if defined(EAI_NODATA) && EAI_NODATA != EAI_NONAME /* MSVC/WIN64 duplicate */
|
||||
case EAI_NODATA:
|
||||
return "No host data of that type was found";
|
||||
#endif
|
||||
|
@@ -212,7 +212,7 @@ join_path_components(char *ret_path,
|
||||
}
|
||||
if (*tail)
|
||||
snprintf(ret_path + strlen(ret_path), MAXPGPATH - strlen(ret_path),
|
||||
/* only add slash if there is something already in head */
|
||||
/* only add slash if there is something already in head */
|
||||
"%s%s", head[0] ? "/" : "", tail);
|
||||
}
|
||||
|
||||
|
@@ -27,12 +27,11 @@
|
||||
|
||||
struct locale_map
|
||||
{
|
||||
const char *locale_name_part; /* string in locale name to replace */
|
||||
const char *replacement; /* string to replace it with */
|
||||
const char *locale_name_part; /* string in locale name to replace */
|
||||
const char *replacement; /* string to replace it with */
|
||||
};
|
||||
|
||||
static const struct locale_map locale_map_list[] = {
|
||||
|
||||
/*
|
||||
* "HKG" is listed here:
|
||||
* http://msdn.microsoft.com/en-us/library/cdax410z%28v=vs.71%29.aspx
|
||||
@@ -41,26 +40,26 @@ static const struct locale_map locale_map_list[] = {
|
||||
* "ARE" is the ISO-3166 three-letter code for U.A.E. It is not on the
|
||||
* above list, but seems to work anyway.
|
||||
*/
|
||||
{ "Hong Kong S.A.R.", "HKG" },
|
||||
{ "U.A.E.", "ARE" },
|
||||
{"Hong Kong S.A.R.", "HKG"},
|
||||
{"U.A.E.", "ARE"},
|
||||
|
||||
/*
|
||||
* The ISO-3166 country code for Macau S.A.R. is MAC, but Windows doesn't
|
||||
* seem to recognize that. And Macau isn't listed in the table of
|
||||
* accepted abbreviations linked above. Fortunately, "ZHM" seems to be
|
||||
* accepted as an alias for "Chinese (Traditional)_Macau S.A.R..950". I'm
|
||||
* not sure where "ZHM" comes from, must be some legacy naming scheme. But
|
||||
* hey, it works.
|
||||
* seem to recognize that. And Macau isn't listed in the table of accepted
|
||||
* abbreviations linked above. Fortunately, "ZHM" seems to be accepted as
|
||||
* an alias for "Chinese (Traditional)_Macau S.A.R..950". I'm not sure
|
||||
* where "ZHM" comes from, must be some legacy naming scheme. But hey, it
|
||||
* works.
|
||||
*
|
||||
* Note that unlike HKG and ARE, ZHM is an alias for the *whole* locale
|
||||
* name, not just the country part.
|
||||
*
|
||||
* Some versions of Windows spell it "Macau", others "Macao".
|
||||
*/
|
||||
{ "Chinese (Traditional)_Macau S.A.R..950", "ZHM" },
|
||||
{ "Chinese_Macau S.A.R..950", "ZHM" },
|
||||
{ "Chinese (Traditional)_Macao S.A.R..950", "ZHM" },
|
||||
{ "Chinese_Macao S.A.R..950", "ZHM" }
|
||||
{"Chinese (Traditional)_Macau S.A.R..950", "ZHM"},
|
||||
{"Chinese_Macau S.A.R..950", "ZHM"},
|
||||
{"Chinese (Traditional)_Macao S.A.R..950", "ZHM"},
|
||||
{"Chinese_Macao S.A.R..950", "ZHM"}
|
||||
};
|
||||
|
||||
char *
|
||||
@@ -85,10 +84,10 @@ pgwin32_setlocale(int category, const char *locale)
|
||||
if (match != NULL)
|
||||
{
|
||||
/* Found a match. Replace the matched string. */
|
||||
int matchpos = match - locale;
|
||||
int replacementlen = strlen(replacement);
|
||||
char *rest = match + strlen(needle);
|
||||
int restlen = strlen(rest);
|
||||
int matchpos = match - locale;
|
||||
int replacementlen = strlen(replacement);
|
||||
char *rest = match + strlen(needle);
|
||||
int restlen = strlen(rest);
|
||||
|
||||
alias = malloc(matchpos + replacementlen + restlen + 1);
|
||||
if (!alias)
|
||||
@@ -96,7 +95,8 @@ pgwin32_setlocale(int category, const char *locale)
|
||||
|
||||
memcpy(&alias[0], &locale[0], matchpos);
|
||||
memcpy(&alias[matchpos], replacement, replacementlen);
|
||||
memcpy(&alias[matchpos + replacementlen], rest, restlen + 1); /* includes null terminator */
|
||||
memcpy(&alias[matchpos + replacementlen], rest, restlen + 1); /* includes null
|
||||
* terminator */
|
||||
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user