0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.0.0109

Problem:    Still checking if memcmp() exists while every system should have
            it now.
Solution:   Remove vim_memcmp().  (James McCoy, closes #1295)
This commit is contained in:
Bram Moolenaar
2016-12-01 17:25:20 +01:00
parent 65e08ee1d2
commit b129a447f3
9 changed files with 7 additions and 44 deletions

View File

@@ -154,7 +154,6 @@
#undef BAD_GETCWD #undef BAD_GETCWD
/* Define if you the function: */ /* Define if you the function: */
#undef HAVE_BCMP
#undef HAVE_FCHDIR #undef HAVE_FCHDIR
#undef HAVE_FCHOWN #undef HAVE_FCHOWN
#undef HAVE_FSEEKO #undef HAVE_FSEEKO
@@ -170,7 +169,6 @@
#undef HAVE_ICONV #undef HAVE_ICONV
#undef HAVE_NL_LANGINFO_CODESET #undef HAVE_NL_LANGINFO_CODESET
#undef HAVE_LSTAT #undef HAVE_LSTAT
#undef HAVE_MEMCMP
#undef HAVE_MEMSET #undef HAVE_MEMSET
#undef HAVE_MKDTEMP #undef HAVE_MKDTEMP
#undef HAVE_NANOSLEEP #undef HAVE_NANOSLEEP

View File

@@ -3594,8 +3594,8 @@ fi
dnl Check for functions in one big call, to reduce the size of configure. dnl Check for functions in one big call, to reduce the size of configure.
dnl Can only be used for functions that do not require any include. dnl Can only be used for functions that do not require any include.
AC_CHECK_FUNCS(bcmp fchdir fchown fsync getcwd getpseudotty \ AC_CHECK_FUNCS(fchdir fchown fsync getcwd getpseudotty \
getpwent getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \ getpwent getpwnam getpwuid getrlimit gettimeofday getwd lstat \
memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \ memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \
setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \ setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
sigprocmask sigvec strcasecmp strerror strftime stricmp strncasecmp \ sigprocmask sigvec strcasecmp strerror strftime stricmp strncasecmp \

View File

@@ -1740,27 +1740,6 @@ vim_memset(void *ptr, int c, size_t size)
} }
#endif #endif
#ifdef VIM_MEMCMP
/*
* Return zero when "b1" and "b2" are the same for "len" bytes.
* Return non-zero otherwise.
*/
int
vim_memcmp(void *b1, void *b2, size_t len)
{
char_u *p1 = (char_u *)b1, *p2 = (char_u *)b2;
for ( ; len > 0; --len)
{
if (*p1 != *p2)
return 1;
++p1;
++p2;
}
return 0;
}
#endif
/* skipped when generating prototypes, the prototype is in vim.h */ /* skipped when generating prototypes, the prototype is in vim.h */
#ifdef VIM_MEMMOVE #ifdef VIM_MEMMOVE
/* /*

View File

@@ -101,7 +101,6 @@
#define HAVE_STRTOL #define HAVE_STRTOL
#define HAVE_TGETENT #define HAVE_TGETENT
#define HAVE_MEMSET #define HAVE_MEMSET
#define HAVE_MEMCMP
#define HAVE_STRERROR #define HAVE_STRERROR
#define HAVE_FCHOWN #define HAVE_FCHOWN
#define HAVE_RENAME #define HAVE_RENAME

View File

@@ -50,12 +50,7 @@ extern int poll(struct pollfd *, long, int);
#ifdef HAVE_MEMSET #ifdef HAVE_MEMSET
extern void *memset(void *, int, size_t); extern void *memset(void *, int, size_t);
#endif #endif
#ifdef HAVE_BCMP
extern int bcmp(void *, void *, size_t);
#endif
#ifdef HAVE_MEMCMP
extern int memcmp(const void *, const void *, size_t); extern int memcmp(const void *, const void *, size_t);
#endif
#ifdef HAVE_STRPBRK #ifdef HAVE_STRPBRK
extern char *strpbrk(const char *, const char *); extern char *strpbrk(const char *, const char *);
#endif #endif

View File

@@ -1695,7 +1695,8 @@ searchc(cmdarg_T *cap, int t_cmd)
} }
else else
{ {
if (vim_memcmp(p + col, lastc_bytes, lastc_bytelen) == 0 && stop) if (memcmp(p + col, lastc_bytes, lastc_bytelen) == 0
&& stop)
break; break;
} }
stop = TRUE; stop = TRUE;

View File

@@ -2400,7 +2400,7 @@ parse_line:
mfp2 = ((struct match_found **) mfp2 = ((struct match_found **)
(ga_match[mtt].ga_data))[i]; (ga_match[mtt].ga_data))[i];
if (mfp2->len == mfp->len if (mfp2->len == mfp->len
&& vim_memcmp(mfp2->match, mfp->match, && memcmp(mfp2->match, mfp->match,
(size_t)mfp->len) == 0) (size_t)mfp->len) == 0)
break; break;
fast_breakcheck(); fast_breakcheck();

View File

@@ -764,6 +764,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
109,
/**/ /**/
108, 108,
/**/ /**/

View File

@@ -1733,17 +1733,6 @@ void mch_memmove(void *, void *, size_t);
void *vim_memset(void *, int, size_t); void *vim_memset(void *, int, size_t);
#endif #endif
#ifdef HAVE_MEMCMP
# define vim_memcmp(p1, p2, len) memcmp((p1), (p2), (len))
#else
# ifdef HAVE_BCMP
# define vim_memcmp(p1, p2, len) bcmp((p1), (p2), (len))
# else
int vim_memcmp(void *, void *, size_t);
# define VIM_MEMCMP
# endif
#endif
#if defined(UNIX) || defined(FEAT_GUI) || defined(VMS) \ #if defined(UNIX) || defined(FEAT_GUI) || defined(VMS) \
|| defined(FEAT_CLIENTSERVER) || defined(FEAT_CLIENTSERVER)
# define USE_INPUT_BUF # define USE_INPUT_BUF