From owner-svn-src-head@freebsd.org Fri Feb 23 04:03:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6652EF24844; Fri, 23 Feb 2018 04:03:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B0AC6A451; Fri, 23 Feb 2018 04:03:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1601B11755; Fri, 23 Feb 2018 04:03:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1N4379T053643; Fri, 23 Feb 2018 04:03:07 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1N437lu053638; Fri, 23 Feb 2018 04:03:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802230403.w1N437lu053638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 23 Feb 2018 04:03:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329856 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329856 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Feb 2018 04:03:08 -0000 Author: kevans Date: Fri Feb 23 04:03:07 2018 New Revision: 329856 URL: https://svnweb.freebsd.org/changeset/base/329856 Log: lualoader: Use "local function x()" instead of "local x = function()" The latter is good, but the former is more elegant and clear about what 'x' is. Adopt it, preferably only using the latter kind of notation where needed as values for tables. Modified: head/stand/lua/cli.lua head/stand/lua/config.lua head/stand/lua/core.lua head/stand/lua/drawer.lua head/stand/lua/menu.lua Modified: head/stand/lua/cli.lua ============================================================================== --- head/stand/lua/cli.lua Fri Feb 23 03:36:24 2018 (r329855) +++ head/stand/lua/cli.lua Fri Feb 23 04:03:07 2018 (r329856) @@ -38,7 +38,7 @@ local cli = {} -- Defaults to nil and "" respectively. -- This will also parse arguments to autoboot, but the with_kernel argument -- will need to be explicitly overwritten to false -local parse_boot_args = function(argv, with_kernel) +local function parse_boot_args(argv, with_kernel) if with_kernel == nil then with_kernel = true end Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Fri Feb 23 03:36:24 2018 (r329855) +++ head/stand/lua/config.lua Fri Feb 23 04:03:07 2018 (r329856) @@ -336,7 +336,7 @@ function config.loadkernel(other_kernel) local flags = loader.getenv("kernel_options") or "" local kernel = other_kernel or loader.getenv("kernel") - local try_load = function (names) + local function try_load(names) for name in names:gmatch("([^;]+)%s*;?") do local r = loader.perform("load " .. flags .. " " .. name) @@ -347,7 +347,7 @@ function config.loadkernel(other_kernel) return nil end - local load_bootfile = function() + local function load_bootfile() local bootfile = loader.getenv("bootfile") -- append default kernel name Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Fri Feb 23 03:36:24 2018 (r329855) +++ head/stand/lua/core.lua Fri Feb 23 04:03:07 2018 (r329856) @@ -33,7 +33,7 @@ local config = require("config") local core = {} -local compose_loader_cmd = function(cmd_name, argstr) +local function compose_loader_cmd(cmd_name, argstr) if argstr ~= nil then cmd_name = cmd_name .. " " .. argstr end Modified: head/stand/lua/drawer.lua ============================================================================== --- head/stand/lua/drawer.lua Fri Feb 23 03:36:24 2018 (r329855) +++ head/stand/lua/drawer.lua Fri Feb 23 04:03:07 2018 (r329856) @@ -45,7 +45,7 @@ local orb local none local none_shifted = false -local menu_entry_name = function(drawing_menu, entry) +local function menu_entry_name(drawing_menu, entry) local name_handler = drawer.menu_name_handlers[entry.entry_type] if name_handler ~= nil then @@ -57,7 +57,7 @@ local menu_entry_name = function(drawing_menu, entry) return entry.name end -local shift_brand_text = function(shift) +local function shift_brand_text(shift) drawer.brand_position.x = drawer.brand_position.x + shift.x drawer.brand_position.y = drawer.brand_position.y + shift.y drawer.menu_position.x = drawer.menu_position.x + shift.x Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Feb 23 03:36:24 2018 (r329855) +++ head/stand/lua/menu.lua Fri Feb 23 04:03:07 2018 (r329856) @@ -38,7 +38,7 @@ local drawer = require("drawer") local menu = {} -local OnOff = function(str, b) +local function OnOff(str, b) if b then return str .. color.escapef(color.GREEN) .. "On" .. color.escapef(color.WHITE) @@ -48,7 +48,7 @@ local OnOff = function(str, b) end end -local bootenvSet = function(env) +local function bootenvSet(env) loader.setenv("vfs.root.mountfrom", env) loader.setenv("currdev", env .. ":") config.reload()