From 19d8b8a17383863d45823e37f20a94cc1d55c3a6 Mon Sep 17 00:00:00 2001 From: Larry Doolittle Date: Sun, 7 May 2017 21:38:09 -0700 Subject: [PATCH] Spelling fixes in C comments only --- arm-gen.c | 6 +++--- arm-link.c | 4 ++-- arm64-link.c | 2 +- c67-gen.c | 4 ++-- c67-link.c | 2 +- coff.h | 2 +- elf.h | 12 ++++++------ i386-asm.c | 2 +- i386-gen.c | 4 ++-- i386-link.c | 8 ++++---- il-gen.c | 2 +- libtcc.c | 4 ++-- tcc.h | 12 ++++++------ tccelf.c | 2 +- tccgen.c | 12 ++++++------ tccpe.c | 4 ++-- tccpp.c | 4 ++-- x86_64-gen.c | 6 +++--- x86_64-link.c | 4 ++-- 19 files changed, 48 insertions(+), 48 deletions(-) diff --git a/arm-gen.c b/arm-gen.c index a5dabd1..809352c 100644 --- a/arm-gen.c +++ b/arm-gen.c @@ -813,7 +813,7 @@ struct avail_regs { and the parameter is a single float. avregs: opaque structure to keep track of available VFP co-processor regs - align: alignment contraints for the param, as returned by type_size() + align: alignment constraints for the param, as returned by type_size() size: size of the parameter, as returned by type_size() */ int assign_vfpreg(struct avail_regs *avregs, int align, int size) { @@ -823,7 +823,7 @@ int assign_vfpreg(struct avail_regs *avregs, int align, int size) return -1; if (align >> 3) { /* double alignment */ first_reg = avregs->first_free_reg; - /* alignment contraint not respected so use next reg and record hole */ + /* alignment constraint not respected so use next reg and record hole */ if (first_reg & 1) avregs->avail[avregs->last_hole++] = first_reg++; } else { /* no special alignment (float or array of float) */ @@ -1653,7 +1653,7 @@ static int is_zero(int i) } /* generate a floating point operation 'v = t1 op t2' instruction. The - * two operands are guaranted to have the same floating point type */ + * two operands are guaranteed to have the same floating point type */ void gen_opf(int op) { uint32_t x; diff --git a/arm-link.c b/arm-link.c index bec8a1c..606f40e 100644 --- a/arm-link.c +++ b/arm-link.c @@ -62,7 +62,7 @@ int code_reloc (int reloc_type) return -1; } -/* Returns an enumerator to describe wether and when the relocation needs a +/* Returns an enumerator to describe whether and when the relocation needs a GOT and/or PLT entry to be created. See tcc.h for a description of the different values. */ int gotplt_entry_type (int reloc_type) @@ -109,7 +109,7 @@ ST_FUNC unsigned create_plt_entry(TCCState *s1, unsigned got_offset, struct sym_ unsigned plt_offset; /* when building a DLL, GOT entry accesses must be done relative to - start of GOT (see x86_64 examble above) */ + start of GOT (see x86_64 example above) */ if (s1->output_type == TCC_OUTPUT_DLL) tcc_error("DLLs unimplemented!"); diff --git a/arm64-link.c b/arm64-link.c index b2e12b6..73e503e 100644 --- a/arm64-link.c +++ b/arm64-link.c @@ -51,7 +51,7 @@ int code_reloc (int reloc_type) return -1; } -/* Returns an enumerator to describe wether and when the relocation needs a +/* Returns an enumerator to describe whether and when the relocation needs a GOT and/or PLT entry to be created. See tcc.h for a description of the different values. */ int gotplt_entry_type (int reloc_type) diff --git a/c67-gen.c b/c67-gen.c index 7c950eb..a480976 100644 --- a/c67-gen.c +++ b/c67-gen.c @@ -2225,7 +2225,7 @@ void gen_opi(int op) r = vtop[-1].r; fr = vtop[0].r; vtop--; - C67_MPYI(fr, r); // 32 bit bultiply fr,r,fr + C67_MPYI(fr, r); // 32 bit multiply fr,r,fr C67_NOP(8); // NOP 8 for worst case break; case TOK_SHL: @@ -2282,7 +2282,7 @@ void gen_opi(int op) } /* generate a floating point operation 'v = t1 op t2' instruction. The - two operands are guaranted to have the same floating point type */ + two operands are guaranteed to have the same floating point type */ /* XXX: need to use ST1 too */ void gen_opf(int op) { diff --git a/c67-link.c b/c67-link.c index 4b22fd9..de72e44 100644 --- a/c67-link.c +++ b/c67-link.c @@ -44,7 +44,7 @@ int code_reloc (int reloc_type) return -1; } -/* Returns an enumerator to describe wether and when the relocation needs a +/* Returns an enumerator to describe whether and when the relocation needs a GOT and/or PLT entry to be created. See tcc.h for a description of the different values. */ int gotplt_entry_type (int reloc_type) diff --git a/coff.h b/coff.h index ea871a7..e8e6185 100644 --- a/coff.h +++ b/coff.h @@ -22,7 +22,7 @@ struct filehdr { /*------------------------------------------------------------------------*/ #define F_RELFLG 0x01 /* relocation info stripped from file */ #define F_EXEC 0x02 /* file is executable (no unresolved refs) */ -#define F_LNNO 0x04 /* line nunbers stripped from file */ +#define F_LNNO 0x04 /* line numbers stripped from file */ #define F_LSYMS 0x08 /* local symbols stripped from file */ #define F_GSP10 0x10 /* 34010 version */ #define F_GSP20 0x20 /* 34020 version */ diff --git a/elf.h b/elf.h index 68f3990..c3eab71 100644 --- a/elf.h +++ b/elf.h @@ -221,7 +221,7 @@ typedef struct #define EM_68HC12 53 /* Motorola M68HC12 */ #define EM_MMA 54 /* Fujitsu MMA Multimedia Accelerator*/ #define EM_PCP 55 /* Siemens PCP */ -#define EM_NCPU 56 /* Sony nCPU embeeded RISC */ +#define EM_NCPU 56 /* Sony nCPU embedded RISC */ #define EM_NDR1 57 /* Denso NDR1 microprocessor */ #define EM_STARCORE 58 /* Motorola Start*Core processor */ #define EM_ME16 59 /* Toyota ME16 processor */ @@ -342,7 +342,7 @@ typedef struct #define SHT_FINI_ARRAY 15 /* Array of destructors */ #define SHT_PREINIT_ARRAY 16 /* Array of pre-constructors */ #define SHT_GROUP 17 /* Section group */ -#define SHT_SYMTAB_SHNDX 18 /* Extended section indeces */ +#define SHT_SYMTAB_SHNDX 18 /* Extended section indices */ #define SHT_NUM 19 /* Number of defined types. */ #define SHT_LOOS 0x60000000 /* Start OS-specific. */ #define SHT_GNU_ATTRIBUTES 0x6ffffff5 /* Object attributes. */ @@ -871,7 +871,7 @@ typedef struct #define VER_NDX_LORESERVE 0xff00 /* Beginning of reserved entries. */ #define VER_NDX_ELIMINATE 0xff01 /* Symbol is to be eliminated. */ -/* Auxialiary version information. */ +/* Auxiliary version information. */ typedef struct { @@ -1776,9 +1776,9 @@ typedef Elf32_Addr Elf32_Conflict; #define EFA_PARISC_1_1 0x0210 /* PA-RISC 1.1 big-endian. */ #define EFA_PARISC_2_0 0x0214 /* PA-RISC 2.0 big-endian. */ -/* Additional section indeces. */ +/* Additional section indices. */ -#define SHN_PARISC_ANSI_COMMON 0xff00 /* Section for tenatively declared +#define SHN_PARISC_ANSI_COMMON 0xff00 /* Section for tentatively declared symbols in ANSI C. */ #define SHN_PARISC_HUGE_COMMON 0xff01 /* Common blocks in huge model. */ @@ -1957,7 +1957,7 @@ typedef Elf32_Addr Elf32_Conflict; /* Legal values for sh_type field of Elf64_Shdr. */ -/* These two are primerily concerned with ECOFF debugging info. */ +/* These two are primarily concerned with ECOFF debugging info. */ #define SHT_ALPHA_DEBUG 0x70000001 #define SHT_ALPHA_REGINFO 0x70000002 diff --git a/i386-asm.c b/i386-asm.c index 8f459a8..2e18497 100644 --- a/i386-asm.c +++ b/i386-asm.c @@ -1473,7 +1473,7 @@ ST_FUNC void subst_asm_operand(CString *add_str, if (r & VT_SYM) { const char *name = get_tok_str(sv->sym->v, NULL); if (sv->sym->v >= SYM_FIRST_ANOM) { - /* In case of anonymuous symbols ("L.42", used + /* In case of anonymous symbols ("L.42", used for static data labels) we can't find them in the C symbol table when later looking up this name. So enter them now into the asm label diff --git a/i386-gen.c b/i386-gen.c index a93d5a2..904f838 100644 --- a/i386-gen.c +++ b/i386-gen.c @@ -174,7 +174,7 @@ ST_FUNC void gen_addrpc32(int r, Sym *sym, long c) gen_le32(c - 4); } -/* generate a modrm reference. 'op_reg' contains the addtionnal 3 +/* generate a modrm reference. 'op_reg' contains the addtional 3 opcode bits */ static void gen_modrm(int op_reg, int r, Sym *sym, int c) { @@ -890,7 +890,7 @@ ST_FUNC void gen_opi(int op) } /* generate a floating point operation 'v = t1 op t2' instruction. The - two operands are guaranted to have the same floating point type */ + two operands are guaranteed to have the same floating point type */ /* XXX: need to use ST1 too */ ST_FUNC void gen_opf(int op) { diff --git a/i386-link.c b/i386-link.c index b2ff492..b446644 100644 --- a/i386-link.c +++ b/i386-link.c @@ -49,7 +49,7 @@ int code_reloc (int reloc_type) return -1; } -/* Returns an enumerator to describe wether and when the relocation needs a +/* Returns an enumerator to describe whether and when the relocation needs a GOT and/or PLT entry to be created. See tcc.h for a description of the different values. */ int gotplt_entry_type (int reloc_type) @@ -99,7 +99,7 @@ ST_FUNC unsigned create_plt_entry(TCCState *s1, unsigned got_offset, struct sym_ else modrm = 0x25; - /* empty PLT: create PLT0 entry that pushes the library indentifier + /* empty PLT: create PLT0 entry that pushes the library identifier (GOT + PTR_SIZE) and jumps to ld.so resolution routine (GOT + 2 * PTR_SIZE) */ if (plt->data_offset == 0) { @@ -229,9 +229,9 @@ void relocate(TCCState *s1, ElfW_Rel *rel, int type, unsigned char *ptr, addr_t /* do nothing */ return; case R_386_COPY: - /* This reloction must copy initialized data from the library + /* This relocation must copy initialized data from the library to the program .bss segment. Currently made like for ARM - (to remove noise of defaukt case). Is this true? + (to remove noise of default case). Is this true? */ return; default: diff --git a/il-gen.c b/il-gen.c index 40d7fbe..bb670cc 100644 --- a/il-gen.c +++ b/il-gen.c @@ -602,7 +602,7 @@ void gen_opi(int op) } /* generate a floating point operation 'v = t1 op t2' instruction. The - two operands are guaranted to have the same floating point type */ + two operands are guaranteed to have the same floating point type */ void gen_opf(int op) { /* same as integer */ diff --git a/libtcc.c b/libtcc.c index c6bc00f..3ce7b29 100644 --- a/libtcc.c +++ b/libtcc.c @@ -1176,7 +1176,7 @@ PUB_FUNC int tcc_add_library_err(TCCState *s, const char *libname) return ret; } -/* habdle #pragma comment(lib,) */ +/* handle #pragma comment(lib,) */ ST_FUNC void tcc_add_pragma_libs(TCCState *s1) { int i; @@ -1287,7 +1287,7 @@ static int link_option(const char *str, const char *val, const char **ptr) if (*str == '-') str++; - /* then str & val should match (potentialy up to '=') */ + /* then str & val should match (potentially up to '=') */ p = str; q = val; diff --git a/tcc.h b/tcc.h index 45d62e6..596ee25 100644 --- a/tcc.h +++ b/tcc.h @@ -601,7 +601,7 @@ typedef struct ExprValue { #define MAX_ASM_OPERANDS 30 typedef struct ASMOperand { - int id; /* GCC 3 optionnal identifier (0 if number only supported */ + int id; /* GCC 3 optional identifier (0 if number only supported */ char *constraint; char asm_str[16]; /* computed asm string for operand */ SValue *vt; /* C value of the expression */ @@ -651,7 +651,7 @@ struct TCCState { int char_is_unsigned; int leading_underscore; int ms_extensions; /* allow nested named struct w/o identifier behave like unnamed */ - int dollars_in_identifiers; /* allows '$' char in indentifiers */ + int dollars_in_identifiers; /* allows '$' char in identifiers */ int ms_bitfields; /* if true, emulate MS algorithm for aligning bitfields */ /* warning switches */ @@ -768,7 +768,7 @@ struct TCCState { Section *dynsymtab_section; /* exported dynamic symbol section */ Section *dynsym; - /* copy of the gobal symtab_section variable */ + /* copy of the global symtab_section variable */ Section *symtab; /* extra attributes (eg. GOT/PLT value) for symtab symbols */ struct sym_attr *sym_attrs; @@ -945,7 +945,7 @@ struct filespec { #define TOK_SHL 0x01 /* shift left */ #define TOK_SAR 0x02 /* signed shift right */ -/* assignement operators : normal operator or 0x80 */ +/* assignment operators : normal operator or 0x80 */ #define TOK_A_MOD 0xa5 #define TOK_A_AND 0xa6 #define TOK_A_MUL 0xaa @@ -968,7 +968,7 @@ struct filespec { #define TOK_EOF (-1) /* end of file */ #define TOK_LINEFEED 10 /* line feed */ -/* all identificators and strings have token above that */ +/* all identifiers and strings have token above that */ #define TOK_IDENT 256 #define DEF_ASM(x) DEF(TOK_ASM_ ## x, #x) @@ -1241,7 +1241,7 @@ ST_FUNC int tcc_preprocess(TCCState *s1); ST_FUNC void skip(int c); ST_FUNC NORETURN void expect(const char *msg); -/* space exlcuding newline */ +/* space excluding newline */ static inline int is_space(int ch) { return ch == ' ' || ch == '\t' || ch == '\v' || ch == '\f' || ch == '\r'; } diff --git a/tccelf.c b/tccelf.c index a936767..aedc85a 100644 --- a/tccelf.c +++ b/tccelf.c @@ -151,7 +151,7 @@ ST_FUNC Section *new_section(TCCState *s1, const char *name, int sh_type, int sh sec->sh_addralign = 1; break; default: - sec->sh_addralign = PTR_SIZE; /* gcc/pcc default aligment */ + sec->sh_addralign = PTR_SIZE; /* gcc/pcc default alignment */ break; } diff --git a/tccgen.c b/tccgen.c index 3bcfa94..76291eb 100644 --- a/tccgen.c +++ b/tccgen.c @@ -257,7 +257,7 @@ ST_FUNC void tccgen_end(TCCState *s1) } /* ------------------------------------------------------------------------- */ -/* apply storage attibutes to Elf symbol */ +/* apply storage attributes to Elf symbol */ static void update_storage(Sym *sym) { @@ -1532,7 +1532,7 @@ static void gen_opl(int op) c = (int)vtop->c.i; /* constant: simpler */ /* NOTE: all comments are for SHL. the other cases are - done by swaping words */ + done by swapping words */ vpop(); if (op != TOK_SHL) vswap(); @@ -1973,7 +1973,7 @@ redo: goto redo; } else if (bt1 == VT_PTR || bt2 == VT_PTR) { /* at least one operand is a pointer */ - /* relationnal op: must be both pointers */ + /* relational op: must be both pointers */ if (op >= TOK_ULT && op <= TOK_LOR) { check_comparison_pointer_types(vtop - 1, vtop, op); /* pointers are handled are unsigned */ @@ -2137,7 +2137,7 @@ redo: else gen_opic(op); if (op >= TOK_ULT && op <= TOK_GT) { - /* relationnal op: the result is an int */ + /* relational op: the result is an int */ vtop->type.t = VT_INT; } else { vtop->type.t = t; @@ -2794,7 +2794,7 @@ static void gen_assign_cast(CType *dt) goto type_ok; } type1 = pointed_type(dt); - /* a function is implicitely a function pointer */ + /* a function is implicitly a function pointer */ if (sbt == VT_FUNC) { if ((type1->t & VT_BTYPE) != VT_VOID && !is_compatible_types(pointed_type(dt), st)) @@ -6086,7 +6086,7 @@ static void init_putv(CType *type, Section *sec, unsigned long c) } if ((vtop->r & (VT_SYM|VT_CONST)) == (VT_SYM|VT_CONST) && vtop->sym->v >= SYM_FIRST_ANOM && - /* XXX This rejects compount literals like + /* XXX This rejects compound literals like '(void *){ptr}'. The problem is that '&sym' is represented the same way, which would be ruled out by the SYM_FIRST_ANOM check above, but also '"string"' diff --git a/tccpe.c b/tccpe.c index 91b1a32..1337de8 100644 --- a/tccpe.c +++ b/tccpe.c @@ -1333,7 +1333,7 @@ static int pe_check_symbols(struct pe_info *pe) #ifdef PE_PRINT_SECTIONS static void pe_print_section(FILE * f, Section * s) { - /* just if you'r curious */ + /* just if you're curious */ BYTE *p, *e, b; int i, n, l, m; p = s->data; @@ -1976,7 +1976,7 @@ ST_FUNC int pe_output_file(TCCState *s1, const char *filename) tcc_add_bcheck(s1); pe_add_runtime(s1, &pe); - relocate_common_syms(); /* assign bss adresses */ + relocate_common_syms(); /* assign bss addresses */ tcc_add_linker_symbols(s1); pe_set_options(s1, &pe); diff --git a/tccpp.c b/tccpp.c index 4cf0ef5..d70ddd6 100644 --- a/tccpp.c +++ b/tccpp.c @@ -2993,10 +2993,10 @@ static int *macro_arg_subst(Sym **nested_list, const int *macro_str, Sym *args) } else { add_var: /* NOTE: the stream cannot be read when macro - substituing an argument */ + substituting an argument */ macro_subst(&str, nested_list, st, 0); } - if (str.len == l0) /* exanded to empty string */ + if (str.len == l0) /* expanded to empty string */ tok_str_add(&str, TOK_PLCHLDR); } else { tok_str_add(&str, t); diff --git a/x86_64-gen.c b/x86_64-gen.c index 0c0968c..38c488d 100644 --- a/x86_64-gen.c +++ b/x86_64-gen.c @@ -316,14 +316,14 @@ static void gen_modrm_impl(int op_reg, int r, Sym *sym, int c, int is_got) } } -/* generate a modrm reference. 'op_reg' contains the addtionnal 3 +/* generate a modrm reference. 'op_reg' contains the addtional 3 opcode bits */ static void gen_modrm(int op_reg, int r, Sym *sym, int c) { gen_modrm_impl(op_reg, r, sym, c, 0); } -/* generate a modrm reference. 'op_reg' contains the addtionnal 3 +/* generate a modrm reference. 'op_reg' contains the addtional 3 opcode bits */ static void gen_modrm64(int opcode, int op_reg, int r, Sym *sym, int c) { @@ -1923,7 +1923,7 @@ void gen_opl(int op) } /* generate a floating point operation 'v = t1 op t2' instruction. The - two operands are guaranted to have the same floating point type */ + two operands are guaranteed to have the same floating point type */ /* XXX: need to use ST1 too */ void gen_opf(int op) { diff --git a/x86_64-link.c b/x86_64-link.c index 7ab07b9..1485e05 100644 --- a/x86_64-link.c +++ b/x86_64-link.c @@ -50,7 +50,7 @@ int code_reloc (int reloc_type) return -1; } -/* Returns an enumerator to describe wether and when the relocation needs a +/* Returns an enumerator to describe whether and when the relocation needs a GOT and/or PLT entry to be created. See tcc.h for a description of the different values. */ int gotplt_entry_type (int reloc_type) @@ -95,7 +95,7 @@ ST_FUNC unsigned create_plt_entry(TCCState *s1, unsigned got_offset, struct sym_ modrm = 0x25; - /* empty PLT: create PLT0 entry that pushes the library indentifier + /* empty PLT: create PLT0 entry that pushes the library identifier (GOT + PTR_SIZE) and jumps to ld.so resolution routine (GOT + 2 * PTR_SIZE) */ if (plt->data_offset == 0) {