diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2013-11-10 09:20:52 -0500 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2013-11-10 14:48:29 -0500 |
commit | 001e114b8d59f4eaf2a314a2bc5e57078afdf82f (patch) | |
tree | 606fa622be346ef917886a29aea7e17383e00d31 /src/backend/utils/adt/json.c | |
parent | dca09ac53329e92d73f45674957c26d3d7ae5117 (diff) | |
download | postgresql-001e114b8d59f4eaf2a314a2bc5e57078afdf82f.tar.gz postgresql-001e114b8d59f4eaf2a314a2bc5e57078afdf82f.zip |
Fix whitespace issues found by git diff --check, add gitattributes
Set per file type attributes in .gitattributes to fine-tune whitespace
checks. With the associated cleanups, the tree is now clean for git
Diffstat (limited to 'src/backend/utils/adt/json.c')
-rw-r--r-- | src/backend/utils/adt/json.c | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/src/backend/utils/adt/json.c b/src/backend/utils/adt/json.c index 7685410f185..d8ebf4e0029 100644 --- a/src/backend/utils/adt/json.c +++ b/src/backend/utils/adt/json.c @@ -1786,7 +1786,7 @@ escape_json(StringInfo buf, const char *str) * * Returns the type of the outermost JSON value as TEXT. Possible types are * "object", "array", "string", "number", "boolean", and "null". - * + * * Performs a single call to json_lex() to get the first token of the supplied * value. This initial token uniquely determines the value's type. As our * input must already have been validated by json_in() or json_recv(), the @@ -1796,39 +1796,39 @@ escape_json(StringInfo buf, const char *str) Datum json_typeof(PG_FUNCTION_ARGS) { - text *json = PG_GETARG_TEXT_P(0); - - JsonLexContext *lex = makeJsonLexContext(json, false); - JsonTokenType tok; - char *type; - - /* Lex exactly one token from the input and check its type. */ - json_lex(lex); - tok = lex_peek(lex); - switch (tok) - { - case JSON_TOKEN_OBJECT_START: - type = "object"; - break; - case JSON_TOKEN_ARRAY_START: - type = "array"; - break; - case JSON_TOKEN_STRING: - type = "string"; - break; - case JSON_TOKEN_NUMBER: - type = "number"; - break; - case JSON_TOKEN_TRUE: - case JSON_TOKEN_FALSE: - type = "boolean"; - break; - case JSON_TOKEN_NULL: - type = "null"; - break; - default: - elog(ERROR, "unexpected json token: %d", tok); - } - - PG_RETURN_TEXT_P(cstring_to_text(type)); + text *json = PG_GETARG_TEXT_P(0); + + JsonLexContext *lex = makeJsonLexContext(json, false); + JsonTokenType tok; + char *type; + + /* Lex exactly one token from the input and check its type. */ + json_lex(lex); + tok = lex_peek(lex); + switch (tok) + { + case JSON_TOKEN_OBJECT_START: + type = "object"; + break; + case JSON_TOKEN_ARRAY_START: + type = "array"; + break; + case JSON_TOKEN_STRING: + type = "string"; + break; + case JSON_TOKEN_NUMBER: + type = "number"; + break; + case JSON_TOKEN_TRUE: + case JSON_TOKEN_FALSE: + type = "boolean"; + break; + case JSON_TOKEN_NULL: + type = "null"; + break; + default: + elog(ERROR, "unexpected json token: %d", tok); + } + + PG_RETURN_TEXT_P(cstring_to_text(type)); } |