aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2024-06-14 17:11:36 +0200
committerBenoit Germain <benoit.germain@ubisoft.com>2024-06-14 17:11:36 +0200
commit50f4c40bdb5667aa7053434dede2dd98f6f9e243 (patch)
treec443c9337e238ff2825b2da4c9749fdf97aa574f /src
parentec8574d298ef302bc4162d9b394e96bf08763632 (diff)
downloadlanes-50f4c40bdb5667aa7053434dede2dd98f6f9e243.tar.gz
lanes-50f4c40bdb5667aa7053434dede2dd98f6f9e243.tar.bz2
lanes-50f4c40bdb5667aa7053434dede2dd98f6f9e243.zip
Wording fix: parameter → argument
Diffstat (limited to 'src')
-rw-r--r--src/cancel.cpp2
-rw-r--r--src/intercopycontext.cpp4
-rw-r--r--src/keeper.cpp4
-rw-r--r--src/lane.cpp2
-rw-r--r--src/lane.h2
-rw-r--r--src/lanes.cpp2
-rw-r--r--src/lanes.lua14
7 files changed, 15 insertions, 15 deletions
diff --git a/src/cancel.cpp b/src/cancel.cpp
index 990f5d4..755215f 100644
--- a/src/cancel.cpp
+++ b/src/cancel.cpp
@@ -168,7 +168,7 @@ LUAG_FUNC(thread_cancel)
168 bool _wake_lane{ _op != CancelOp::Soft }; 168 bool _wake_lane{ _op != CancelOp::Soft };
169 if (lua_gettop(L_) >= 2) { 169 if (lua_gettop(L_) >= 2) {
170 if (!lua_isboolean(L_, 2)) { 170 if (!lua_isboolean(L_, 2)) {
171 raise_luaL_error(L_, "wake_lindas parameter is not a boolean"); 171 raise_luaL_error(L_, "wake_lindas argument is not a boolean");
172 } 172 }
173 _wake_lane = lua_toboolean(L_, 2); 173 _wake_lane = lua_toboolean(L_, 2);
174 lua_remove(L_, 2); // argument is processed, remove it 174 lua_remove(L_, 2); // argument is processed, remove it
diff --git a/src/intercopycontext.cpp b/src/intercopycontext.cpp
index 34a1c95..85c1ebb 100644
--- a/src/intercopycontext.cpp
+++ b/src/intercopycontext.cpp
@@ -193,7 +193,7 @@ void InterCopyContext::copyFunction() const
193 // "value returned is the error code returned by the last call 193 // "value returned is the error code returned by the last call
194 // to the writer" (and we only return 0) 194 // to the writer" (and we only return 0)
195 // not sure this could ever fail but for memory shortage reasons 195 // not sure this could ever fail but for memory shortage reasons
196 // last parameter is Lua 5.4-specific (no stripping) 196 // last argument is Lua 5.4-specific (no stripping)
197 luaL_Buffer B{}; 197 luaL_Buffer B{};
198 if (luaG_dump(L1, buf_writer, &B, U->stripFunctions) != 0) { 198 if (luaG_dump(L1, buf_writer, &B, U->stripFunctions) != 0) {
199 raise_luaL_error(getErrL(), "internal error: function dump failed."); 199 raise_luaL_error(getErrL(), "internal error: function dump failed.");
@@ -482,7 +482,7 @@ void InterCopyContext::interCopyKeyValuePair() const
482 return; 482 return;
483 // we could raise an error instead of ignoring the table entry, like so: 483 // we could raise an error instead of ignoring the table entry, like so:
484 // raise_luaL_error(L1, "Unable to copy %s key '%s' because of value is of type '%s'", (vt == VT::NORMAL) ? "table" : "metatable", name, luaL_typename(L1, key_i)); 484 // raise_luaL_error(L1, "Unable to copy %s key '%s' because of value is of type '%s'", (vt == VT::NORMAL) ? "table" : "metatable", name, luaL_typename(L1, key_i));
485 // maybe offer this possibility as a global configuration option, or a linda setting, or as a parameter of the call causing the transfer? 485 // maybe offer this possibility as a global configuration option, or a linda setting, or as a argument of the call causing the transfer?
486 } 486 }
487 487
488 char* _valPath{ nullptr }; 488 char* _valPath{ nullptr };
diff --git a/src/keeper.cpp b/src/keeper.cpp
index 7038f2c..e058114 100644
--- a/src/keeper.cpp
+++ b/src/keeper.cpp
@@ -576,8 +576,8 @@ int keepercall_set(lua_State* const L_)
576 * Call a function ('func_name') in the keeper state, and pass on the returned 576 * Call a function ('func_name') in the keeper state, and pass on the returned
577 * values to 'L'. 577 * values to 'L'.
578 * 578 *
579 * 'linda': deep Linda pointer (used only as a unique table key, first parameter) 579 * 'linda': deep Linda pointer (used only as a unique table key, first argument)
580 * 'starting_index': first of the rest of parameters (none if 0) 580 * 'starting_index': first of the rest of arguments (none if 0)
581 * 581 *
582 * Returns: number of return values (pushed to 'L'), unset in case of error 582 * Returns: number of return values (pushed to 'L'), unset in case of error
583 */ 583 */
diff --git a/src/lane.cpp b/src/lane.cpp
index e801cba..d4175c6 100644
--- a/src/lane.cpp
+++ b/src/lane.cpp
@@ -539,7 +539,7 @@ static void push_stack_trace(lua_State* L_, Lane::ErrorTraceLevel errorTraceLeve
539 539
540// ################################################################################################# 540// #################################################################################################
541//--- 541//---
542// Run finalizers - if any - with the given parameters 542// Run finalizers - if any - with the given arguments
543// 543//
544// If 'rc' is nonzero, error message and stack index (the latter only when errorTraceLevel_ == 1) are available as: 544// If 'rc' is nonzero, error message and stack index (the latter only when errorTraceLevel_ == 1) are available as:
545// [-1]: stack trace (table) 545// [-1]: stack trace (table)
diff --git a/src/lane.h b/src/lane.h
index 4461b37..0426240 100644
--- a/src/lane.h
+++ b/src/lane.h
@@ -14,7 +14,7 @@ static constexpr RegistryUniqueKey kExtendedStackTraceRegKey{ 0x38147AD48FB426E2
14 * of functions that Lanes will call after the executing 'pcall' has ended. 14 * of functions that Lanes will call after the executing 'pcall' has ended.
15 * 15 *
16 * We're NOT using the GC system for finalizer mainly because providing the 16 * We're NOT using the GC system for finalizer mainly because providing the
17 * error (and maybe stack trace) parameters to the finalizer functions would 17 * error (and maybe stack trace) arguments to the finalizer functions would
18 * anyways complicate that approach. 18 * anyways complicate that approach.
19 */ 19 */
20// xxh64 of string "kFinalizerRegKey" generated at https://www.pelock.com/products/hash-calculator 20// xxh64 of string "kFinalizerRegKey" generated at https://www.pelock.com/products/hash-calculator
diff --git a/src/lanes.cpp b/src/lanes.cpp
index f1aa873..cab5944 100644
--- a/src/lanes.cpp
+++ b/src/lanes.cpp
@@ -217,7 +217,7 @@ LUAG_FUNC(register)
217{ 217{
218 std::string_view const _name{ luaG_checkstring(L_, 1) }; 218 std::string_view const _name{ luaG_checkstring(L_, 1) };
219 LuaType const _mod_type{ luaG_type(L_, 2) }; 219 LuaType const _mod_type{ luaG_type(L_, 2) };
220 // ignore extra parameters, just in case 220 // ignore extra arguments, just in case
221 lua_settop(L_, 2); 221 lua_settop(L_, 2);
222 luaL_argcheck(L_, (_mod_type == LuaType::TABLE) || (_mod_type == LuaType::FUNCTION), 2, "unexpected module type"); 222 luaL_argcheck(L_, (_mod_type == LuaType::TABLE) || (_mod_type == LuaType::FUNCTION), 2, "unexpected module type");
223 DEBUGSPEW_CODE(Universe* _U = Universe::Get(L_)); 223 DEBUGSPEW_CODE(Universe* _U = Universe::Get(L_));
diff --git a/src/lanes.lua b/src/lanes.lua
index c860ba0..29fc4a9 100644
--- a/src/lanes.lua
+++ b/src/lanes.lua
@@ -158,12 +158,12 @@ local params_checker = function(settings_)
158 -- make a copy of the table to leave the provided one unchanged, *and* to help ensure it won't change behind our back 158 -- make a copy of the table to leave the provided one unchanged, *and* to help ensure it won't change behind our back
159 local settings = {} 159 local settings = {}
160 if type(settings_) ~= "table" then 160 if type(settings_) ~= "table" then
161 error "Bad parameter #1 to lanes.configure(), should be a table" 161 error "Bad argument #1 to lanes.configure(), should be a table"
162 end 162 end
163 -- any setting unknown to Lanes raises an error 163 -- any setting unknown to Lanes raises an error
164 for setting, _ in pairs(settings_) do 164 for setting, _ in pairs(settings_) do
165 if not param_checkers[setting] then 165 if not param_checkers[setting] then
166 error("Unknown parameter '" .. setting .. "' in configure options") 166 error("Unknown argument '" .. setting .. "' in configure options")
167 end 167 end
168 end 168 end
169 -- any setting not present in the provided parameters takes the default value 169 -- any setting not present in the provided parameters takes the default value
@@ -176,7 +176,7 @@ local params_checker = function(settings_)
176 param = default_params[key] 176 param = default_params[key]
177 end 177 end
178 if not checker(param) then 178 if not checker(param) then
179 error("Bad parameter " .. key .. ": " .. tostring(param), 2) 179 error("Bad argument " .. key .. ": " .. tostring(param), 2)
180 end 180 end
181 settings[key] = param 181 settings[key] = param
182 end 182 end
@@ -291,7 +291,7 @@ local opt_validators =
291-- 291--
292-- ... (more options may be introduced later) ... 292-- ... (more options may be introduced later) ...
293-- 293--
294-- Calling with a function parameter ('lane_func') ends the string/table 294-- Calling with a function argument ('lane_func') ends the string/table
295-- modifiers, and prepares a lane generator. 295-- modifiers, and prepares a lane generator.
296 296
297-- receives a sequence of strings and tables, plus a function 297-- receives a sequence of strings and tables, plus a function
@@ -306,7 +306,7 @@ local gen = function(...)
306 306
307 -- we need at least a function 307 -- we need at least a function
308 if n == 0 then 308 if n == 0 then
309 error("No parameters!", 2) 309 error("No arguments!", 2)
310 end 310 end
311 311
312 -- all arguments but the last must be nil, strings, or tables 312 -- all arguments but the last must be nil, strings, or tables
@@ -322,7 +322,7 @@ local gen = function(...)
322 elseif v == nil then 322 elseif v == nil then
323 -- skip 323 -- skip
324 else 324 else
325 error("Bad parameter " .. i .. ": " .. tv .. " " .. string_format("%q", tostring(v)), 2) 325 error("Bad argument " .. i .. ": " .. tv .. " " .. string_format("%q", tostring(v)), 2)
326 end 326 end
327 end 327 end
328 328
@@ -330,7 +330,7 @@ local gen = function(...)
330 local func = select(n, ...) 330 local func = select(n, ...)
331 local functype = type(func) 331 local functype = type(func)
332 if functype ~= "function" and functype ~= "string" then 332 if functype ~= "function" and functype ~= "string" then
333 error("Last parameter not function or string: " .. functype .. " " .. string_format("%q", tostring(func)), 2) 333 error("Last argument not function or string: " .. functype .. " " .. string_format("%q", tostring(func)), 2)
334 end 334 end
335 335
336 -- check that the caller only provides reserved library names, and those only once 336 -- check that the caller only provides reserved library names, and those only once