Mercurial > vim
comparison src/regexp.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 | 2c23053c654a |
children | 3af71cbcfdbe |
comparison
equal
deleted
inserted
replaced
20829:3d0d6410aecd | 20830:9064044fd4f6 |
---|---|
1844 { | 1844 { |
1845 s = rsm.sm_match->startp[i]; | 1845 s = rsm.sm_match->startp[i]; |
1846 if (s == NULL || rsm.sm_match->endp[i] == NULL) | 1846 if (s == NULL || rsm.sm_match->endp[i] == NULL) |
1847 s = NULL; | 1847 s = NULL; |
1848 else | 1848 else |
1849 s = vim_strnsave(s, (int)(rsm.sm_match->endp[i] - s)); | 1849 s = vim_strnsave(s, rsm.sm_match->endp[i] - s); |
1850 li->li_tv.v_type = VAR_STRING; | 1850 li->li_tv.v_type = VAR_STRING; |
1851 li->li_tv.vval.v_string = s; | 1851 li->li_tv.vval.v_string = s; |
1852 li = li->li_next; | 1852 li = li->li_next; |
1853 } | 1853 } |
1854 return argskip + 1; | 1854 return argskip + 1; |
2460 { | 2460 { |
2461 s = rsm.sm_match->startp[no]; | 2461 s = rsm.sm_match->startp[no]; |
2462 if (s == NULL || rsm.sm_match->endp[no] == NULL) | 2462 if (s == NULL || rsm.sm_match->endp[no] == NULL) |
2463 retval = NULL; | 2463 retval = NULL; |
2464 else | 2464 else |
2465 retval = vim_strnsave(s, (int)(rsm.sm_match->endp[no] - s)); | 2465 retval = vim_strnsave(s, rsm.sm_match->endp[no] - s); |
2466 } | 2466 } |
2467 | 2467 |
2468 return retval; | 2468 return retval; |
2469 } | 2469 } |
2470 | 2470 |