aboutsummaryrefslogtreecommitdiff
path: root/src/pl/plperl/plperl_helpers.h
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2012-06-10 15:20:04 -0400
committerBruce Momjian <bruce@momjian.us>2012-06-10 15:20:04 -0400
commit927d61eeff78363ea3938c818d07e511ebaf75cf (patch)
tree2f0bcecf53327f76272a8ce690fa62505520fab9 /src/pl/plperl/plperl_helpers.h
parent60801944fa105252b48ea5688d47dfc05c695042 (diff)
downloadpostgresql-927d61eeff78363ea3938c818d07e511ebaf75cf.tar.gz
postgresql-927d61eeff78363ea3938c818d07e511ebaf75cf.zip
Run pgindent on 9.2 source tree in preparation for first 9.3
commit-fest.
Diffstat (limited to 'src/pl/plperl/plperl_helpers.h')
-rw-r--r--src/pl/plperl/plperl_helpers.h28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/pl/plperl/plperl_helpers.h b/src/pl/plperl/plperl_helpers.h
index 6b714e52a14..1b6648be1d1 100644
--- a/src/pl/plperl/plperl_helpers.h
+++ b/src/pl/plperl/plperl_helpers.h
@@ -7,15 +7,15 @@
static inline char *
utf_u2e(const char *utf8_str, size_t len)
{
- int enc = GetDatabaseEncoding();
+ int enc = GetDatabaseEncoding();
char *ret = (char *) pg_do_encoding_conversion((unsigned char *) utf8_str, len, PG_UTF8, enc);
/*
- * when we are a PG_UTF8 or SQL_ASCII database
- * pg_do_encoding_conversion() will not do any conversion or
- * verification. we need to do it manually instead.
- */
+ * when we are a PG_UTF8 or SQL_ASCII database pg_do_encoding_conversion()
+ * will not do any conversion or verification. we need to do it manually
+ * instead.
+ */
if (enc == PG_UTF8 || enc == PG_SQL_ASCII)
pg_verify_mbstr_len(PG_UTF8, utf8_str, len, false);
@@ -45,7 +45,8 @@ utf_e2u(const char *str)
static inline char *
sv2cstr(SV *sv)
{
- char *val, *res;
+ char *val,
+ *res;
STRLEN len;
/*
@@ -54,23 +55,26 @@ sv2cstr(SV *sv)
* SvPVutf8() croaks nastily on certain things, like typeglobs and
* readonly objects such as $^V. That's a perl bug - it's not supposed to
* happen. To avoid crashing the backend, we make a copy of the sv before
- * passing it to SvPVutf8(). The copy is garbage collected
- * when we're done with it.
+ * passing it to SvPVutf8(). The copy is garbage collected when we're done
+ * with it.
*/
if (SvREADONLY(sv) ||
isGV_with_GP(sv) ||
(SvTYPE(sv) > SVt_PVLV && SvTYPE(sv) != SVt_PVFM))
sv = newSVsv(sv);
else
- /* increase the reference count so we can just SvREFCNT_dec() it when
- * we are done */
+
+ /*
+ * increase the reference count so we can just SvREFCNT_dec() it when
+ * we are done
+ */
SvREFCNT_inc_simple_void(sv);
val = SvPVutf8(sv, len);
/*
- * we use perl's length in the event we had an embedded null byte to ensure
- * we error out properly
+ * we use perl's length in the event we had an embedded null byte to
+ * ensure we error out properly
*/
res = utf_u2e(val, len);