comparison src/misc2.c @ 10702:24a1fbd78b76 v8.0.0241

patch 8.0.0241: fallback implementation of mch_memmove is unused commit https://github.com/vim/vim/commit/52c0de1de196120976fef82cbbaaeafbedd9c62f Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 26 21:36:34 2017 +0100 patch 8.0.0241: fallback implementation of mch_memmove is unused Problem: Vim defines a mch_memmove() function but it doesn't work, thus is always unused. Solution: Remove the mch_memmove implementation. (suggested by Dominique Pelle)
author Christian Brabandt <cb@256bit.org>
date Thu, 26 Jan 2017 21:45:04 +0100
parents 2025bec9175f
children 056e32b99e93
comparison
equal deleted inserted replaced
10701:fe97b963559c 10702:24a1fbd78b76
1735 char *p = ptr; 1735 char *p = ptr;
1736 1736
1737 while (size-- > 0) 1737 while (size-- > 0)
1738 *p++ = c; 1738 *p++ = c;
1739 return ptr; 1739 return ptr;
1740 }
1741 #endif
1742
1743 /* skipped when generating prototypes, the prototype is in vim.h */
1744 #ifdef VIM_MEMMOVE
1745 /*
1746 * Version of memmove() that handles overlapping source and destination.
1747 * For systems that don't have a function that is guaranteed to do that (SYSV).
1748 */
1749 void
1750 mch_memmove(void *src_arg, void *dst_arg, size_t len)
1751 {
1752 /*
1753 * A void doesn't have a size, we use char pointers.
1754 */
1755 char *dst = dst_arg, *src = src_arg;
1756
1757 /* overlap, copy backwards */
1758 if (dst > src && dst < src + len)
1759 {
1760 src += len;
1761 dst += len;
1762 while (len-- > 0)
1763 *--dst = *--src;
1764 }
1765 else /* copy forwards */
1766 while (len-- > 0)
1767 *dst++ = *src++;
1768 } 1740 }
1769 #endif 1741 #endif
1770 1742
1771 #if (!defined(HAVE_STRCASECMP) && !defined(HAVE_STRICMP)) || defined(PROTO) 1743 #if (!defined(HAVE_STRCASECMP) && !defined(HAVE_STRICMP)) || defined(PROTO)
1772 /* 1744 /*