mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 18:55:14 -07:00
Use memcmp instead of vim_memcmp
This commit is contained in:
parent
07dad7acf3
commit
bd78282940
22
src/misc2.c
22
src/misc2.c
@ -1408,28 +1408,6 @@ void vim_free(void *x)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef VIM_MEMCMP
|
||||
/*
|
||||
* Return zero when "b1" and "b2" are the same for "len" bytes.
|
||||
* Return non-zero otherwise.
|
||||
*/
|
||||
int vim_memcmp(b1, b2, len)
|
||||
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
|
||||
|
||||
#if (!defined(HAVE_STRCASECMP) && !defined(HAVE_STRICMP)) || defined(PROTO)
|
||||
/*
|
||||
* Compare two strings, ignoring case, using current locale.
|
||||
|
@ -1366,7 +1366,7 @@ int searchc(cmdarg_T *cap, int t_cmd)
|
||||
if (p[col] == c && stop)
|
||||
break;
|
||||
} else {
|
||||
if (vim_memcmp(p + col, bytes, bytelen) == 0 && stop)
|
||||
if (memcmp(p + col, bytes, bytelen) == 0 && stop)
|
||||
break;
|
||||
}
|
||||
stop = TRUE;
|
||||
|
@ -1927,7 +1927,7 @@ parse_line:
|
||||
mfp2 = ((struct match_found **)
|
||||
(ga_match[mtt].ga_data))[i];
|
||||
if (mfp2->len == mfp->len
|
||||
&& vim_memcmp(mfp2->match, mfp->match,
|
||||
&& memcmp(mfp2->match, mfp->match,
|
||||
(size_t)mfp->len) == 0)
|
||||
break;
|
||||
line_breakcheck();
|
||||
|
11
src/vim.h
11
src/vim.h
@ -1154,17 +1154,6 @@ typedef void *vim_acl_T; /* dummy to pass an ACL to a function */
|
||||
#define fnamencmp(x, y, n) vim_fnamencmp((char_u *)(x), (char_u *)(y), \
|
||||
(size_t)(n))
|
||||
|
||||
#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(OS2) || defined(VMS) \
|
||||
|| defined(FEAT_CLIENTSERVER)
|
||||
# define USE_INPUT_BUF
|
||||
|
Loading…
Reference in New Issue
Block a user