summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-03-26 21:46:28 +0200
committerBram Moolenaar <Bram@vim.org>2017-03-26 21:46:28 +0200
commit980128c369451450743bdb90a67588fa72ec4b07 (patch)
treeebf21cf258e11b6a014493a7e3b6e5b9da26b936
parentc96272e30e2b81e5e0c8418f09d9db4e2fcd5d73 (diff)
patch 8.0.0514: script for creating cmdidxs can be improvedv8.0.0514
Problem: Script for creating cmdidxs can be improved. Solution: Count skipped lines instead of collecting the lines. Add "const". (Dominique Pelle, closes #1594)
-rw-r--r--src/create_cmdidxs.pl11
-rw-r--r--src/ex_docmd.c2
-rw-r--r--src/version.c2
3 files changed, 9 insertions, 6 deletions
diff --git a/src/create_cmdidxs.pl b/src/create_cmdidxs.pl
index ff8dcc3f4b..d39ac1614a 100644
--- a/src/create_cmdidxs.pl
+++ b/src/create_cmdidxs.pl
@@ -9,15 +9,17 @@
# Script should be run every time new Ex commands are added in Vim,
# from the src/vim directory, since it reads commands from "ex_cmds.h".
+use strict;
+
# Find the list of Vim commands from cmdnames[] table in ex_cmds.h
my @cmds;
-my @skipped;
+my $skipped_cmds;
open(IN, "< ex_cmds.h") or die "can't open ex_cmds.h: $!\n";
while (<IN>) {
if (/^EX\(CMD_\S*,\s*"([a-z][^"]*)"/) {
- push (@cmds, $1);
+ push @cmds, $1;
} elsif (/^EX\(CMD_/) {
- push (@skipped, $1);
+ ++$skipped_cmds;
}
}
@@ -68,7 +70,6 @@ for my $c1 ('a' .. 'z') {
}
print "};\n",
"\n",
- "static int command_count = ", $#cmds + $#skipped + 2 , ";\n",
+ "static const int command_count = ", scalar(@cmds) + $skipped_cmds, ";\n",
"\n",
"/* End of automatically generated code by create_cmdidxs.pl */\n";
-
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 9782557c13..8755f0549b 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -566,7 +566,7 @@ static const unsigned char cmdidxs2[26][26] =
/* z */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }
};
-static int command_count = 539;
+static const int command_count = 539;
/* End of automatically generated code by create_cmdidxs.pl */
diff --git a/src/version.c b/src/version.c
index 28f3c59d11..79c97f9b96 100644
--- a/src/version.c
+++ b/src/version.c
@@ -765,6 +765,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 514,
+/**/
513,
/**/
512,