mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
pgindent run.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mb/conv.c,v 1.46 2003/07/25 20:17:54 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mb/conv.c,v 1.47 2003/08/04 00:43:27 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -313,7 +313,7 @@ compare1(const void *p1, const void *p2)
|
||||
|
||||
v1 = *(unsigned int *) p1;
|
||||
v2 = ((pg_utf_to_local *) p2)->utf;
|
||||
return (v1 > v2)?1:((v1 == v2)?0:-1);
|
||||
return (v1 > v2) ? 1 : ((v1 == v2) ? 0 : -1);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -328,7 +328,7 @@ compare2(const void *p1, const void *p2)
|
||||
|
||||
v1 = *(unsigned int *) p1;
|
||||
v2 = ((pg_local_to_utf *) p2)->code;
|
||||
return (v1 > v2)?1:((v1 == v2)?0:-1);
|
||||
return (v1 > v2) ? 1 : ((v1 == v2) ? 0 : -1);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -373,8 +373,8 @@ UtfToLocal(unsigned char *utf, unsigned char *iso,
|
||||
{
|
||||
ereport(WARNING,
|
||||
(errcode(ERRCODE_UNTRANSLATABLE_CHARACTER),
|
||||
errmsg("ignoring unconvertible UTF-8 character 0x%04x",
|
||||
iutf)));
|
||||
errmsg("ignoring unconvertible UTF-8 character 0x%04x",
|
||||
iutf)));
|
||||
continue;
|
||||
}
|
||||
if (p->code & 0xff000000)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* (currently mule internal code (mic) is used)
|
||||
* Tatsuo Ishii
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mb/mbutils.c,v 1.42 2003/07/25 20:17:55 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mb/mbutils.c,v 1.43 2003/08/04 00:43:27 momjian Exp $
|
||||
*/
|
||||
#include "postgres.h"
|
||||
|
||||
@@ -45,7 +45,7 @@ static int pending_client_encoding = PG_SQL_ASCII;
|
||||
/* Internal functions */
|
||||
static unsigned char *perform_default_encoding_conversion(unsigned char *src,
|
||||
int len, bool is_client_to_server);
|
||||
static int cliplen(const unsigned char *str, int len, int limit);
|
||||
static int cliplen(const unsigned char *str, int len, int limit);
|
||||
|
||||
|
||||
/*
|
||||
@@ -108,10 +108,10 @@ SetClientEncoding(int encoding, bool doit)
|
||||
|
||||
/*
|
||||
* If we're not inside a transaction then we can't do catalog lookups,
|
||||
* so fail. After backend startup, this could only happen if we
|
||||
* are re-reading postgresql.conf due to SIGHUP --- so basically this
|
||||
* just constrains the ability to change client_encoding on the fly
|
||||
* from postgresql.conf. Which would probably be a stupid thing to do
|
||||
* so fail. After backend startup, this could only happen if we are
|
||||
* re-reading postgresql.conf due to SIGHUP --- so basically this just
|
||||
* constrains the ability to change client_encoding on the fly from
|
||||
* postgresql.conf. Which would probably be a stupid thing to do
|
||||
* anyway.
|
||||
*/
|
||||
if (!IsTransactionState())
|
||||
@@ -180,8 +180,8 @@ InitializeClientEncoding(void)
|
||||
if (SetClientEncoding(pending_client_encoding, true) < 0)
|
||||
{
|
||||
/*
|
||||
* Oops, the requested conversion is not available.
|
||||
* We couldn't fail before, but we can now.
|
||||
* Oops, the requested conversion is not available. We couldn't
|
||||
* fail before, but we can now.
|
||||
*/
|
||||
ereport(FATAL,
|
||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
@@ -249,15 +249,15 @@ pg_do_encoding_conversion(unsigned char *src, int len,
|
||||
{
|
||||
ereport(LOG,
|
||||
(errcode(ERRCODE_UNDEFINED_FUNCTION),
|
||||
errmsg("default conversion proc for %s to %s does not exist",
|
||||
pg_encoding_to_char(src_encoding),
|
||||
pg_encoding_to_char(dest_encoding))));
|
||||
errmsg("default conversion proc for %s to %s does not exist",
|
||||
pg_encoding_to_char(src_encoding),
|
||||
pg_encoding_to_char(dest_encoding))));
|
||||
return src;
|
||||
}
|
||||
|
||||
/*
|
||||
* XXX we should avoid throwing errors in OidFunctionCall. Otherwise we
|
||||
* are going into infinite loop! So we have to make sure that the
|
||||
* XXX we should avoid throwing errors in OidFunctionCall. Otherwise
|
||||
* we are going into infinite loop! So we have to make sure that the
|
||||
* function exists before calling OidFunctionCall.
|
||||
*/
|
||||
if (!SearchSysCacheExists(PROCOID,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* conversion functions between pg_wchar and multibyte streams.
|
||||
* Tatsuo Ishii
|
||||
* $Id: wchar.c,v 1.32 2003/07/27 04:53:11 tgl Exp $
|
||||
* $Id: wchar.c,v 1.33 2003/08/04 00:43:27 momjian Exp $
|
||||
*
|
||||
* WIN1250 client encoding updated by Pavel Behal
|
||||
*
|
||||
@@ -612,7 +612,7 @@ pg_encoding_max_length(int encoding)
|
||||
* mbstr is not necessarily NULL terminated; length of mbstr is
|
||||
* specified by len.
|
||||
*
|
||||
* If OK, return TRUE. If a problem is found, return FALSE when noError is
|
||||
* If OK, return TRUE. If a problem is found, return FALSE when noError is
|
||||
* true; when noError is false, ereport() a descriptive message.
|
||||
*/
|
||||
bool
|
||||
@@ -637,7 +637,7 @@ pg_verifymbstr(const unsigned char *mbstr, int len, bool noError)
|
||||
return false;
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_CHARACTER_NOT_IN_REPERTOIRE),
|
||||
errmsg("UNICODE characters >= 0x10000 are not supported")));
|
||||
errmsg("UNICODE characters >= 0x10000 are not supported")));
|
||||
}
|
||||
|
||||
l = pg_mblen(mbstr);
|
||||
@@ -659,12 +659,10 @@ pg_verifymbstr(const unsigned char *mbstr, int len, bool noError)
|
||||
return false;
|
||||
|
||||
jlimit = Min(l, len);
|
||||
jlimit = Min(jlimit, 8); /* prevent buffer overrun */
|
||||
jlimit = Min(jlimit, 8); /* prevent buffer overrun */
|
||||
|
||||
for (j = 0; j < jlimit; j++)
|
||||
{
|
||||
p += sprintf(p, "%02x", mbstr[j]);
|
||||
}
|
||||
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_CHARACTER_NOT_IN_REPERTOIRE),
|
||||
|
||||
Reference in New Issue
Block a user