diff src/structs.h @ 30576:72e6073a2822 v9.0.0623

patch 9.0.0623: error for modifying a const is not detected at compile time Commit: https://github.com/vim/vim/commit/fa1039760e8c1a0c7a2a722160bd3d71a4736e61 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Sep 29 19:14:42 2022 +0100 patch 9.0.0623: error for modifying a const is not detected at compile time Problem: Error for modifying a const is not detected at compile time. Solution: Add TTFLAG_CONST and check for it in add() and extend().
author Bram Moolenaar <Bram@vim.org>
date Thu, 29 Sep 2022 20:15:05 +0200
parents 86683eee58ac
children 6c6ac189a05f
line wrap: on
line diff
--- a/src/structs.h
+++ b/src/structs.h
@@ -1445,10 +1445,10 @@ typedef struct {
     type_T	*type_decl;	    // declared type or equal to type_current
 } type2_T;
 
-#define TTFLAG_VARARGS	1	    // func args ends with "..."
-#define TTFLAG_OPTARG	2	    // func arg type with "?"
-#define TTFLAG_BOOL_OK	4	    // can be converted to bool
-#define TTFLAG_STATIC	8	    // one of the static types, e.g. t_any
+#define TTFLAG_VARARGS	0x01	    // func args ends with "..."
+#define TTFLAG_BOOL_OK	0x02	    // can be converted to bool
+#define TTFLAG_STATIC	0x04	    // one of the static types, e.g. t_any
+#define TTFLAG_CONST	0x08	    // cannot be changed
 
 /*
  * Structure to hold an internal variable without a name.