Skip to content

Commit e15f1f2

Browse files
committed
Details
Typos in comments and details in the manual.
1 parent b5c6570 commit e15f1f2

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

ldebug.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ static const char *funcnamefromcall (lua_State *L, CallInfo *ci,
659659
** Check whether pointer 'o' points to some value in the stack frame of
660660
** the current function and, if so, returns its index. Because 'o' may
661661
** not point to a value in this stack, we cannot compare it with the
662-
** region boundaries (undefined behaviour in ISO C).
662+
** region boundaries (undefined behavior in ISO C).
663663
*/
664664
static int instack (CallInfo *ci, const TValue *o) {
665665
int pos;
@@ -848,7 +848,7 @@ static int changedline (const Proto *p, int oldpc, int newpc) {
848848
if (p->lineinfo == NULL) /* no debug information? */
849849
return 0;
850850
if (newpc - oldpc < MAXIWTHABS / 2) { /* not too far apart? */
851-
int delta = 0; /* line diference */
851+
int delta = 0; /* line difference */
852852
int pc = oldpc;
853853
for (;;) {
854854
int lineinfo = p->lineinfo[++pc];

llex.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ l_noret luaX_syntaxerror (LexState *ls, const char *msg) {
128128
** ensuring there is only one copy of each unique string. The table
129129
** here is used as a set: the string enters as the key, while its value
130130
** is irrelevant. We use the string itself as the value only because it
131-
** is a TValue readly available. Later, the code generation can change
131+
** is a TValue readily available. Later, the code generation can change
132132
** this value.
133133
*/
134134
TString *luaX_newstring (LexState *ls, const char *str, size_t l) {

llimits.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ typedef signed char ls_byte;
8282
#if defined(UINTPTR_MAX) /* even in C99 this type is optional */
8383
#define L_P2I uintptr_t
8484
#else /* no 'intptr'? */
85-
#define L_P2I uintmax_t /* use the largerst available integer */
85+
#define L_P2I uintmax_t /* use the largest available integer */
8686
#endif
8787
#else /* C89 option */
8888
#define L_P2I size_t

lparser.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -521,12 +521,12 @@ static l_noret jumpscopeerror (LexState *ls, Labeldesc *gt) {
521521

522522
/*
523523
** Solves the goto at index 'g' to given 'label' and removes it
524-
** from the list of pending goto's.
524+
** from the list of pending gotos.
525525
** If it jumps into the scope of some variable, raises an error.
526526
*/
527527
static void solvegoto (LexState *ls, int g, Labeldesc *label) {
528528
int i;
529-
Labellist *gl = &ls->dyd->gt; /* list of goto's */
529+
Labellist *gl = &ls->dyd->gt; /* list of gotos */
530530
Labeldesc *gt = &gl->arr[g]; /* goto to be resolved */
531531
lua_assert(eqstr(gt->name, label->name));
532532
if (l_unlikely(gt->nactvar < label->nactvar)) /* enter some scope? */
@@ -580,7 +580,7 @@ static int newgotoentry (LexState *ls, TString *name, int line, int pc) {
580580
/*
581581
** Solves forward jumps. Check whether new label 'lb' matches any
582582
** pending gotos in current block and solves them. Return true
583-
** if any of the goto's need to close upvalues.
583+
** if any of the gotos need to close upvalues.
584584
*/
585585
static int solvegotos (LexState *ls, Labeldesc *lb) {
586586
Labellist *gl = &ls->dyd->gt;
@@ -601,7 +601,7 @@ static int solvegotos (LexState *ls, Labeldesc *lb) {
601601
/*
602602
** Create a new label with the given 'name' at the given 'line'.
603603
** 'last' tells whether label is the last non-op statement in its
604-
** block. Solves all pending goto's to this new label and adds
604+
** block. Solves all pending gotos to this new label and adds
605605
** a close instruction if necessary.
606606
** Returns true iff it added a close instruction.
607607
*/

lstrlib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ static const char *match_capture (MatchState *ms, const char *s, int l) {
570570
static const char *match (MatchState *ms, const char *s, const char *p) {
571571
if (l_unlikely(ms->matchdepth-- == 0))
572572
luaL_error(ms->L, "pattern too complex");
573-
init: /* using goto's to optimize tail recursion */
573+
init: /* using goto to optimize tail recursion */
574574
if (p != ms->p_end) { /* end of pattern? */
575575
switch (*p) {
576576
case '(': { /* start capture */

lua.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ int main (int argc, char **argv) {
666666
l_message(argv[0], "cannot create state: not enough memory");
667667
return EXIT_FAILURE;
668668
}
669-
lua_gc(L, LUA_GCSTOP); /* stop GC while buidling state */
669+
lua_gc(L, LUA_GCSTOP); /* stop GC while building state */
670670
lua_pushcfunction(L, &pmain); /* to call 'pmain' in protected mode */
671671
lua_pushinteger(L, argc); /* 1st argument */
672672
lua_pushlightuserdata(L, argv); /* 2nd argument */

manual/manual.of

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ making it ideal for configuration, scripting,
2020
and rapid prototyping.
2121

2222
Lua is implemented as a library, written in @emphx{clean C},
23-
the common subset of @N{Standard C} and C++.
23+
the common subset of @N{standard C} and C++.
2424
The Lua distribution includes a host program called @id{lua},
2525
which uses the Lua library to offer a complete,
2626
standalone Lua interpreter,
@@ -2963,7 +2963,7 @@ static void *l_alloc (void *ud, void *ptr, size_t osize,
29632963
return realloc(ptr, nsize);
29642964
}
29652965
}
2966-
Note that @N{Standard C} ensures
2966+
Note that @N{ISO C} ensures
29672967
that @T{free(NULL)} has no effect and that
29682968
@T{realloc(NULL,size)} is equivalent to @T{malloc(size)}.
29692969

@@ -5780,7 +5780,7 @@ with @id{tname} in the registry.
57805780

57815781
Creates a new Lua state.
57825782
It calls @Lid{lua_newstate} with an
5783-
allocator based on the @N{standard C} allocation functions
5783+
allocator based on the @N{ISO C} allocation functions
57845784
and then sets a warning function and a panic function @see{C-error}
57855785
that print messages to the standard error output.
57865786

@@ -6898,7 +6898,7 @@ including if necessary a path and an extension.
68986898
@id{funcname} must be the exact name exported by the @N{C library}
68996899
(which may depend on the @N{C compiler} and linker used).
69006900

6901-
This function is not supported by @N{Standard C}.
6901+
This functionality is not supported by @N{ISO C}.
69026902
As such, it is only available on some platforms
69036903
(Windows, Linux, Mac OS X, Solaris, BSD,
69046904
plus other Unix systems that support the @id{dlfcn} standard).

0 commit comments

Comments
 (0)