From 60a8de28d11595f4df0419ece8afa7d6accc9fbd Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 15 Sep 2019 14:33:22 +0200 Subject: patch 8.1.2035: recognizing octal numbers is confusing Problem: Recognizing octal numbers is confusing. Solution: Introduce scriptversion 4: do not use octal and allow for single quote inside numbers. --- src/vim.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/vim.h') diff --git a/src/vim.h b/src/vim.h index 46ca6930d..8afa93352 100644 --- a/src/vim.h +++ b/src/vim.h @@ -307,11 +307,15 @@ #define NUMBUFLEN 65 // flags for vim_str2nr() -#define STR2NR_BIN 1 -#define STR2NR_OCT 2 -#define STR2NR_HEX 4 +#define STR2NR_BIN 0x01 +#define STR2NR_OCT 0x02 +#define STR2NR_HEX 0x04 #define STR2NR_ALL (STR2NR_BIN + STR2NR_OCT + STR2NR_HEX) -#define STR2NR_FORCE 8 // only when ONE of the above is used +#define STR2NR_NO_OCT (STR2NR_BIN + STR2NR_HEX) + +#define STR2NR_FORCE 0x80 // only when ONE of the above is used + +#define STR2NR_QUOTE 0x10 // ignore embedded single quotes /* * Shorthand for unsigned variables. Many systems, but not all, have u_char -- cgit v1.2.1