mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 06:28:35 +00:00
Use memset instead of vim_memset
Ran some commands on terminal, reviewed changes, and made some manual changes too. find src | xargs perl -i -p -e "s/vim_memset/memset/g" git grep -l memset | egrep "\.c$" | xargs perl -i -p -e \ 's/(#include "vim\.h")/#include <string.h>\n\n\1/g'
This commit is contained in:

committed by
Thiago de Arruda

parent
68bc6bce29
commit
ed3e9d51ac
20
src/misc2.c
20
src/misc2.c
@@ -10,6 +10,8 @@
|
||||
/*
|
||||
* misc2.c: Various functions.
|
||||
*/
|
||||
#include <string.h>
|
||||
|
||||
#include "vim.h"
|
||||
#include "misc2.h"
|
||||
#include "file_search.h"
|
||||
@@ -716,7 +718,7 @@ char_u *alloc_clear(unsigned size)
|
||||
|
||||
p = lalloc((long_u)size, TRUE);
|
||||
if (p != NULL)
|
||||
(void)vim_memset(p, 0, (size_t)size);
|
||||
(void)memset(p, 0, (size_t)size);
|
||||
return p;
|
||||
}
|
||||
|
||||
@@ -745,7 +747,7 @@ char_u *lalloc_clear(long_u size, int message)
|
||||
|
||||
p = (lalloc(size, message));
|
||||
if (p != NULL)
|
||||
(void)vim_memset(p, 0, (size_t)size);
|
||||
(void)memset(p, 0, (size_t)size);
|
||||
return p;
|
||||
}
|
||||
|
||||
@@ -1406,20 +1408,6 @@ void vim_free(void *x)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef HAVE_MEMSET
|
||||
void * vim_memset(ptr, c, size)
|
||||
void *ptr;
|
||||
int c;
|
||||
size_t size;
|
||||
{
|
||||
char *p = ptr;
|
||||
|
||||
while (size-- > 0)
|
||||
*p++ = c;
|
||||
return ptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef VIM_MEMCMP
|
||||
/*
|
||||
* Return zero when "b1" and "b2" are the same for "len" bytes.
|
||||
|
Reference in New Issue
Block a user