From b8a32b66033335a27eb928ccf73caecccfacea2a Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 14 Jun 2014 16:17:27 +0400 Subject: [PATCH] Add const qualifier and explicit length --- scripts/genex_cmds.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/genex_cmds.lua b/scripts/genex_cmds.lua index 969a874535..7fd258a6c3 100644 --- a/scripts/genex_cmds.lua +++ b/scripts/genex_cmds.lua @@ -34,15 +34,15 @@ local byte_a = string.byte('a') local byte_z = string.byte('z') local cmdidxs = string.format([[ -static cmdidx_T cmdidxs[%u] = { +static const cmdidx_T cmdidxs[%u] = { ]], byte_z - byte_a + 2) enumfile:write([[ typedef enum CMD_index { ]]) -defsfile:write([[ -static CommandDefinition cmdnames[] = { -]]) +defsfile:write(string.format([[ +static CommandDefinition cmdnames[%u] = { +]], #defs)) for i, cmd in ipairs(defs) do local enumname = cmd.enum or ('CMD_' .. cmd.command) firstchar = string.byte(cmd.command)