1
0
Fork 0
mirror of https://github.com/lua/lua.git synced 2025-07-24 04:32:35 +00:00
New year (2024->2025), typos in comments
This commit is contained in:
Roberto Ierusalimschy 2025-01-16 11:51:16 -03:00
commit 2d8d5c74b5
15 changed files with 24 additions and 25 deletions

View file

@ -898,7 +898,7 @@ int luaG_tracecall (lua_State *L) {
if (ci->u.l.savedpc == p->code) { /* first instruction (not resuming)? */ if (ci->u.l.savedpc == p->code) { /* first instruction (not resuming)? */
if (p->flag & PF_ISVARARG) if (p->flag & PF_ISVARARG)
return 0; /* hooks will start at VARARGPREP instruction */ return 0; /* hooks will start at VARARGPREP instruction */
else if (!(ci->callstatus & CIST_HOOKYIELD)) /* not yieded? */ else if (!(ci->callstatus & CIST_HOOKYIELD)) /* not yielded? */
luaD_hookcall(L, ci); /* check 'call' hook */ luaD_hookcall(L, ci); /* check 'call' hook */
} }
return 1; /* keep 'trap' on */ return 1; /* keep 'trap' on */

4
ldo.c
View file

@ -236,7 +236,7 @@ static void correctstack (lua_State *L, StkId oldstack) {
#else #else
/* /*
** Alternatively, we can use the old address after the dealocation. ** Alternatively, we can use the old address after the deallocation.
** That is not strict ISO C, but seems to work fine everywhere. ** That is not strict ISO C, but seems to work fine everywhere.
*/ */
@ -485,7 +485,7 @@ static unsigned tryfuncTM (lua_State *L, StkId func, unsigned status) {
} }
/* Generic case for 'moveresult */ /* Generic case for 'moveresult' */
l_sinline void genmoveresults (lua_State *L, StkId res, int nres, l_sinline void genmoveresults (lua_State *L, StkId res, int nres,
int wanted) { int wanted) {
StkId firstresult = L->top.p - nres; /* index of first result */ StkId firstresult = L->top.p - nres; /* index of first result */

4
lgc.c
View file

@ -242,7 +242,7 @@ static int iscleared (global_State *g, const GCObject *o) {
** incremental sweep phase, it clears the black object to white (sweep ** incremental sweep phase, it clears the black object to white (sweep
** it) to avoid other barrier calls for this same object. (That cannot ** it) to avoid other barrier calls for this same object. (That cannot
** be done is generational mode, as its sweep does not distinguish ** be done is generational mode, as its sweep does not distinguish
** whites from deads.) ** white from dead.)
*/ */
void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v) { void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v) {
global_State *g = G(L); global_State *g = G(L);
@ -1089,7 +1089,7 @@ void luaC_checkfinalizer (lua_State *L, GCObject *o, Table *mt) {
** GCmarked: number of bytes that became old since last major collection. ** GCmarked: number of bytes that became old since last major collection.
** GCmajorminor: number of bytes marked in last major collection. ** GCmajorminor: number of bytes marked in last major collection.
** * KGC_GENMAJOR ** * KGC_GENMAJOR
** GCmarked: number of bytes that became old sinse last major collection. ** GCmarked: number of bytes that became old since last major collection.
** GCmajorminor: number of bytes marked in last major collection. ** GCmajorminor: number of bytes marked in last major collection.
*/ */

2
llex.h
View file

@ -59,7 +59,7 @@ typedef struct Token {
} Token; } Token;
/* state of the lexer plus state of the parser when shared by all /* state of the scanner plus state of the parser when shared by all
functions */ functions */
typedef struct LexState { typedef struct LexState {
int current; /* current character (charint) */ int current; /* current character (charint) */

View file

@ -159,7 +159,7 @@ typedef LUAI_UACINT l_uacInt;
#define cast_st2S(sz) ((lua_Integer)(sz)) #define cast_st2S(sz) ((lua_Integer)(sz))
/* Cast a ptrdiff_t to size_t, when it is known that the minuend /* Cast a ptrdiff_t to size_t, when it is known that the minuend
** comes from the subtraend (the base) ** comes from the subtrahend (the base)
*/ */
#define ct_diff2sz(df) ((size_t)(df)) #define ct_diff2sz(df) ((size_t)(df))

View file

@ -106,7 +106,7 @@ static int math_floor (lua_State *L) {
static int math_ceil (lua_State *L) { static int math_ceil (lua_State *L) {
if (lua_isinteger(L, 1)) if (lua_isinteger(L, 1))
lua_settop(L, 1); /* integer is its own ceil */ lua_settop(L, 1); /* integer is its own ceiling */
else { else {
lua_Number d = l_mathop(ceil)(luaL_checknumber(L, 1)); lua_Number d = l_mathop(ceil)(luaL_checknumber(L, 1));
pushnumint(L, d); pushnumint(L, d);

View file

@ -32,7 +32,7 @@ typedef enum {
VKFLT, /* floating constant; nval = numerical float value */ VKFLT, /* floating constant; nval = numerical float value */
VKINT, /* integer constant; ival = numerical integer value */ VKINT, /* integer constant; ival = numerical integer value */
VKSTR, /* string constant; strval = TString address; VKSTR, /* string constant; strval = TString address;
(string is fixed by the lexer) */ (string is fixed by the scanner) */
VNONRELOC, /* expression has its value in a fixed register; VNONRELOC, /* expression has its value in a fixed register;
info = result register */ info = result register */
VLOCAL, /* local variable; var.ridx = register index; VLOCAL, /* local variable; var.ridx = register index;

View file

@ -123,7 +123,7 @@ typedef union {
/* /*
** Common hash part for tables with empty hash parts. That allows all ** Common hash part for tables with empty hash parts. That allows all
** tables to have a hash part, avoding an extra check ("is there a hash ** tables to have a hash part, avoiding an extra check ("is there a hash
** part?") when indexing. Its sole node has an empty value and a key ** part?") when indexing. Its sole node has an empty value and a key
** (DEADKEY, NULL) that is different from any valid TValue. ** (DEADKEY, NULL) that is different from any valid TValue.
*/ */
@ -699,7 +699,7 @@ static void clearNewSlice (Table *t, unsigned oldasize, unsigned newasize) {
** into the table, initializes the new part of the array (if any) with ** into the table, initializes the new part of the array (if any) with
** nils and reinserts the elements of the old hash back into the new ** nils and reinserts the elements of the old hash back into the new
** parts of the table. ** parts of the table.
** Note that if the new size for the arry part ('newasize') is equal to ** Note that if the new size for the array part ('newasize') is equal to
** the old one ('oldasize'), this function will do nothing with that ** the old one ('oldasize'), this function will do nothing with that
** part. ** part.
*/ */
@ -774,7 +774,7 @@ static void rehash (lua_State *L, Table *t, const TValue *ek) {
nsize = ct.total - ct.na; nsize = ct.total - ct.na;
if (ct.deleted) { /* table has deleted entries? */ if (ct.deleted) { /* table has deleted entries? */
/* insertion-deletion-insertion: give hash some extra size to /* insertion-deletion-insertion: give hash some extra size to
avoid constant resizings */ avoid repeated resizings */
nsize += nsize >> 2; nsize += nsize >> 2;
} }
/* resize the table to new computed sizes */ /* resize the table to new computed sizes */
@ -1300,7 +1300,7 @@ lua_Unsigned luaH_getn (Table *t) {
return newhint(t, binsearch(t, limit, asize)); return newhint(t, binsearch(t, limit, asize));
} }
} }
/* last element non empty; set a hint to speed up findind that again */ /* last element non empty; set a hint to speed up finding that again */
/* (keys in the hash part cannot be hints) */ /* (keys in the hash part cannot be hints) */
*lenhint(t) = asize; *lenhint(t) = asize;
} }

2
lua.c
View file

@ -497,7 +497,7 @@ static void lua_freeline (char *line) {
static void lua_initreadline (lua_State *L) { static void lua_initreadline (lua_State *L) {
void *lib = dlopen(LUA_READLINELIB, RTLD_NOW | RTLD_LOCAL); void *lib = dlopen(LUA_READLINELIB, RTLD_NOW | RTLD_LOCAL);
if (lib == NULL) if (lib == NULL)
lua_warning(L, "library '" LUA_READLINELIB "'not found", 0); lua_warning(L, "library '" LUA_READLINELIB "' not found", 0);
else { else {
const char **name = cast(const char**, dlsym(lib, "rl_readline_name")); const char **name = cast(const char**, dlsym(lib, "rl_readline_name"));
if (name != NULL) if (name != NULL)

4
lua.h
View file

@ -13,7 +13,7 @@
#include <stddef.h> #include <stddef.h>
#define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2024 Lua.org, PUC-Rio" #define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2025 Lua.org, PUC-Rio"
#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo, W. Celes" #define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo, W. Celes"
@ -528,7 +528,7 @@ struct lua_Debug {
/****************************************************************************** /******************************************************************************
* Copyright (C) 1994-2024 Lua.org, PUC-Rio. * Copyright (C) 1994-2025 Lua.org, PUC-Rio.
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the * a copy of this software and associated documentation files (the

View file

@ -63,7 +63,7 @@ static void loadBlock (LoadState *S, void *b, size_t size) {
static void loadAlign (LoadState *S, unsigned align) { static void loadAlign (LoadState *S, unsigned align) {
unsigned padding = align - cast_uint(S->offset % align); unsigned padding = align - cast_uint(S->offset % align);
if (padding < align) { /* apd == align means no padding */ if (padding < align) { /* (padding == align) means no padding */
lua_Integer paddingContent; lua_Integer paddingContent;
loadBlock(S, &paddingContent, padding); loadBlock(S, &paddingContent, padding);
lua_assert(S->offset % align == 0); lua_assert(S->offset % align == 0);

4
lvm.c
View file

@ -127,8 +127,8 @@ int luaV_flttointeger (lua_Number n, lua_Integer *p, F2Imod mode) {
lua_Number f = l_floor(n); lua_Number f = l_floor(n);
if (n != f) { /* not an integral value? */ if (n != f) { /* not an integral value? */
if (mode == F2Ieq) return 0; /* fails if mode demands integral value */ if (mode == F2Ieq) return 0; /* fails if mode demands integral value */
else if (mode == F2Iceil) /* needs ceil? */ else if (mode == F2Iceil) /* needs ceiling? */
f += 1; /* convert floor to ceil (remember: n != f) */ f += 1; /* convert floor to ceiling (remember: n != f) */
} }
return lua_numbertointeger(f, p); return lua_numbertointeger(f, p);
} }

2
lvm.h
View file

@ -43,7 +43,7 @@
typedef enum { typedef enum {
F2Ieq, /* no rounding; accepts only integral values */ F2Ieq, /* no rounding; accepts only integral values */
F2Ifloor, /* takes the floor of the number */ F2Ifloor, /* takes the floor of the number */
F2Iceil /* takes the ceil of the number */ F2Iceil /* takes the ceiling of the number */
} F2Imod; } F2Imod;

View file

@ -30,7 +30,7 @@ by Roberto Ierusalimschy, Luiz Henrique de Figueiredo, Waldemar Celes
<p> <p>
<small> <small>
<a href="http://www.lua.org/copyright.html">Copyright</a> <a href="http://www.lua.org/copyright.html">Copyright</a>
&copy; 2024 Lua.org, PUC-Rio. All rights reserved. &copy; 2025 Lua.org, PUC-Rio. All rights reserved.
</small> </small>
<hr> <hr>

View file

@ -28,10 +28,9 @@ _nomsg = rawget(_G, "_nomsg") or false
local usertests = rawget(_G, "_U") local usertests = rawget(_G, "_U")
if usertests then if usertests then
-- tests for sissies ;) Avoid problems _soft = true -- avoid tests that take too long
_soft = true _port = true -- avoid non-portable tests
_port = true _nomsg = true -- avoid messages about tests not performed
_nomsg = true
end end
-- tests should require debug when needed -- tests should require debug when needed