diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2014-11-28 18:13:28 +0000 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-11-28 18:19:38 +0000 |
commit | 3ef8e4f33ea81c81b9d6a3f093765d5e161238b0 (patch) | |
tree | 88284a3826a6fe027f4036e49a3ea0312272ea26 /src | |
parent | 3e665efea47911bcbe94485dd35efa4c3062c662 (diff) | |
download | rneovim-3ef8e4f33ea81c81b9d6a3f093765d5e161238b0.tar.gz rneovim-3ef8e4f33ea81c81b9d6a3f093765d5e161238b0.tar.bz2 rneovim-3ef8e4f33ea81c81b9d6a3f093765d5e161238b0.zip |
Wconversion: fix #1578
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/ex_eval.c | 10 | ||||
-rw-r--r-- | src/nvim/file_search.c | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/nvim/ex_eval.c b/src/nvim/ex_eval.c index ef3facb18b..196f8e6136 100644 --- a/src/nvim/ex_eval.c +++ b/src/nvim/ex_eval.c @@ -386,21 +386,19 @@ int do_intthrow(struct condstack *cstack) char_u *get_exception_string(void *value, int type, char_u *cmdname, int *should_free) { char_u *ret, *mesg; - int cmdlen; char_u *p, *val; if (type == ET_ERROR) { *should_free = FALSE; mesg = ((struct msglist *)value)->throw_msg; if (cmdname != NULL && *cmdname != NUL) { - cmdlen = (int)STRLEN(cmdname); - ret = vim_strnsave((char_u *)"Vim(", - 4 + cmdlen + 2 + (int)STRLEN(mesg)); + size_t cmdlen = STRLEN(cmdname); + ret = vim_strnsave((char_u *)"Vim(", 4 + cmdlen + 2 + STRLEN(mesg)); STRCPY(&ret[4], cmdname); STRCPY(&ret[4 + cmdlen], "):"); val = ret + 4 + cmdlen + 2; } else { - ret = vim_strnsave((char_u *)"Vim:", 4 + (int)STRLEN(mesg)); + ret = vim_strnsave((char_u *)"Vim:", 4 + STRLEN(mesg)); val = ret + 4; } @@ -708,7 +706,7 @@ static void report_pending(int action, int pending, void *value) if (pending & CSTP_THROW) { vim_snprintf((char *)IObuff, IOSIZE, (char *)mesg, _("Exception")); - mesg = vim_strnsave(IObuff, (int)STRLEN(IObuff) + 4); + mesg = vim_strnsave(IObuff, STRLEN(IObuff) + 4); STRCAT(mesg, ": %s"); s = (char *)((except_T *)value)->value; } else if ((pending & CSTP_ERROR) && (pending & CSTP_INTERRUPT)) diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c index a51f088586..9267e7991c 100644 --- a/src/nvim/file_search.c +++ b/src/nvim/file_search.c @@ -308,7 +308,7 @@ vim_findfile_init ( && (vim_ispathsep(path[1]) || path[1] == NUL) && (!tagfile || vim_strchr(p_cpo, CPO_DOTTAG) == NULL) && rel_fname != NULL) { - int len = (int)(path_tail(rel_fname) - rel_fname); + size_t len = (size_t)(path_tail(rel_fname) - rel_fname); if (!vim_isAbsName(rel_fname) && len + 1 < MAXPATHL) { /* Make the start dir an absolute path name. */ @@ -375,8 +375,9 @@ vim_findfile_init ( search_ctx->ffsc_stopdirs_v = ptr; walker = vim_strchr(walker, ';'); if (walker) { + assert(walker - helper >= 0); search_ctx->ffsc_stopdirs_v[dircount-1] = - vim_strnsave(helper, (int)(walker - helper)); + vim_strnsave(helper, (size_t)(walker - helper)); walker++; } else /* this might be "", which means ascent till top @@ -404,7 +405,8 @@ vim_findfile_init ( char *errpt; /* save the fix part of the path */ - search_ctx->ffsc_fix_path = vim_strnsave(path, (int)(wc_part - path)); + assert(wc_part - path >= 0); + search_ctx->ffsc_fix_path = vim_strnsave(path, (size_t)(wc_part - path)); /* * copy wc_path and add restricts to the '**' wildcard. |