mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
builtin_{memcpy,memset}: make compatible with libc
1. memcpy() last argument is size_t 2. memset() returns void * Make our builtin_*() functions compatible. https://travis-ci.org/kolyshkin/criu/builds/174634847 Signed-off-by: Kir Kolyshkin <kir@openvz.org> Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
parent
f851da768c
commit
f845d9e4e0
1 changed files with 5 additions and 3 deletions
|
|
@ -4,9 +4,9 @@
|
|||
#include "common/compiler.h"
|
||||
|
||||
#ifndef HAS_BUILTIN_MEMCPY
|
||||
static always_inline void *builtin_memcpy(void *to, const void *from, unsigned int n)
|
||||
static always_inline void *builtin_memcpy(void *to, const void *from, size_t n)
|
||||
{
|
||||
int i;
|
||||
size_t i;
|
||||
unsigned char *cto = to;
|
||||
const unsigned char *cfrom = from;
|
||||
|
||||
|
|
@ -47,13 +47,15 @@ static always_inline int builtin_strncmp(const char *cs, const char *ct, size_t
|
|||
#endif
|
||||
|
||||
#ifndef HAS_BUILTIN_MEMSET
|
||||
static always_inline void builtin_memset(void *s, const int c, size_t count)
|
||||
static always_inline void *builtin_memset(void *s, const int c, size_t count)
|
||||
{
|
||||
char *dest = s;
|
||||
size_t i = 0;
|
||||
|
||||
while (i < count)
|
||||
dest[i++] = (char) c;
|
||||
|
||||
return s;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue