]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.2319: "exptype_T" can be read as "expected type" v8.2.2319
authorBram Moolenaar <Bram@vim.org>
Sat, 9 Jan 2021 14:45:23 +0000 (15:45 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 9 Jan 2021 14:45:23 +0000 (15:45 +0100)
Problem:    "exptype_T" can be read as "expected type".
Solution:   Rename to "exprtype_T", expression type.

src/eval.c
src/proto/typval.pro
src/proto/vim9compile.pro
src/structs.h
src/typval.c
src/version.c
src/vim9.h
src/vim9compile.c
src/vim9execute.c

index 5ebe0375f22f47c42dc3f5190501895991ba4539..9c91e526d34b55c69ffd3036e17fe0253ef8629e 100644 (file)
@@ -2655,7 +2655,7 @@ eval4(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
 {
     char_u     *p;
     int                getnext;
-    exptype_T  type = EXPR_UNKNOWN;
+    exprtype_T type = EXPR_UNKNOWN;
     int                len = 2;
     int                type_is = FALSE;
 
index 46f893147a2025d6ef4dbd381d7900cc77cbee2f..7a65376c6e557d352d56fb415dea3aa600361949 100644 (file)
@@ -18,7 +18,7 @@ char_u *tv_get_string_buf_chk(typval_T *varp, char_u *buf);
 char_u *tv_stringify(typval_T *varp, char_u *buf);
 int tv_check_lock(typval_T *tv, char_u *name, int use_gettext);
 void copy_tv(typval_T *from, typval_T *to);
-int typval_compare(typval_T *typ1, typval_T *typ2, exptype_T type, int ic);
+int typval_compare(typval_T *typ1, typval_T *typ2, exprtype_T type, int ic);
 char_u *typval_tostring(typval_T *arg);
 int tv_islocked(typval_T *tv);
 int tv_equal(typval_T *tv1, typval_T *tv2, int ic, int recursive);
index 52ccb0608ca31cf68a7699aff60cd6f396ba2a20..7800d3ba59b2a4ec95bef94e7368f4f5a1464cd8 100644 (file)
@@ -1,6 +1,6 @@
 /* vim9compile.c */
 int check_defined(char_u *p, size_t len, cctx_T *cctx);
-int check_compare_types(exptype_T type, typval_T *tv1, typval_T *tv2);
+int check_compare_types(exprtype_T type, typval_T *tv1, typval_T *tv2);
 int use_typecheck(type_T *actual, type_T *expected);
 int get_script_item_idx(int sid, char_u *name, int check_writable, cctx_T *cctx);
 imported_T *find_imported(char_u *name, size_t len, cctx_T *cctx);
@@ -9,7 +9,7 @@ char_u *peek_next_line_from_context(cctx_T *cctx);
 char_u *next_line_from_context(cctx_T *cctx, int skip_comment);
 char_u *to_name_end(char_u *arg, int use_namespace);
 char_u *to_name_const_end(char_u *arg);
-exptype_T get_compare_type(char_u *p, int *len, int *type_is);
+exprtype_T get_compare_type(char_u *p, int *len, int *type_is);
 void error_white_both(char_u *op, int len);
 int assignment_len(char_u *p, int *heredoc);
 void vim9_declare_error(char_u *name);
index 3324b067ae95e12a770a493fe8a9bc4890ee99fe..9d1f82181825ef11f1d6ed4c5b91ee3f5f8d141d 100644 (file)
@@ -4029,7 +4029,7 @@ typedef enum
     EXPR_MULT,         // *
     EXPR_DIV,          // /
     EXPR_REM,          // %
-} exptype_T;
+} exprtype_T;
 
 /*
  * Structure used for reading in json_decode().
index d16f0e6df85de8934c0b07f7318791ca6dd63c04..e620bedd742aec814c54498255afd73f921ee79a 100644 (file)
@@ -649,7 +649,7 @@ copy_tv(typval_T *from, typval_T *to)
 typval_compare(
     typval_T   *typ1,   // first operand
     typval_T   *typ2,   // second operand
-    exptype_T  type,    // operator
+    exprtype_T type,    // operator
     int                ic)      // ignore case
 {
     int                i;
index 06d525691001a21d63306bc0cf8dde996117f0ad..0b174f5319fb32324a216a2feb5f6db7e49723d2 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2319,
 /**/
     2318,
 /**/
index 440de278502b21f1226f38f5a658bd284452fdde..7462b29db0a180ef2b3a7cc71a884fc2d0c36b97 100644 (file)
@@ -105,12 +105,12 @@ typedef enum {
     ISN_ADDLIST,    // add two lists
     ISN_ADDBLOB,    // add two blobs
 
-    // operation with two arguments; isn_arg.op.op_type is exptype_T
+    // operation with two arguments; isn_arg.op.op_type is exprtype_T
     ISN_OPNR,
     ISN_OPFLOAT,
     ISN_OPANY,
 
-    // comparative operations; isn_arg.op.op_type is exptype_T, op_ic used
+    // comparative operations; isn_arg.op.op_type is exprtype_T, op_ic used
     ISN_COMPAREBOOL,
     ISN_COMPARESPECIAL,
     ISN_COMPARENR,
@@ -217,7 +217,7 @@ typedef struct {
 
 // arguments to ISN_OPNR, ISN_OPFLOAT, etc.
 typedef struct {
-    exptype_T  op_type;
+    exprtype_T op_type;
     int                op_ic;      // TRUE with '#', FALSE with '?', else MAYBE
 } opexpr_T;
 
index 376f306a41e25bc85d297ad14c2fa3d36f4dcd1d..77200205dffca7c1e85bd1a9bba0660e6da34031 100644 (file)
@@ -669,7 +669,7 @@ generate_two_op(cctx_T *cctx, char_u *op)
  * Return ISN_DROP when failed.
  */
     static isntype_T
-get_compare_isn(exptype_T exptype, vartype_T type1, vartype_T type2)
+get_compare_isn(exprtype_T exprtype, vartype_T type1, vartype_T type2)
 {
     isntype_T  isntype = ISN_DROP;
 
@@ -699,22 +699,22 @@ get_compare_isn(exptype_T exptype, vartype_T type1, vartype_T type2)
              && (type2 == VAR_NUMBER || type2 ==VAR_FLOAT)))
        isntype = ISN_COMPAREANY;
 
-    if ((exptype == EXPR_IS || exptype == EXPR_ISNOT)
+    if ((exprtype == EXPR_IS || exprtype == EXPR_ISNOT)
            && (isntype == ISN_COMPAREBOOL
            || isntype == ISN_COMPARESPECIAL
            || isntype == ISN_COMPARENR
            || isntype == ISN_COMPAREFLOAT))
     {
        semsg(_(e_cannot_use_str_with_str),
-               exptype == EXPR_IS ? "is" : "isnot" , vartype_name(type1));
+               exprtype == EXPR_IS ? "is" : "isnot" , vartype_name(type1));
        return ISN_DROP;
     }
     if (isntype == ISN_DROP
-           || ((exptype != EXPR_EQUAL && exptype != EXPR_NEQUAL
+           || ((exprtype != EXPR_EQUAL && exprtype != EXPR_NEQUAL
                    && (type1 == VAR_BOOL || type1 == VAR_SPECIAL
                       || type2 == VAR_BOOL || type2 == VAR_SPECIAL)))
-           || ((exptype != EXPR_EQUAL && exptype != EXPR_NEQUAL
-                                && exptype != EXPR_IS && exptype != EXPR_ISNOT
+           || ((exprtype != EXPR_EQUAL && exprtype != EXPR_NEQUAL
+                                && exprtype != EXPR_IS && exprtype != EXPR_ISNOT
                    && (type1 == VAR_BLOB || type2 == VAR_BLOB
                        || type1 == VAR_LIST || type2 == VAR_LIST))))
     {
@@ -726,7 +726,7 @@ get_compare_isn(exptype_T exptype, vartype_T type1, vartype_T type2)
 }
 
     int
-check_compare_types(exptype_T type, typval_T *tv1, typval_T *tv2)
+check_compare_types(exprtype_T type, typval_T *tv1, typval_T *tv2)
 {
     if (get_compare_isn(type, tv1->v_type, tv2->v_type) == ISN_DROP)
        return FAIL;
@@ -737,7 +737,7 @@ check_compare_types(exptype_T type, typval_T *tv1, typval_T *tv2)
  * Generate an ISN_COMPARE* instruction with a boolean result.
  */
     static int
-generate_COMPARE(cctx_T *cctx, exptype_T exptype, int ic)
+generate_COMPARE(cctx_T *cctx, exprtype_T exprtype, int ic)
 {
     isntype_T  isntype;
     isn_T      *isn;
@@ -752,13 +752,13 @@ generate_COMPARE(cctx_T *cctx, exptype_T exptype, int ic)
     // checking.
     type1 = ((type_T **)stack->ga_data)[stack->ga_len - 2]->tt_type;
     type2 = ((type_T **)stack->ga_data)[stack->ga_len - 1]->tt_type;
-    isntype = get_compare_isn(exptype, type1, type2);
+    isntype = get_compare_isn(exprtype, type1, type2);
     if (isntype == ISN_DROP)
        return FAIL;
 
     if ((isn = generate_instr(cctx, isntype)) == NULL)
        return FAIL;
-    isn->isn_arg.op.op_type = exptype;
+    isn->isn_arg.op.op_type = exprtype;
     isn->isn_arg.op.op_ic = ic;
 
     // takes two arguments, puts one bool back
@@ -3348,10 +3348,10 @@ get_vim_constant(char_u **arg, typval_T *rettv)
     }
 }
 
-    exptype_T
+    exprtype_T
 get_compare_type(char_u *p, int *len, int *type_is)
 {
-    exptype_T  type = EXPR_UNKNOWN;
+    exprtype_T type = EXPR_UNKNOWN;
     int                i;
 
     switch (p[0])
@@ -4346,7 +4346,7 @@ compile_expr5(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
     static int
 compile_expr4(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
 {
-    exptype_T  type = EXPR_UNKNOWN;
+    exprtype_T type = EXPR_UNKNOWN;
     char_u     *p;
     char_u     *next;
     int                len = 2;
index e7a632a19312e32cee7fac5cf9109397553de030..9a04b6b8181b49013826941fc44bf8620314e826 100644 (file)
@@ -2725,11 +2725,11 @@ call_def_function(
                {
                    typval_T    *tv1 = STACK_TV_BOT(-2);
                    typval_T    *tv2 = STACK_TV_BOT(-1);
-                   exptype_T   exptype = iptr->isn_arg.op.op_type;
+                   exprtype_T  exprtype = iptr->isn_arg.op.op_type;
                    int         ic = iptr->isn_arg.op.op_ic;
 
                    SOURCING_LNUM = iptr->isn_lnum;
-                   typval_compare(tv1, tv2, exptype, ic);
+                   typval_compare(tv1, tv2, exprtype, ic);
                    clear_tv(tv2);
                    --ectx.ec_stack.ga_len;
                }