Fix typos in documentation, comments, etc. Via codespell. Signed-off-by: Andrew Kreimer <algonell@xxxxxxxxx> --- README | 2 +- cgcc | 2 +- check_host_input.c | 12 ++++++------ check_preempt.c | 2 +- cse.c | 4 ++-- cwchash/hashtable.c | 2 +- evaluate.c | 4 ++-- expand.c | 2 +- flow.c | 4 ++-- lib.c | 2 +- linearize.c | 2 +- opcode.def | 2 +- pre-process.c | 4 ++-- simplify.c | 4 ++-- unssa.c | 2 +- utils.h | 2 +- validation/bool-array.c | 2 +- 17 files changed, 27 insertions(+), 27 deletions(-) diff --git a/README b/README index b099dae9..18dbabdd 100644 --- a/README +++ b/README @@ -63,7 +63,7 @@ more requirements. The user is free to do whatever he wants with the parse tree that got built up, and needs not worry about the library ever again. There is no extra state, there are no parser callbacks, there is only the parse tree that is described by the header files. The action -funtion takes a pointer to a symbol_list and does whatever it likes with it. +function takes a pointer to a symbol_list and does whatever it likes with it. The library also contains (as an example user) a few clients that do the preprocessing, parsing and type evaluation and just print out the diff --git a/cgcc b/cgcc index d18aea8f..e1c31a2c 100755 --- a/cgcc +++ b/cgcc @@ -37,7 +37,7 @@ while (@ARGV) { if (/^-(o|MF|MT|MQ)$/) { # Need to be checked explicitly since otherwise # the argument would be processed as a - # (non-existant) source file or as an option. + # (non-existent) source file or as an option. die ("$0: missing argument for $_") if !@ARGV; $nargs = 1; } diff --git a/check_host_input.c b/check_host_input.c index 80bcb581..861899e9 100644 --- a/check_host_input.c +++ b/check_host_input.c @@ -7,7 +7,7 @@ * sure the code that handles processing of such values is hardened, * free of memory safety issues and other potential security issues. * - * This smatch pattern helps to indentify such places. + * This smatch pattern helps to identify such places. * Currently it covers most of MSR, portIO, MMIO, PCI config space * and cpuid reading primitives. * The full list of covered functions is stored in host_input_funcs array. @@ -77,9 +77,9 @@ unsigned long produce_expression_hash(struct expression *expr) int line_offset = get_lineno() - get_func_start_lineno(get_function()); const char *str = expr_to_str(expr); - /* for non-parsable exressions and expressions - * contatining temp variables (like __UNIQUE_ID_*, $expr_), it is - * more stable to use a fix string for hasing together + /* for non-parsable expressions and expressions + * containing temp variables (like __UNIQUE_ID_*, $expr_), it is + * more stable to use a fix string for hashing together * with line offset to avoid many results that do not * automatically transfer between the audits on different * versions */ @@ -196,7 +196,7 @@ bool is_tmp_expression(struct expression *expr) return false; } -/* Checks assigment expressions */ +/* Checks assignment expressions */ static void match_assign(struct expression *expr) { struct expression *current = expr; @@ -213,7 +213,7 @@ static void match_assign(struct expression *expr) return; if (current->type != EXPR_ASSIGNMENT) { - sm_error("'%s' Strange EXPR in assigment;", pattern_name); + sm_error("'%s' Strange EXPR in assignment;", pattern_name); return; } diff --git a/check_preempt.c b/check_preempt.c index 1068431f..c29402cd 100644 --- a/check_preempt.c +++ b/check_preempt.c @@ -31,7 +31,7 @@ * If during the course of parsing the call, the preempt count gets out of * sync on one side of a branch statement, then we assume the lower preempt * count is correct. (In other words, we choose to miss some bugs rather - * than add false postives). + * than add false positives). */ #include "smatch.h" diff --git a/cse.c b/cse.c index b5958181..b22e2acc 100644 --- a/cse.c +++ b/cse.c @@ -246,11 +246,11 @@ static int insn_compare(const void *_i1, const void *_i2) if (i1->src != i2->src) return i1->src < i2->src ? -1 : 1; - // Note: if it can be guaranted that identical ->src + // Note: if it can be guaranteed that identical ->src // implies identical orig_type->bit_size, then this // test and the hashing of the original size in // cse_collect() are not needed. - // It must be generaly true but it isn't guaranted (yet). + // It must be generally true but it isn't guaranteed (yet). size1 = i1->orig_type->bit_size; size2 = i2->orig_type->bit_size; if (size1 != size2) diff --git a/cwchash/hashtable.c b/cwchash/hashtable.c index 763357ed..494fb419 100644 --- a/cwchash/hashtable.c +++ b/cwchash/hashtable.c @@ -70,7 +70,7 @@ hash(struct hashtable *h, void *k) static int hashtable_expand(struct hashtable *h) { - /* Double the size of the table to accomodate more entries */ + /* Double the size of the table to accommodate more entries */ struct entry **newtable; struct entry *e; struct entry **pE; diff --git a/evaluate.c b/evaluate.c index 6c930e8d..b060c179 100644 --- a/evaluate.c +++ b/evaluate.c @@ -583,7 +583,7 @@ static struct symbol *evaluate_ptr_add(struct expression *expr, struct symbol *i return NULL; } if (is_function(base)) { - expression_error(expr, "arithmetics on pointers to functions"); + expression_error(expr, "arithmetic on pointers to functions"); return NULL; } @@ -1166,7 +1166,7 @@ static struct symbol *evaluate_conditional_expression(struct expression *expr) * Consider a conditional expression with a constant condition * as having the same constantness as the argument corresponding * to the truth value (including in the case of address constants - * which are defined more stricly [6.6(9)]). + * which are defined more strictly [6.6(9)]). */ if (expr->conditional->flags & (CEF_ACE | CEF_ADDR)) { int is_true = expr_truth_value(expr->conditional); diff --git a/expand.c b/expand.c index 3b4ad403..a109ae0f 100644 --- a/expand.c +++ b/expand.c @@ -608,7 +608,7 @@ static int expand_addressof(struct expression *expr) } /// -// lookup the type of a struct's memeber at the requested offset +// lookup the type of a struct's member at the requested offset static struct symbol *find_member(struct symbol *sym, int offset) { struct ptr_list *head, *list; diff --git a/flow.c b/flow.c index 48755501..0aa8ba54 100644 --- a/flow.c +++ b/flow.c @@ -484,7 +484,7 @@ int dominates(struct instruction *insn, struct instruction *dom, int local) // * the stores are only needed by others functions which would do some // loads via the escaped address // We start by the terminating BB (normal exit BB + no-return/unreachable) -// We walkup the BB' intruction backward +// We walkup the BB' instruction backward // * we're only concerned by loads, stores & calls // * if we reach a call -> we have to stop if var is non-local // * if we reach a load of our var -> we have to stop @@ -815,7 +815,7 @@ int convert_to_jump(struct instruction *insn, struct basic_block *target) FOR_EACH_PTR(bb->children, child) { if (child == target) { - target = NULL; // leave first occurence + target = NULL; // leave first occurrence continue; } DELETE_CURRENT_PTR(child); diff --git a/lib.c b/lib.c index b6f41a7f..97a0b242 100644 --- a/lib.c +++ b/lib.c @@ -444,7 +444,7 @@ struct symbol_list *sparse_initialize(int argc, char **argv, struct string_list * Evaluate the complete symbol list * Note: This is not needed for normal cases. * These symbols should only be predefined defines and - * declaratons which will be evaluated later, when needed. + * declarations which will be evaluated later, when needed. * This is also the case when a file is directly included via * '-include <file>' on the command line *AND* the file only * contains defines, declarations and inline definitions. diff --git a/linearize.c b/linearize.c index 1db2d505..84ff2ca9 100644 --- a/linearize.c +++ b/linearize.c @@ -1969,7 +1969,7 @@ static pseudo_t linearize_one_symbol(struct entrypoint *ep, struct symbol *sym) // FIXME: this init the whole aggregate while // only the existing fields need to be initialized. // FIXME: this init the whole aggregate even if - // all fields arelater explicitely initialized. + // all fields are later explicitly initialized. ad.type = sym; ad.address = symbol_pseudo(ep, sym); linearize_store_gen(ep, value_pseudo(0), &ad); diff --git a/opcode.def b/opcode.def index ba757dae..dfccc9b1 100644 --- a/opcode.def +++ b/opcode.def @@ -1,4 +1,4 @@ -// OPCODE negated swaped sign float arity, flags +// OPCODE negated swapped sign float arity, flags OPCODE(BADOP, BADOP, BADOP, BADOP, BADOP, 0, OPF_NONE) diff --git a/pre-process.c b/pre-process.c index 05a5a793..8b6f4d9c 100644 --- a/pre-process.c +++ b/pre-process.c @@ -1536,7 +1536,7 @@ out: // @weak: 0/1 for a normal or a weak define // @fmt: the printf format followed by it's arguments. // -// The type of the value is automatically infered: +// The type of the value is automatically inferred: // TOKEN_NUMBER if it starts by a digit, TOKEN_IDENT otherwise. // If @fmt is null or empty, the macro is defined with an empty definition. void predefine(const char *name, int weak, const char *fmt, ...) @@ -1930,7 +1930,7 @@ static inline void update_inc_ptrs(const char ***where) } /* angle_includepath is actually never updated, since we - * don't suppport -iquote rught now. May change some day. */ + * don't support -iquote rught now. May change some day. */ if (*where <= angle_includepath) { angle_includepath++; if (where == &angle_includepath) diff --git a/simplify.c b/simplify.c index 3c4ace3c..39ea6fd6 100644 --- a/simplify.c +++ b/simplify.c @@ -10,7 +10,7 @@ // // Notation // ^^^^^^^^ -// The following conventions are used to describe the simplications: +// The following conventions are used to describe the simplifications: // * Uppercase letters are reserved for constants: // * `M` for a constant mask, // * `S` for a constant shift, @@ -31,7 +31,7 @@ // * `ZEXT(x, N)` is used for a zero-extension *from* a size of `N` bits // * `OP(x, C)` is used to represent some generic operation using a constant, // including when the constant is implicit (e.g. `TRUNC(x, N)`). -// * `MASK(x, M)` is used to respresent a 'masking' instruction: +// * `MASK(x, M)` is used to represent a 'masking' instruction: // - `AND(x, M)` // - `LSR(x, S)`, with `M` = (-1 << S) // - `SHL(x, S)`, with `M` = (-1 >> S) diff --git a/unssa.c b/unssa.c index 334ffa47..ab7372b9 100644 --- a/unssa.c +++ b/unssa.c @@ -11,7 +11,7 @@ * This is similar to the "Sreedhar method I" except that the copies to the * temporaries are not placed at the end of the predecessor basic blocks, but * at the place where the phi-node operands are defined. - * This is particulary easy since these copies are essentialy already present + * This is particularly easy since these copies are essentially already present * as the corresponding OP_PHISOURCE. * * While very simple this method create a lot more copies that really necessary. diff --git a/utils.h b/utils.h index 079fb02a..1294521e 100644 --- a/utils.h +++ b/utils.h @@ -9,7 +9,7 @@ #include <stdarg.h> /// -// return the value coresponding to an hexadecimal digit +// return the value corresponding to an hexadecimal digit unsigned int hexval(unsigned int c); /// diff --git a/validation/bool-array.c b/validation/bool-array.c index 6c4c8723..5f446309 100644 --- a/validation/bool-array.c +++ b/validation/bool-array.c @@ -19,7 +19,7 @@ static int nl2 = sizeof(longarray_u2); * Used to get "warning: excessive elements in array initializer" * for all elements but the first one. * Note: only occurs if nbr of elements is a multiple of 8 - * (if not, theer was another problem) + * (if not, there was another problem) */ static _Bool boolarray_u8[] = { 0, -- 2.39.5