Skip to content

Commit 3bb54f9

Browse files
committed
Fix typos in code comments and ChangeLog
1 parent 66cce0a commit 3bb54f9

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

ChangeLog

+4-4
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Other changes
7373
* #589 - Detect broken RDRAND during initialization; also, fix segfault
7474
in the CPUID check.
7575
* #592 - Fix integer overflows to prevert out of bounds write on large input.
76-
* Protect against division by zero in linkhash, when creaed with zero size.
76+
* Protect against division by zero in linkhash, when created with zero size.
7777
* #602 - Fix json_parse_uint64() internal error checking, leaving the retval
7878
untouched in more failure cases.
7979
* #614 - Prevent truncation when custom double formatters insert extra \0's
@@ -199,7 +199,7 @@ Behavior changes:
199199
* Use size_t for array length and size. Platforms where sizeof(size_t) != sizeof(int) may not be backwards compatible
200200
See commits 45c56b, 92e9a5 and others.
201201

202-
* Check for failue when allocating memory, returning NULL and errno=ENOMEM.
202+
* Check for failure when allocating memory, returning NULL and errno=ENOMEM.
203203
See commit 2149a04.
204204

205205
* 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:
390390
* Add an alternative iterator implementation, see json_object_iterator.h
391391
* Make json_object_iter public to enable external use of the
392392
json_object_object_foreachC macro.
393-
* Add a printbuf_memset() function to provide an effecient way to set and
393+
* Add a printbuf_memset() function to provide an efficient way to set and
394394
append things like whitespace indentation.
395395
* Adjust json_object_is_type and json_object_get_type so they return
396396
json_type_null for NULL objects and handle NULL passed to
@@ -476,7 +476,7 @@ List of new functions added:
476476
0.7
477477
===
478478
* Add escaping of backslash to json output
479-
* Add escaping of foward slash on tokenizing and output
479+
* Add escaping of forward slash on tokenizing and output
480480
* Changes to internal tokenizer from using recursion to
481481
using a depth state structure to allow incremental parsing
482482

json_object.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ extern "C" {
139139
* beyond the lifetime of the parent object.
140140
* - Detaching an object field or array index from its parent object
141141
* (using `json_object_object_del()` or `json_object_array_del_idx()`)
142-
* - Sharing a json_object with multiple (not necesarily parallel) threads
142+
* - Sharing a json_object with multiple (not necessarily parallel) threads
143143
* of execution that all expect to free it (with `json_object_put()`) when
144144
* they're done.
145145
*
@@ -747,7 +747,7 @@ JSON_EXPORT int json_object_set_int(struct json_object *obj, int new_value);
747747
*
748748
* @param obj the json_object instance
749749
* @param val the value to add
750-
* @returns 1 if the increment succeded, 0 otherwise
750+
* @returns 1 if the increment succeeded, 0 otherwise
751751
*/
752752
JSON_EXPORT int json_object_int_inc(struct json_object *obj, int64_t val);
753753

@@ -1064,7 +1064,7 @@ JSON_EXPORT json_c_shallow_copy_fn json_c_shallow_copy_default;
10641064
* when custom serializers are in use. See also
10651065
* json_object set_serializer.
10661066
*
1067-
* @returns 0 if the copy went well, -1 if an error occured during copy
1067+
* @returns 0 if the copy went well, -1 if an error occurred during copy
10681068
* or if the destination pointer is non-NULL
10691069
*/
10701070

json_tokener.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
746746
* we can't simply peek ahead here, because the
747747
* characters we need might not be passed to us
748748
* until a subsequent call to json_tokener_parse.
749-
* Instead, transition throug a couple of states.
749+
* Instead, transition through a couple of states.
750750
* (now):
751751
* _escape_unicode => _unicode_need_escape
752752
* (see a '\\' char):

linkhash.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ static uint32_t hashlittle(const void *key, size_t length, uint32_t initval)
285285
* rest of the string. Every machine with memory protection I've seen
286286
* does it on word boundaries, so is OK with this. But VALGRIND will
287287
* still catch it and complain. The masking trick does make the hash
288-
* noticably faster for short strings (like English words).
288+
* noticeably faster for short strings (like English words).
289289
* AddressSanitizer is similarly picky about overrunning
290290
* the buffer. (http://clang.llvm.org/docs/AddressSanitizer.html
291291
*/
@@ -439,7 +439,7 @@ static uint32_t hashlittle(const void *key, size_t length, uint32_t initval)
439439
}
440440
/* clang-format on */
441441

442-
/* a simple hash function similiar to what perl does for strings.
442+
/* a simple hash function similar to what perl does for strings.
443443
* for good results, the string should not be excessivly large.
444444
*/
445445
static unsigned long lh_perllike_str_hash(const void *k)
@@ -465,7 +465,7 @@ static unsigned long lh_char_hash(const void *k)
465465
if (random_seed == -1)
466466
{
467467
RANDOM_SEED_TYPE seed;
468-
/* we can't use -1 as it is the unitialized sentinel */
468+
/* we can't use -1 as it is the uninitialized sentinel */
469469
while ((seed = json_c_get_random_seed()) == -1) {}
470470
#if SIZEOF_INT == 8 && defined __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
471471
#define USE_SYNC_COMPARE_AND_SWAP 1

linkhash.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ static _LH_INLINE struct lh_entry *lh_table_head(const lh_table *t)
353353
/**
354354
* Calculate the hash of a key for a given table.
355355
*
356-
* This is an exension to support functions that need to calculate
356+
* This is an extension to support functions that need to calculate
357357
* the hash several times and allows them to do it just once and then pass
358358
* in the hash to all utility functions. Depending on use case, this can be a
359359
* considerable performance improvement.

0 commit comments

Comments
 (0)