Mercurial > vim
comparison src/ex_eval.c @ 20830:9064044fd4f6 v8.2.0967
patch 8.2.0967: unnecessary type casts for vim_strnsave()
Commit: https://github.com/vim/vim/commit/71ccd03ee8a43b20000214a9c99dcc90f039edca
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jun 12 22:59:11 2020 +0200
patch 8.2.0967: unnecessary type casts for vim_strnsave()
Problem: Unnecessary type casts for vim_strnsave().
Solution: Remove the type casts.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 12 Jun 2020 23:00:04 +0200 |
parents | 9f921ba86d05 |
children | 7ee565134d4a |
comparison
equal
deleted
inserted
replaced
20829:3d0d6410aecd | 20830:9064044fd4f6 |
---|---|
437 mesg = ((msglist_T *)value)->throw_msg; | 437 mesg = ((msglist_T *)value)->throw_msg; |
438 if (cmdname != NULL && *cmdname != NUL) | 438 if (cmdname != NULL && *cmdname != NUL) |
439 { | 439 { |
440 cmdlen = (int)STRLEN(cmdname); | 440 cmdlen = (int)STRLEN(cmdname); |
441 ret = (char *)vim_strnsave((char_u *)"Vim(", | 441 ret = (char *)vim_strnsave((char_u *)"Vim(", |
442 4 + cmdlen + 2 + (int)STRLEN(mesg)); | 442 4 + cmdlen + 2 + STRLEN(mesg)); |
443 if (ret == NULL) | 443 if (ret == NULL) |
444 return ret; | 444 return ret; |
445 STRCPY(&ret[4], cmdname); | 445 STRCPY(&ret[4], cmdname); |
446 STRCPY(&ret[4 + cmdlen], "):"); | 446 STRCPY(&ret[4 + cmdlen], "):"); |
447 val = ret + 4 + cmdlen + 2; | 447 val = ret + 4 + cmdlen + 2; |
448 } | 448 } |
449 else | 449 else |
450 { | 450 { |
451 ret = (char *)vim_strnsave((char_u *)"Vim:", 4 + (int)STRLEN(mesg)); | 451 ret = (char *)vim_strnsave((char_u *)"Vim:", 4 + STRLEN(mesg)); |
452 if (ret == NULL) | 452 if (ret == NULL) |
453 return ret; | 453 return ret; |
454 val = ret + 4; | 454 val = ret + 4; |
455 } | 455 } |
456 | 456 |
804 | 804 |
805 default: | 805 default: |
806 if (pending & CSTP_THROW) | 806 if (pending & CSTP_THROW) |
807 { | 807 { |
808 vim_snprintf((char *)IObuff, IOSIZE, mesg, _("Exception")); | 808 vim_snprintf((char *)IObuff, IOSIZE, mesg, _("Exception")); |
809 mesg = (char *)vim_strnsave(IObuff, (int)STRLEN(IObuff) + 4); | 809 mesg = (char *)vim_strnsave(IObuff, STRLEN(IObuff) + 4); |
810 STRCAT(mesg, ": %s"); | 810 STRCAT(mesg, ": %s"); |
811 s = (char *)((except_T *)value)->value; | 811 s = (char *)((except_T *)value)->value; |
812 } | 812 } |
813 else if ((pending & CSTP_ERROR) && (pending & CSTP_INTERRUPT)) | 813 else if ((pending & CSTP_ERROR) && (pending & CSTP_INTERRUPT)) |
814 s = _("Error and interrupt"); | 814 s = _("Error and interrupt"); |