Some simple typo/formatting fixes.
authorAndres Freund <[email protected]>
Wed, 19 Mar 2014 16:14:54 +0000 (17:14 +0100)
committerAndres Freund <[email protected]>
Wed, 19 Mar 2014 16:14:54 +0000 (17:14 +0100)
src/backend/utils/adt/jsonb.c
src/backend/utils/adt/jsonb_util.c
src/include/utils/jsonb.h

index dc84a68eab1fd7cc92bf0177ed6207facf6cdbe0..c9e6cd121095febf8c9d102e26a167e4254ea4ab 100644 (file)
@@ -48,7 +48,7 @@ jsonb_in(PG_FUNCTION_ARGS)
 /*
  * jsonb type recv function
  *
- * the type is sent as text in binary mode, so this is almost the same
+ * The type is sent as text in binary mode, so this is almost the same
  * as the input function, but it's prefixed with a version number so we
  * can change the binary format sent in future if necessary. For now,
  * only version 1 is supported.
@@ -136,7 +136,6 @@ jsonb_typeof(PG_FUNCTION_ARGS)
         * array and then its first (and only) member.
         */
        (void) JsonbIteratorNext(&it, &v, true);
-       (void) JsonbIteratorNext(&it, &v, true);
        switch (v.type)
        {
            case jbvNull:
@@ -360,8 +359,11 @@ jsonb_in_scalar(void *state, char *token, JsonTokenType tokentype)
 
 /*
  * JsonbToCString
- *    Converts jsonb value in C-string. If out argument is not null
- * then resulting C-string is placed in it. Return pointer to string.
+ *    Converts jsonb value to a C-string.
+ *
+ * If the out argument is nonnull, the resulting C-string is stored inside the
+ * stringuffer. The resulting string is always returned.
+ *
  * A typical case for passing the StringInfo in rather than NULL is where
  * the caller wants access to the len attribute without having to call
  * strlen, e.g. if they are converting it to a text* object.
index 6e45031de799181d677ce99acb0142432ed5c01e..cf326f85041f379d4a3253b67be7927bf94e7339 100644 (file)
@@ -1,6 +1,6 @@
 /*-------------------------------------------------------------------------
  *
- * jsonb_support.c
+ * jsonb_util.c
  *   Support functions for jsonb
  *
  * Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group
@@ -247,8 +247,8 @@ compareJsonbSuperHeaderValue(JsonbSuperHeader a, JsonbSuperHeader b)
  * Find value in object (i.e. the "value" part of some key/value pair in an
  * object), or find a matching element if we're looking through an array.  Do
  * so on the basis of equality of the object keys only, or alternatively
- * element values only, with a caller-supplied value "key".  "flags" argument
- * allows caller to specify which container types are of interest.
+ * element values only, with a caller-supplied value "key". The "flags" argument
+ * allows the caller to specify which container types are of interest.
  *
  * This exported utility function exists to facilitate various cases concerned
  * with "containment".  If asked to look through an object, the caller had
@@ -273,7 +273,7 @@ compareJsonbSuperHeaderValue(JsonbSuperHeader a, JsonbSuperHeader b)
  * definition of containment.
  *
  * If the caller asks to look through a container type that is not of the type
- * pointer to by the superheader, immediately fall through and return NULL.  If
+ * pointed to by the superheader, immediately fall through and return NULL.  If
  * we cannot find the value, return NULL.  Otherwise, return palloc()'d copy of
  * value.
  */
@@ -610,10 +610,11 @@ JsonbIteratorInit(JsonbSuperHeader sheader)
  * early (by breaking upon having found something in a search, for example).
  *
  * Callers in such a scenario, that are particularly sensitive to leaking
- * memory in a long-lived context may walk the ancestral tree from the final
+ * memory in a long-lived context, may walk the ancestral tree from the final
  * iterator we left them with to its oldest ancestor, pfree()ing as they go.
  * They can depend on having any other memory previously allocated for
- * iterators but not in that line having already been freed here.
+ * iterators but not in that line having already been freed here FIXME: unclear
+ * sentence.
  *
  * Returns "Jsonb binary token" value.  Iterator "state" reflects the current
  * stage of the process in a less granular fashion, and is mostly used here to
index 48efba85088c969ee173ece20370d61cecc04283..ae45beea128bfc9be49e33190d1fc4b357bb36f6 100644 (file)
@@ -161,7 +161,7 @@ struct JsonbValue
 
    union
    {
-       Numeric numeric;
+       Numeric     numeric;
        bool        boolean;
        struct
        {