comparison src/misc1.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 072ad890c227
children 80b4e604d1d5
comparison
equal deleted inserted replaced
20829:3d0d6410aecd 20830:9064044fd4f6
1793 1793
1794 #ifdef MACOS_X 1794 #ifdef MACOS_X
1795 if (p == exe_name || p == p_hf) 1795 if (p == exe_name || p == p_hf)
1796 #endif 1796 #endif
1797 // check that the result is a directory name 1797 // check that the result is a directory name
1798 p = vim_strnsave(p, (int)(pend - p)); 1798 p = vim_strnsave(p, pend - p);
1799 1799
1800 if (p != NULL && !mch_isdir(p)) 1800 if (p != NULL && !mch_isdir(p))
1801 VIM_CLEAR(p); 1801 VIM_CLEAR(p);
1802 else 1802 else
1803 { 1803 {
2574 { 2574 {
2575 char_u *p; 2575 char_u *p;
2576 2576
2577 #ifdef MSWIN 2577 #ifdef MSWIN
2578 p = gettail(p_sh); 2578 p = gettail(p_sh);
2579 p = vim_strnsave(p, (int)(skiptowhite(p) - p)); 2579 p = vim_strnsave(p, skiptowhite(p) - p);
2580 #else 2580 #else
2581 p = skiptowhite(p_sh); 2581 p = skiptowhite(p_sh);
2582 if (*p == NUL) 2582 if (*p == NUL)
2583 { 2583 {
2584 // No white space, use the tail. 2584 // No white space, use the tail.
2591 // Find the last path separator before the space. 2591 // Find the last path separator before the space.
2592 p1 = p_sh; 2592 p1 = p_sh;
2593 for (p2 = p_sh; p2 < p; MB_PTR_ADV(p2)) 2593 for (p2 = p_sh; p2 < p; MB_PTR_ADV(p2))
2594 if (vim_ispathsep(*p2)) 2594 if (vim_ispathsep(*p2))
2595 p1 = p2 + 1; 2595 p1 = p2 + 1;
2596 p = vim_strnsave(p1, (int)(p - p1)); 2596 p = vim_strnsave(p1, p - p1);
2597 } 2597 }
2598 #endif 2598 #endif
2599 return p; 2599 return p;
2600 } 2600 }
2601 2601