mirror of
https://gitlab.com/camelot/kickc.git
synced 2025-02-19 08:31:01 +00:00
Using void pointers in stdlib string.
This commit is contained in:
parent
7b2b8897a6
commit
3ff8effc51
@ -2,7 +2,7 @@
|
||||
|
||||
// Copy block of memory (forwards)
|
||||
// Copies the values of num bytes from the location pointed to by source directly to the memory block pointed to by destination.
|
||||
byte* memcpy( byte* destination, byte* source, word num ) {
|
||||
void* memcpy( void* destination, void* source, word num ) {
|
||||
byte* src = source;
|
||||
byte* dst = destination;
|
||||
for( word i=0; i<num; i++) *dst++ = *src++;
|
||||
@ -11,7 +11,7 @@ byte* memcpy( byte* destination, byte* source, word num ) {
|
||||
|
||||
// Move block of memory
|
||||
// Copies the values of num bytes from the location pointed by source to the memory block pointed by destination. Copying takes place as if an intermediate buffer were used, allowing the destination and source to overlap.
|
||||
byte* memmove( byte* destination, byte* source, word num ) {
|
||||
void* memmove( void* destination, void* source, word num ) {
|
||||
if((word)destination<(word)source) {
|
||||
memcpy(destination, source, num);
|
||||
} else {
|
||||
|
@ -37,12 +37,12 @@ public class TestPrograms {
|
||||
|
||||
@Test
|
||||
public void testCallParameterAutocast() throws IOException, URISyntaxException {
|
||||
compileAndCompare("call-parameter-autocast", log());
|
||||
compileAndCompare("call-parameter-autocast");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPointerVoid2() throws IOException, URISyntaxException {
|
||||
compileAndCompare("pointer-void-2", log());
|
||||
compileAndCompare("pointer-void-2");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
x
Reference in New Issue
Block a user