string: use __restrict instead of restrict for C++ compatibility

This commit is contained in:
Lephe 2021-04-27 14:46:07 +02:00
parent 50cbcd4ac1
commit 74b2dbeb36
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
4 changed files with 6 additions and 4 deletions

View File

@ -104,6 +104,7 @@ void *dma_memset(void *dst, uint32_t pattern, size_t size);
@dst Destination address (32-aligned)
@dst Source addresss (32-aligned)
@size Size of region (32-aligned) */
void *dma_memcpy(void * restrict dst, const void * restrict src, size_t size);
void *dma_memcpy(void * __restrict dst, const void * __restrict src,
size_t size);
#endif /* GINT_DMA */

View File

@ -8,7 +8,7 @@
#include <stddef.h>
/* memcpy(): Copy a chunk of memory to a non-overlapping destination */
void *memcpy(void * restrict dest, void const * restrict src, size_t n);
void *memcpy(void * __restrict dest, void const * __restrict src, size_t n);
/* memset(): Fill a chunk of memory with a single byte */
void *memset(void *dest, int byte, size_t n);

View File

@ -1,7 +1,8 @@
#include <gint/dma.h>
/* dma_memcpy(): Fast 32-aligned memcpy */
void *dma_memcpy(void * restrict dst, const void * restrict src, size_t size)
void *dma_memcpy(void * __restrict dst, const void * __restrict src,
size_t size)
{
dma_transfer(1, DMA_32B, size >> 5, src, DMA_INC, dst, DMA_INC);
dma_transfer_wait(1);

View File

@ -50,7 +50,7 @@ void gint_setrestart(int restart)
@l Source pointer (load address)
@s Size of area (should be a multiple of 16)
@r Destination pointer (relocation address) */
static void regcpy(uint32_t * restrict l, int32_t s, uint32_t * restrict r)
static void regcpy(uint32_t * __restrict l, int32_t s, uint32_t * __restrict r)
{
while(s > 0)
{