summaryrefslogtreecommitdiff
path: root/firmware/common/memmove.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/common/memmove.c')
-rw-r--r--firmware/common/memmove.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/firmware/common/memmove.c b/firmware/common/memmove.c
index 599cbc9c01..5f423964bb 100644
--- a/firmware/common/memmove.c
+++ b/firmware/common/memmove.c
@@ -1,30 +1,30 @@
1/* 1/*
2FUNCTION 2FUNCTION
3 <<memmove>>---move possibly overlapping memory 3 <<memmove>>---move possibly overlapping memory
4 4
5INDEX 5INDEX
6 memmove 6 memmove
7 7
8ANSI_SYNOPSIS 8ANSI_SYNOPSIS
9 #include <string.h> 9 #include <string.h>
10 void *memmove(void *<[dst]>, const void *<[src]>, size_t <[length]>); 10 void *memmove(void *<[dst]>, const void *<[src]>, size_t <[length]>);
11 11
12TRAD_SYNOPSIS 12TRAD_SYNOPSIS
13 #include <string.h> 13 #include <string.h>
14 void *memmove(<[dst]>, <[src]>, <[length]>) 14 void *memmove(<[dst]>, <[src]>, <[length]>)
15 void *<[dst]>; 15 void *<[dst]>;
16 void *<[src]>; 16 void *<[src]>;
17 size_t <[length]>; 17 size_t <[length]>;
18 18
19DESCRIPTION 19DESCRIPTION
20 This function moves <[length]> characters from the block of 20 This function moves <[length]> characters from the block of
21 memory starting at <<*<[src]>>> to the memory starting at 21 memory starting at <<*<[src]>>> to the memory starting at
22 <<*<[dst]>>>. <<memmove>> reproduces the characters correctly 22 <<*<[dst]>>>. <<memmove>> reproduces the characters correctly
23 at <<*<[dst]>>> even if the two areas overlap. 23 at <<*<[dst]>>> even if the two areas overlap.
24 24
25 25
26RETURNS 26RETURNS
27 The function returns <[dst]> as passed. 27 The function returns <[dst]> as passed.
28 28
29PORTABILITY 29PORTABILITY
30<<memmove>> is ANSI C. 30<<memmove>> is ANSI C.
@@ -32,7 +32,7 @@ PORTABILITY
32<<memmove>> requires no supporting OS subroutines. 32<<memmove>> requires no supporting OS subroutines.
33 33
34QUICKREF 34QUICKREF
35 memmove ansi pure 35 memmove ansi pure
36*/ 36*/
37 37
38#include "config.h" 38#include "config.h"
@@ -54,15 +54,15 @@ QUICKREF
54 54
55_PTR 55_PTR
56_DEFUN (memmove, (dst_void, src_void, length), 56_DEFUN (memmove, (dst_void, src_void, length),
57 _PTR dst_void _AND 57 _PTR dst_void _AND
58 _CONST _PTR src_void _AND 58 _CONST _PTR src_void _AND
59 size_t length) ICODE_ATTR; 59 size_t length) ICODE_ATTR;
60 60
61_PTR 61_PTR
62_DEFUN (memmove, (dst_void, src_void, length), 62_DEFUN (memmove, (dst_void, src_void, length),
63 _PTR dst_void _AND 63 _PTR dst_void _AND
64 _CONST _PTR src_void _AND 64 _CONST _PTR src_void _AND
65 size_t length) 65 size_t length)
66{ 66{
67#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) 67#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
68 char *dst = dst_void; 68 char *dst = dst_void;
@@ -74,16 +74,16 @@ _DEFUN (memmove, (dst_void, src_void, length),
74 src += length; 74 src += length;
75 dst += length; 75 dst += length;
76 while (length--) 76 while (length--)
77 { 77 {
78 *--dst = *--src; 78 *--dst = *--src;
79 } 79 }
80 } 80 }
81 else 81 else
82 { 82 {
83 while (length--) 83 while (length--)
84 { 84 {
85 *dst++ = *src++; 85 *dst++ = *src++;
86 } 86 }
87 } 87 }
88 88
89 return dst_void; 89 return dst_void;
@@ -100,9 +100,9 @@ _DEFUN (memmove, (dst_void, src_void, length),
100 src += len; 100 src += len;
101 dst += len; 101 dst += len;
102 while (len--) 102 while (len--)
103 { 103 {
104 *--dst = *--src; 104 *--dst = *--src;
105 } 105 }
106 } 106 }
107 else 107 else
108 { 108 {