From 24c1359ec88d5c00e1e8376b46856519f706a440 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Wed, 3 Feb 2010 14:44:45 +0800 Subject: [PATCH] Cleanups that will hopefully allow compilation in more strict environments --- Kernel/arch/x86/lib.c | 20 ++++++++++---------- Kernel/include/acess.h | 10 +++++----- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Kernel/arch/x86/lib.c b/Kernel/arch/x86/lib.c index a3c4fa6b..7fa666fa 100644 --- a/Kernel/arch/x86/lib.c +++ b/Kernel/arch/x86/lib.c @@ -49,10 +49,10 @@ Uint32 ind(Uint16 Port) } /** - * \fn void *memset(void *Dest, int Val, Uint Num) + * \fn void *memset(void *Dest, int Val, size_t Num) * \brief Do a byte granuality set of Dest */ -void *memset(void *Dest, int Val, Uint Num) +void *memset(void *Dest, int Val, size_t Num) { __asm__ __volatile__ ( "rep stosl;\n\t" @@ -62,19 +62,19 @@ void *memset(void *Dest, int Val, Uint Num) return Dest; } /** - * \fn void *memsetd(void *Dest, Uint Val, Uint Num) + * \brief Set double words */ -void *memsetd(void *Dest, Uint Val, Uint Num) +void *memsetd(void *Dest, Uint32 Val, size_t Num) { __asm__ __volatile__ ("rep stosl" :: "D" (Dest), "a" (Val), "c" (Num)); return Dest; } /** - * \fn int memcmp(const void *m1, const void *m2, Uint Num) + * \fn int memcmp(const void *m1, const void *m2, size_t Num) * \brief Compare two pieces of memory */ -int memcmp(const void *m1, const void *m2, Uint Num) +int memcmp(const void *m1, const void *m2, size_t Num) { while(Num--) { @@ -86,10 +86,10 @@ int memcmp(const void *m1, const void *m2, Uint Num) } /** - * \fn void *memcpy(void *Dest, const void *Src, Uint Num) + * \fn void *memcpy(void *Dest, const void *Src, size_t Num) * \brief Copy \a Num bytes from \a Src to \a Dest */ -void *memcpy(void *Dest, const void *Src, Uint Num) +void *memcpy(void *Dest, const void *Src, size_t Num) { if((Uint)Dest & 3 || (Uint)Src & 3) __asm__ __volatile__ ("rep movsb" :: "D" (Dest), "S" (Src), "c" (Num)); @@ -103,10 +103,10 @@ void *memcpy(void *Dest, const void *Src, Uint Num) return Dest; } /** - * \fn void *memcpyd(void *Dest, const void *Src, Uint Num) + * \fn void *memcpyd(void *Dest, const void *Src, size_t Num) * \brief Copy \a Num DWORDs from \a Src to \a Dest */ -void *memcpyd(void *Dest, const void *Src, Uint Num) +void *memcpyd(void *Dest, const void *Src, size_t Num) { __asm__ __volatile__ ("rep movsl" :: "D" (Dest), "S" (Src), "c" (Num)); return Dest; diff --git a/Kernel/include/acess.h b/Kernel/include/acess.h index 930e3238..c4a1c5f8 100644 --- a/Kernel/include/acess.h +++ b/Kernel/include/acess.h @@ -257,11 +257,11 @@ extern void MM_DerefPhys(tPAddr PAddr); * \name Memory Manipulation * \{ */ -extern int memcmp(const void *m1, const void *m2, Uint count); -extern void *memcpy(void *dest, const void *src, Uint count); -extern void *memcpyd(void *dest, const void *src, Uint count); -extern void *memset(void *dest, int val, Uint count); -extern void *memsetd(void *dest, Uint val, Uint count); +extern int memcmp(const void *m1, const void *m2, size_t count); +extern void *memcpy(void *dest, const void *src, size_t count); +extern void *memcpyd(void *dest, const void *src, size_t count); +extern void *memset(void *dest, int val, size_t count); +extern void *memsetd(void *dest, Uint32 val, size_t count); /** * \} */ -- 2.20.1