HomeFreeBSD

flua: clean up lposix argument checking

Description

flua: clean up lposix argument checking

The key insight here is that the luaL_check*() and luaL_opt*() functions
will happily take indexes that are larger than the stack top and print a
useful error message.

This means that there is no need to check if too few arguments have been
received prior to checking the types of individual arguments.

This patch also replaces a couple reimplementations of luaL_opt*()
functions with the luaL helpers.

References: https://www.lua.org/manual/5.4/manual.html#4.1.2
Reviewed by: emaste, kevans
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50273

Details

Provenance
ifreund_freebsdfoundation.orgAuthored on May 9 2025, 2:29 PM
emasteCommitted on May 11 2025, 1:46 PM
Reviewer
emaste
Differential Revision
D50273: flua: clean up lposix argument checking
Parents
rG3a58c266e2e6: random(9): bump removal to FreeBSD 16.0
Branches
Unknown
Tags
Unknown