Skip to content

Commit

Permalink
Fix caddr_t compilation errors (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasilva authored Oct 3, 2023
1 parent 83c50fd commit 694db0e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ int _isatty (int fd)
#endif

#if (defined(__GNUC__) && (!defined(KDS)) && (!defined(ATOLLIC)))
caddr_t
void *
_sbrk (int incr)
{
extern char end asm ("end");
Expand All @@ -84,12 +84,12 @@ _sbrk (int incr)
if (heap_end + incr > &heap_limit)
{
errno = ENOMEM;
return (caddr_t) -1;
return (void *) -1;
}

heap_end += incr;

return (caddr_t) prev_heap_end;
return (void *) prev_heap_end;
}
#endif

Expand Down
6 changes: 3 additions & 3 deletions tools/sdk/ksdk1.1.0/platform/utilities/src/syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ int _write(int32_t file, uint8_t *ptr, int32_t len)
return len;
}

caddr_t _sbrk(int32_t incr)
void * _sbrk(int32_t incr)
{
extern uint8_t end asm("end");
static uint8_t *heap_end;
Expand All @@ -93,12 +93,12 @@ caddr_t _sbrk(int32_t incr)
// write(1, "Heap and stack collision\n", 25);
// abort();
errno = ENOMEM;
return (caddr_t) -1;
return (void *) -1;
}

heap_end += incr;

return (caddr_t) prev_heap_end;
return (void *) prev_heap_end;
}

int _close(int32_t file)
Expand Down

0 comments on commit 694db0e

Please sign in to comment.