comparison src/misc2.c @ 10430:37a441352da2 v8.0.0109

commit https://github.com/vim/vim/commit/b129a447f3b580d4c941869672b0557c52c37e4d Author: Bram Moolenaar <Bram@vim.org> Date: Thu Dec 1 17:25:20 2016 +0100 patch 8.0.0109 Problem: Still checking if memcmp() exists while every system should have it now. Solution: Remove vim_memcmp(). (James McCoy, closes https://github.com/vim/vim/issues/1295)
author Christian Brabandt <cb@256bit.org>
date Thu, 01 Dec 2016 17:30:05 +0100
parents 56cb9538386c
children 222b1432814e
comparison
equal deleted inserted replaced
10429:71632fef5928 10430:37a441352da2
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 #ifdef VIM_MEMCMP
1744 /*
1745 * Return zero when "b1" and "b2" are the same for "len" bytes.
1746 * Return non-zero otherwise.
1747 */
1748 int
1749 vim_memcmp(void *b1, void *b2, size_t len)
1750 {
1751 char_u *p1 = (char_u *)b1, *p2 = (char_u *)b2;
1752
1753 for ( ; len > 0; --len)
1754 {
1755 if (*p1 != *p2)
1756 return 1;
1757 ++p1;
1758 ++p2;
1759 }
1760 return 0;
1761 } 1740 }
1762 #endif 1741 #endif
1763 1742
1764 /* skipped when generating prototypes, the prototype is in vim.h */ 1743 /* skipped when generating prototypes, the prototype is in vim.h */
1765 #ifdef VIM_MEMMOVE 1744 #ifdef VIM_MEMMOVE