diff options
| author | Daniel Nyström <daniel@nystrom.st> | 2013-05-27 15:16:12 +0200 | 
|---|---|---|
| committer | Daniel Nyström <daniel@nystrom.st> | 2013-06-04 14:17:38 +0200 | 
| commit | 933cbd36a28e7c042b1a55ddfea8d18308c5d632 (patch) | |
| tree | be8a89fbdd13186d654be77e233c8912145dc0ca /wirish | |
| parent | 7a09d748e889145f566923a4a6423a8da9d63d45 (diff) | |
| download | librambutan-933cbd36a28e7c042b1a55ddfea8d18308c5d632.tar.gz librambutan-933cbd36a28e7c042b1a55ddfea8d18308c5d632.zip | |
wirish/syscalls.c: Replace obsolete caddr_t with void *
caddr_t is obsolete in POSIX and thus unavailable in most modern
toolchains. caddr_t usage should be replaced by void *.
stddef.h includes the size_t typedef which was missing.
Signed-off-by: Daniel Nyström <daniel@nystrom.st>
Diffstat (limited to 'wirish')
| -rw-r--r-- | wirish/syscalls.c | 13 | 
1 files changed, 7 insertions, 6 deletions
| diff --git a/wirish/syscalls.c b/wirish/syscalls.c index a3b6d2c..d5f2d9f 100644 --- a/wirish/syscalls.c +++ b/wirish/syscalls.c @@ -37,17 +37,18 @@  #include <sys/stat.h>  #include <errno.h> +#include <stddef.h>  /* If CONFIG_HEAP_START (or CONFIG_HEAP_END) isn't defined, then   * assume _lm_heap_start (resp. _lm_heap_end) is appropriately set by   * the linker */  #ifndef CONFIG_HEAP_START  extern char _lm_heap_start; -#define CONFIG_HEAP_START               ((caddr_t)&_lm_heap_start) +#define CONFIG_HEAP_START               ((void *)&_lm_heap_start)  #endif  #ifndef CONFIG_HEAP_END  extern char _lm_heap_end; -#define CONFIG_HEAP_END                 ((caddr_t)&_lm_heap_end) +#define CONFIG_HEAP_END                 ((void *)&_lm_heap_end)  #endif  /* @@ -56,9 +57,9 @@ extern char _lm_heap_end;   * Get incr bytes more RAM (for use by the heap).  malloc() and   * friends call this function behind the scenes.   */ -caddr_t _sbrk(int incr) { -    static caddr_t pbreak = NULL; /* current program break */ -    caddr_t ret; +void *_sbrk(int incr) { +    static void * pbreak = NULL; /* current program break */ +    void * ret;      if (pbreak == NULL) {          pbreak = CONFIG_HEAP_START; @@ -67,7 +68,7 @@ caddr_t _sbrk(int incr) {      if ((CONFIG_HEAP_END - pbreak < incr) ||          (pbreak - CONFIG_HEAP_START < -incr)) {          errno = ENOMEM; -        return (caddr_t)-1; +        return (void *)-1;      }      ret = pbreak; | 
