summaryrefslogtreecommitdiff
path: root/Source/Library/Common/CMem.ns.cpp
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-12-17 11:18:19 +0100
committerAlexis211 <alexis211@gmail.com>2009-12-17 11:18:19 +0100
commit4f9078c0f06e0cf0cb7bb164fc72fb9918c68e6a (patch)
tree34815307b54bf8639ba89f2efddf03e96ee4c0d0 /Source/Library/Common/CMem.ns.cpp
parent3d5aca66b9712758aecb2e80bc5b2fb3df6256a4 (diff)
downloadMelon-4f9078c0f06e0cf0cb7bb164fc72fb9918c68e6a.tar.gz
Melon-4f9078c0f06e0cf0cb7bb164fc72fb9918c68e6a.zip
Added some option handling featurs to the default ShellApp class
Diffstat (limited to 'Source/Library/Common/CMem.ns.cpp')
-rw-r--r--Source/Library/Common/CMem.ns.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/Source/Library/Common/CMem.ns.cpp b/Source/Library/Common/CMem.ns.cpp
index 37cdf0c..a4da4d2 100644
--- a/Source/Library/Common/CMem.ns.cpp
+++ b/Source/Library/Common/CMem.ns.cpp
@@ -3,9 +3,17 @@
namespace CMem {
//Standard C functions
-u8int *memcpy(u8int *dest, const u8int *src, int count) {
- for (int i = 0; i < count; i++) {
- dest[i] = src[i];
+u8int *memcpy(u8int *dest, const u8int *src, u32int count) {
+ u32int f = count % 4, n = count / 4;
+ const u32int* s = (u32int*)src;
+ u32int* d = (u32int*)dest;
+ for (u32int i = 0; i < n; i++) {
+ d[i] = s[i];
+ }
+ if (f != 0) {
+ for (u32int i = count - f; i < count; i++) {
+ dest[i] = src[i];
+ }
}
return dest;
}