comparison src/userfunc.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 9faab49c880f
children 1693ca876049
comparison
equal deleted inserted replaced
20829:3d0d6410aecd 20830:9064044fd4f6
2697 { 2697 {
2698 ret_type = skipwhite(p + 1); 2698 ret_type = skipwhite(p + 1);
2699 p = skip_type(ret_type); 2699 p = skip_type(ret_type);
2700 if (p > ret_type) 2700 if (p > ret_type)
2701 { 2701 {
2702 ret_type = vim_strnsave(ret_type, (int)(p - ret_type)); 2702 ret_type = vim_strnsave(ret_type, p - ret_type);
2703 p = skipwhite(p); 2703 p = skipwhite(p);
2704 } 2704 }
2705 else 2705 else
2706 { 2706 {
2707 semsg(_("E1056: expected a type: %s"), ret_type); 2707 semsg(_("E1056: expected a type: %s"), ret_type);
2970 if (STRNCMP(p, "trim", 4) == 0) 2970 if (STRNCMP(p, "trim", 4) == 0)
2971 { 2971 {
2972 // Ignore leading white space. 2972 // Ignore leading white space.
2973 p = skipwhite(p + 4); 2973 p = skipwhite(p + 4);
2974 heredoc_trimmed = vim_strnsave(theline, 2974 heredoc_trimmed = vim_strnsave(theline,
2975 (int)(skipwhite(theline) - theline)); 2975 skipwhite(theline) - theline);
2976 } 2976 }
2977 if (*p == NUL) 2977 if (*p == NUL)
2978 skip_until = vim_strsave((char_u *)"."); 2978 skip_until = vim_strsave((char_u *)".");
2979 else 2979 else
2980 skip_until = vim_strnsave(p, (int)(skiptowhite(p) - p)); 2980 skip_until = vim_strnsave(p, skiptowhite(p) - p);
2981 do_concat = FALSE; 2981 do_concat = FALSE;
2982 is_heredoc = TRUE; 2982 is_heredoc = TRUE;
2983 } 2983 }
2984 2984
2985 // Check for ":let v =<< [trim] EOF" 2985 // Check for ":let v =<< [trim] EOF"
3000 if (STRNCMP(p, "trim", 4) == 0) 3000 if (STRNCMP(p, "trim", 4) == 0)
3001 { 3001 {
3002 // Ignore leading white space. 3002 // Ignore leading white space.
3003 p = skipwhite(p + 4); 3003 p = skipwhite(p + 4);
3004 heredoc_trimmed = vim_strnsave(theline, 3004 heredoc_trimmed = vim_strnsave(theline,
3005 (int)(skipwhite(theline) - theline)); 3005 skipwhite(theline) - theline);
3006 } 3006 }
3007 skip_until = vim_strnsave(p, (int)(skiptowhite(p) - p)); 3007 skip_until = vim_strnsave(p, skiptowhite(p) - p);
3008 do_concat = FALSE; 3008 do_concat = FALSE;
3009 is_heredoc = TRUE; 3009 is_heredoc = TRUE;
3010 } 3010 }
3011 } 3011 }
3012 } 3012 }