1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-17 17:02:08 +03:00

Reindent json.c and jsonfuncs.c.

This will help in preparation of clean patches for upcoming
json work.
This commit is contained in:
Andrew Dunstan
2014-01-22 08:46:51 -05:00
parent 6c36f383df
commit 243ee26633
2 changed files with 45 additions and 42 deletions

View File

@ -751,11 +751,12 @@ json_lex_string(JsonLexContext *lex)
report_json_context(lex))); report_json_context(lex)));
/* /*
* For UTF8, replace the escape sequence by the actual utf8 * For UTF8, replace the escape sequence by the actual
* character in lex->strval. Do this also for other encodings * utf8 character in lex->strval. Do this also for other
* if the escape designates an ASCII character, otherwise * encodings if the escape designates an ASCII character,
* raise an error. We don't ever unescape a \u0000, since that * otherwise raise an error. We don't ever unescape a
* would result in an impermissible nul byte. * \u0000, since that would result in an impermissible nul
* byte.
*/ */
if (ch == 0) if (ch == 0)
@ -771,8 +772,9 @@ json_lex_string(JsonLexContext *lex)
else if (ch <= 0x007f) else if (ch <= 0x007f)
{ {
/* /*
* This is the only way to designate things like a form feed * This is the only way to designate things like a
* character in JSON, so it's useful in all encodings. * form feed character in JSON, so it's useful in all
* encodings.
*/ */
appendStringInfoChar(lex->strval, (char) ch); appendStringInfoChar(lex->strval, (char) ch);
} }
@ -1246,6 +1248,7 @@ datum_to_json(Datum val, bool is_null, StringInfo result,
break; break;
case TYPCATEGORY_NUMERIC: case TYPCATEGORY_NUMERIC:
outputstr = OidOutputFunctionCall(typoutputfunc, val); outputstr = OidOutputFunctionCall(typoutputfunc, val);
/* /*
* Don't call escape_json here if it's a valid JSON number. * Don't call escape_json here if it's a valid JSON number.
*/ */