1
0
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:
jespergravgaard 2019-06-21 00:39:58 +02:00
parent 7b2b8897a6
commit 3ff8effc51
2 changed files with 4 additions and 4 deletions

View File

@ -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 {

View File

@ -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