]> git.ipfire.org Git - thirdparty/json-c.git/commitdiff
Fix typos in code comments and ChangeLog 746/head
authorEven Rouault <even.rouault@spatialys.com>
Thu, 24 Feb 2022 23:14:47 +0000 (00:14 +0100)
committerEven Rouault <even.rouault@spatialys.com>
Thu, 24 Feb 2022 23:14:47 +0000 (00:14 +0100)
ChangeLog
json_object.h
json_tokener.c
linkhash.c
linkhash.h

index 1c562b7d4f0e84f82c6b06a7cfaddbfaa30baafd..8877631623c3512893a081628649ce82b2abb6fd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -73,7 +73,7 @@ Other changes
 * #589 - Detect broken RDRAND during initialization; also, fix segfault
     in the CPUID check.
 * #592 - Fix integer overflows to prevert out of bounds write on large input.
-* Protect against division by zero in linkhash, when creaed with zero size.
+* Protect against division by zero in linkhash, when created with zero size.
 * #602 - Fix json_parse_uint64() internal error checking, leaving the retval
     untouched in more failure cases.
 * #614 - Prevent truncation when custom double formatters insert extra \0's
@@ -199,7 +199,7 @@ Behavior changes:
 * Use size_t for array length and size.  Platforms where sizeof(size_t) != sizeof(int) may not be backwards compatible
        See commits 45c56b, 92e9a5 and others.
 
-* Check for failue when allocating memory, returning NULL and errno=ENOMEM.
+* Check for failure when allocating memory, returning NULL and errno=ENOMEM.
         See commit 2149a04.
 
 * Change json_object_object_add() return type from void to int, and will return -1 on failures, instead of exiting. (Note: this is not an ABI change)
@@ -390,7 +390,7 @@ List of new functions added:
   * Add an alternative iterator implementation, see json_object_iterator.h
   * Make json_object_iter public to enable external use of the
      json_object_object_foreachC macro.
-  * Add a printbuf_memset() function to provide an effecient way to set and
+  * Add a printbuf_memset() function to provide an efficient way to set and
      append things like whitespace indentation.
   * Adjust json_object_is_type and json_object_get_type so they return
       json_type_null for NULL objects and handle NULL passed to
@@ -476,7 +476,7 @@ List of new functions added:
 0.7
 ===
   * Add escaping of backslash to json output
-  * Add escaping of foward slash on tokenizing and output
+  * Add escaping of forward slash on tokenizing and output
   * Changes to internal tokenizer from using recursion to
     using a depth state structure to allow incremental parsing
 
index 0f779a52b0f05e53e3b1c4b4505c33db88aa829f..5203a67e0ff9fbe2a409c1ce8c47a330ec49d2ce 100644 (file)
@@ -139,7 +139,7 @@ extern "C" {
  *    beyond the lifetime of the parent object.
  * - Detaching an object field or array index from its parent object
  *    (using `json_object_object_del()` or `json_object_array_del_idx()`)
- * - Sharing a json_object with multiple (not necesarily parallel) threads
+ * - Sharing a json_object with multiple (not necessarily parallel) threads
  *    of execution that all expect to free it (with `json_object_put()`) when
  *    they're done.
  *
@@ -747,7 +747,7 @@ JSON_EXPORT int json_object_set_int(struct json_object *obj, int new_value);
  *
  * @param obj the json_object instance
  * @param val the value to add
- * @returns 1 if the increment succeded, 0 otherwise
+ * @returns 1 if the increment succeeded, 0 otherwise
  */
 JSON_EXPORT int json_object_int_inc(struct json_object *obj, int64_t val);
 
@@ -1064,7 +1064,7 @@ JSON_EXPORT json_c_shallow_copy_fn json_c_shallow_copy_default;
  *                     when custom serializers are in use.  See also
  *                     json_object set_serializer.
  *
- * @returns 0 if the copy went well, -1 if an error occured during copy
+ * @returns 0 if the copy went well, -1 if an error occurred during copy
  *          or if the destination pointer is non-NULL
  */
 
index 4a25645dd7030e4494a5205a0365d6c9c92cff79..160cde496583e126d33d9ed5bbe0007ca8f033d9 100644 (file)
@@ -746,7 +746,7 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
                                 * we can't simply peek ahead here, because the
                                 * characters we need might not be passed to us
                                 * until a subsequent call to json_tokener_parse.
-                                * Instead, transition throug a couple of states.
+                                * Instead, transition through a couple of states.
                                 * (now):
                                 *   _escape_unicode => _unicode_need_escape
                                 * (see a '\\' char):
index d2f2b1bc326be93077232f37df782968dd13070c..6105160c758bc72e6ceb8286a2a68e09be2f6956 100644 (file)
@@ -285,7 +285,7 @@ static uint32_t hashlittle(const void *key, size_t length, uint32_t initval)
                 * rest of the string.  Every machine with memory protection I've seen
                 * does it on word boundaries, so is OK with this.  But VALGRIND will
                 * still catch it and complain.  The masking trick does make the hash
-                * noticably faster for short strings (like English words).
+                * noticeably faster for short strings (like English words).
                 * AddressSanitizer is similarly picky about overrunning
                 * the buffer. (http://clang.llvm.org/docs/AddressSanitizer.html
                 */
@@ -439,7 +439,7 @@ static uint32_t hashlittle(const void *key, size_t length, uint32_t initval)
 }
 /* clang-format on */
 
-/* a simple hash function similiar to what perl does for strings.
+/* a simple hash function similar to what perl does for strings.
  * for good results, the string should not be excessivly large.
  */
 static unsigned long lh_perllike_str_hash(const void *k)
@@ -465,7 +465,7 @@ static unsigned long lh_char_hash(const void *k)
        if (random_seed == -1)
        {
                RANDOM_SEED_TYPE seed;
-               /* we can't use -1 as it is the unitialized sentinel */
+               /* we can't use -1 as it is the uninitialized sentinel */
                while ((seed = json_c_get_random_seed()) == -1) {}
 #if SIZEOF_INT == 8 && defined __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
 #define USE_SYNC_COMPARE_AND_SWAP 1
index cb6e3b425f55c774c1954c0b9432defbffc4a98e..5e5e240822a1f8312072452243a5926cadbd5c4d 100644 (file)
@@ -353,7 +353,7 @@ static _LH_INLINE struct lh_entry *lh_table_head(const lh_table *t)
 /**
  * Calculate the hash of a key for a given table.
  *
- * This is an exension to support functions that need to calculate
+ * This is an extension to support functions that need to calculate
  * the hash several times and allows them to do it just once and then pass
  * in the hash to all utility functions. Depending on use case, this can be a
  * considerable performance improvement.