comparison src/evalwindow.c @ 29175:755ab148288b v8.2.5107

patch 8.2.5107: some callers of rettv_list_alloc() check for not OK Commit: https://github.com/vim/vim/commit/93a1096fe48e12095544924adb267e3b8a16b221 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jun 16 11:42:09 2022 +0100 patch 8.2.5107: some callers of rettv_list_alloc() check for not OK Problem: Some callers of rettv_list_alloc() check for not OK. (Christ van Willegen) Solution: Use "==" instead of "!=" when checking the return value.
author Bram Moolenaar <Bram@vim.org>
date Thu, 16 Jun 2022 12:45:03 +0200
parents d0241e74bfdb
children 827d9f2b7a71
comparison
equal deleted inserted replaced
29174:a13f0046b5ef 29175:755ab148288b
469 { 469 {
470 tabpage_T *tp, *tparg = NULL; 470 tabpage_T *tp, *tparg = NULL;
471 dict_T *d; 471 dict_T *d;
472 int tpnr = 0; 472 int tpnr = 0;
473 473
474 if (rettv_list_alloc(rettv) != OK) 474 if (rettv_list_alloc(rettv) == FAIL)
475 return; 475 return;
476 476
477 if (in_vim9script() && check_for_opt_number_arg(argvars, 0) == FAIL) 477 if (in_vim9script() && check_for_opt_number_arg(argvars, 0) == FAIL)
478 return; 478 return;
479 479
508 tabpage_T *tp; 508 tabpage_T *tp;
509 win_T *wp = NULL, *wparg = NULL; 509 win_T *wp = NULL, *wparg = NULL;
510 dict_T *d; 510 dict_T *d;
511 short tabnr = 0, winnr; 511 short tabnr = 0, winnr;
512 512
513 if (rettv_list_alloc(rettv) != OK) 513 if (rettv_list_alloc(rettv) == FAIL)
514 return; 514 return;
515 515
516 if (in_vim9script() && check_for_opt_number_arg(argvars, 0) == FAIL) 516 if (in_vim9script() && check_for_opt_number_arg(argvars, 0) == FAIL)
517 return; 517 return;
518 518
777 f_win_findbuf(typval_T *argvars, typval_T *rettv) 777 f_win_findbuf(typval_T *argvars, typval_T *rettv)
778 { 778 {
779 if (in_vim9script() && check_for_number_arg(argvars, 0) == FAIL) 779 if (in_vim9script() && check_for_number_arg(argvars, 0) == FAIL)
780 return; 780 return;
781 781
782 if (rettv_list_alloc(rettv) != FAIL) 782 if (rettv_list_alloc(rettv) == OK)
783 win_findbuf(argvars, rettv->vval.v_list); 783 win_findbuf(argvars, rettv->vval.v_list);
784 } 784 }
785 785
786 /* 786 /*
787 * "win_getid()" function 787 * "win_getid()" function
845 f_win_id2tabwin(typval_T *argvars, typval_T *rettv) 845 f_win_id2tabwin(typval_T *argvars, typval_T *rettv)
846 { 846 {
847 if (in_vim9script() && check_for_number_arg(argvars, 0) == FAIL) 847 if (in_vim9script() && check_for_number_arg(argvars, 0) == FAIL)
848 return; 848 return;
849 849
850 if (rettv_list_alloc(rettv) != FAIL) 850 if (rettv_list_alloc(rettv) == OK)
851 win_id2tabwin(argvars, rettv->vval.v_list); 851 win_id2tabwin(argvars, rettv->vval.v_list);
852 } 852 }
853 853
854 /* 854 /*
855 * "win_id2win()" function 855 * "win_id2win()" function
1141 void 1141 void
1142 f_winlayout(typval_T *argvars, typval_T *rettv) 1142 f_winlayout(typval_T *argvars, typval_T *rettv)
1143 { 1143 {
1144 tabpage_T *tp; 1144 tabpage_T *tp;
1145 1145
1146 if (rettv_list_alloc(rettv) != OK) 1146 if (rettv_list_alloc(rettv) == FAIL)
1147 return; 1147 return;
1148 1148
1149 if (in_vim9script() && check_for_opt_number_arg(argvars, 0) == FAIL) 1149 if (in_vim9script() && check_for_opt_number_arg(argvars, 0) == FAIL)
1150 return; 1150 return;
1151 1151