mirror of
https://github.com/postgres/postgres.git
synced 2025-07-26 01:22:12 +03:00
pgindent run for release 9.3
This is the first run of the Perl-based pgindent script. Also update pgindent instructions.
This commit is contained in:
@ -98,7 +98,7 @@ typedef struct plperl_interp_desc
|
||||
*
|
||||
* The refcount field counts the struct's reference from the hash table shown
|
||||
* below, plus one reference for each function call level that is using the
|
||||
* struct. We can release the struct, and the associated Perl sub, when the
|
||||
* struct. We can release the struct, and the associated Perl sub, when the
|
||||
* refcount goes to zero.
|
||||
**********************************************************************/
|
||||
typedef struct plperl_proc_desc
|
||||
@ -866,10 +866,11 @@ pp_require_safe(pTHX)
|
||||
RETPUSHYES;
|
||||
|
||||
DIE(aTHX_ "Unable to load %s into plperl", name);
|
||||
|
||||
/*
|
||||
* In most Perl versions, DIE() expands to a return statement, so the next
|
||||
* line is not necessary. But in versions between but not including 5.11.1
|
||||
* and 5.13.3 it does not, so the next line is necessary to avoid a
|
||||
* line is not necessary. But in versions between but not including
|
||||
* 5.11.1 and 5.13.3 it does not, so the next line is necessary to avoid a
|
||||
* "control reaches end of non-void function" warning from gcc. Other
|
||||
* compilers such as Solaris Studio will, however, issue a "statement not
|
||||
* reached" warning instead.
|
||||
|
@ -102,6 +102,4 @@ void plperl_spi_freeplan(char *);
|
||||
void plperl_spi_cursor_close(char *);
|
||||
char *plperl_sv_to_literal(SV *, char *);
|
||||
|
||||
|
||||
|
||||
#endif /* PL_PERL_H */
|
||||
|
@ -42,8 +42,8 @@ static inline char *
|
||||
utf_e2u(const char *str)
|
||||
{
|
||||
char *ret =
|
||||
(char *) pg_do_encoding_conversion((unsigned char *) str, strlen(str),
|
||||
GetDatabaseEncoding(), PG_UTF8);
|
||||
(char *) pg_do_encoding_conversion((unsigned char *) str, strlen(str),
|
||||
GetDatabaseEncoding(), PG_UTF8);
|
||||
|
||||
if (ret == str)
|
||||
ret = pstrdup(ret);
|
||||
@ -89,8 +89,8 @@ sv2cstr(SV *sv)
|
||||
|
||||
/*
|
||||
* Request the string from Perl, in UTF-8 encoding; but if we're in a
|
||||
* SQL_ASCII database, just request the byte soup without trying to make it
|
||||
* UTF8, because that might fail.
|
||||
* SQL_ASCII database, just request the byte soup without trying to make
|
||||
* it UTF8, because that might fail.
|
||||
*/
|
||||
if (GetDatabaseEncoding() == PG_SQL_ASCII)
|
||||
val = SvPV(sv, len);
|
||||
|
@ -528,7 +528,8 @@ plpgsql_scanner_errposition(int location)
|
||||
* Beware of using yyerror for other purposes, as the cursor position might
|
||||
* be misleading!
|
||||
*/
|
||||
void __attribute__((noreturn))
|
||||
void
|
||||
__attribute__((noreturn))
|
||||
plpgsql_yyerror(const char *message)
|
||||
{
|
||||
char *yytext = core_yy.scanbuf + plpgsql_yylloc;
|
||||
|
@ -932,7 +932,7 @@ extern Datum plpgsql_exec_function(PLpgSQL_function *func,
|
||||
extern HeapTuple plpgsql_exec_trigger(PLpgSQL_function *func,
|
||||
TriggerData *trigdata);
|
||||
extern void plpgsql_exec_event_trigger(PLpgSQL_function *func,
|
||||
EventTriggerData *trigdata);
|
||||
EventTriggerData *trigdata);
|
||||
extern void plpgsql_xact_cb(XactEvent event, void *arg);
|
||||
extern void plpgsql_subxact_cb(SubXactEvent event, SubTransactionId mySubid,
|
||||
SubTransactionId parentSubid, void *arg);
|
||||
|
@ -342,8 +342,8 @@ PLy_traceback(char **xmsg, char **tbmsg, int *tb_depth)
|
||||
static void
|
||||
PLy_get_spi_sqlerrcode(PyObject *exc, int *sqlerrcode)
|
||||
{
|
||||
PyObject *sqlstate;
|
||||
char *buffer;
|
||||
PyObject *sqlstate;
|
||||
char *buffer;
|
||||
|
||||
sqlstate = PyObject_GetAttrString(exc, "sqlstate");
|
||||
if (sqlstate == NULL)
|
||||
|
@ -61,8 +61,10 @@ PLy_free(void *ptr)
|
||||
PyObject *
|
||||
PLyUnicode_Bytes(PyObject *unicode)
|
||||
{
|
||||
PyObject *bytes, *rv;
|
||||
char *utf8string, *encoded;
|
||||
PyObject *bytes,
|
||||
*rv;
|
||||
char *utf8string,
|
||||
*encoded;
|
||||
|
||||
/* First encode the Python unicode object with UTF-8. */
|
||||
bytes = PyUnicode_AsUTF8String(unicode);
|
||||
@ -70,7 +72,8 @@ PLyUnicode_Bytes(PyObject *unicode)
|
||||
PLy_elog(ERROR, "could not convert Python Unicode object to bytes");
|
||||
|
||||
utf8string = PyBytes_AsString(bytes);
|
||||
if (utf8string == NULL) {
|
||||
if (utf8string == NULL)
|
||||
{
|
||||
Py_DECREF(bytes);
|
||||
PLy_elog(ERROR, "could not extract bytes from encoded string");
|
||||
}
|
||||
@ -88,10 +91,10 @@ PLyUnicode_Bytes(PyObject *unicode)
|
||||
PG_TRY();
|
||||
{
|
||||
encoded = (char *) pg_do_encoding_conversion(
|
||||
(unsigned char *) utf8string,
|
||||
strlen(utf8string),
|
||||
PG_UTF8,
|
||||
GetDatabaseEncoding());
|
||||
(unsigned char *) utf8string,
|
||||
strlen(utf8string),
|
||||
PG_UTF8,
|
||||
GetDatabaseEncoding());
|
||||
}
|
||||
PG_CATCH();
|
||||
{
|
||||
|
Reference in New Issue
Block a user