Mercurial > vim
comparison src/vim9compile.c @ 19392:5b6f420e7352 v8.2.0254
patch 8.2.0254: compiler warning for checking size_t to be negative
Commit: https://github.com/vim/vim/commit/ae8d2de3a9c0436a543c7d46071104af31ff6db7
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Feb 13 21:42:24 2020 +0100
patch 8.2.0254: compiler warning for checking size_t to be negative
Problem: Compiler warning for checking size_t to be negative.
Solution: Only check for zero. (Zoltan Arpadffy)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 13 Feb 2020 21:45:03 +0100 |
parents | 3a579cadceb6 |
children | bc880a130120 |
comparison
equal
deleted
inserted
replaced
19391:fddabbb2fbd3 | 19392:5b6f420e7352 |
---|---|
136 static int | 136 static int |
137 lookup_local(char_u *name, size_t len, cctx_T *cctx) | 137 lookup_local(char_u *name, size_t len, cctx_T *cctx) |
138 { | 138 { |
139 int idx; | 139 int idx; |
140 | 140 |
141 if (len <= 0) | 141 if (len == 0) |
142 return -1; | 142 return -1; |
143 for (idx = 0; idx < cctx->ctx_locals.ga_len; ++idx) | 143 for (idx = 0; idx < cctx->ctx_locals.ga_len; ++idx) |
144 { | 144 { |
145 lvar_T *lvar = ((lvar_T *)cctx->ctx_locals.ga_data) + idx; | 145 lvar_T *lvar = ((lvar_T *)cctx->ctx_locals.ga_data) + idx; |
146 | 146 |
158 static int | 158 static int |
159 lookup_arg(char_u *name, size_t len, cctx_T *cctx) | 159 lookup_arg(char_u *name, size_t len, cctx_T *cctx) |
160 { | 160 { |
161 int idx; | 161 int idx; |
162 | 162 |
163 if (len <= 0) | 163 if (len == 0) |
164 return -1; | 164 return -1; |
165 for (idx = 0; idx < cctx->ctx_ufunc->uf_args.ga_len; ++idx) | 165 for (idx = 0; idx < cctx->ctx_ufunc->uf_args.ga_len; ++idx) |
166 { | 166 { |
167 char_u *arg = FUNCARG(cctx->ctx_ufunc, idx); | 167 char_u *arg = FUNCARG(cctx->ctx_ufunc, idx); |
168 | 168 |