diff --git a/include/stdlib.h b/include/stdlib.h index d792d3b554..aa259c9d50 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -76,7 +76,7 @@ */ #ifndef CONFIG_DISABLE_ENVIRON -# define environ get_environ_ptr() +# define environ get_environ_ptr() #endif /**************************************************************************** @@ -146,12 +146,12 @@ int rand(void); /* Environment variable support */ #ifndef CONFIG_DISABLE_ENVIRON -FAR char **get_environ_ptr( void ); +FAR char **get_environ_ptr(void); FAR char *getenv(FAR const char *name); int putenv(FAR const char *string); int clearenv(void); -int setenv(const char *name, const char *value, int overwrite); -int unsetenv(const char *name); +int setenv(FAR const char *name, FAR const char *value, int overwrite); +int unsetenv(FAR const char *name); #endif /* Process exit functions */ @@ -172,13 +172,14 @@ void _exit(int status); /* See unistd.h */ /* String to binary conversions */ -long strtol(const char *, char **, int); -unsigned long strtoul(const char *, char **, int); +long strtol(FAR const char *nptr, FAR char **endptr, int base); +unsigned long strtoul(FAR const char *nptr, FAR char **endptr, int base); #ifdef CONFIG_HAVE_LONG_LONG -long long strtoll(const char *, char **, int); -unsigned long long strtoull(const char *, char **, int); +long long strtoll(FAR const char *nptr, FAR char **endptr, int base); +unsigned long long strtoull(FAR const char *nptr, FAR char **endptr, + int base); #endif -double_t strtod(const char *, char **); +double_t strtod(FAR const char *str, FAR char **endptr); #define atoi(nptr) ((int)strtol((nptr), NULL, 10)) #define atol(nptr) strtol((nptr), NULL, 10) @@ -189,13 +190,13 @@ double_t strtod(const char *, char **); /* Binary to string conversions */ -char *itoa(int value, char *str, int base); +FAR char *itoa(int val, FAR char *str, int base); /* Memory Management */ FAR void *malloc(size_t); -void free(FAR void*); -FAR void *realloc(FAR void*, size_t); +void free(FAR void *); +FAR void *realloc(FAR void *, size_t); FAR void *memalign(size_t, size_t); FAR void *zalloc(size_t); FAR void *calloc(size_t, size_t); @@ -203,7 +204,7 @@ FAR void *calloc(size_t, size_t); #ifdef CONFIG_CAN_PASS_STRUCTS struct mallinfo mallinfo(void); #else -int mallinfo(struct mallinfo *info); +int mallinfo(FAR struct mallinfo *info); #endif /* Arithmetic */ @@ -230,7 +231,7 @@ int mkstemp(FAR char *path_template); /* Sorting */ void qsort(FAR void *base, size_t nel, size_t width, - int (*compar)(FAR const void *, FAR const void *)); + CODE int (*compar)(FAR const void *, FAR const void *)); /* Binary search */ diff --git a/libc/stdlib/lib_itoa.c b/libc/stdlib/lib_itoa.c index 16170160aa..ad3563cde9 100644 --- a/libc/stdlib/lib_itoa.c +++ b/libc/stdlib/lib_itoa.c @@ -49,11 +49,11 @@ * Public Functions ****************************************************************************/ -char *itoa(int val, char *str, int base) +FAR char *itoa(int val, FAR char *str, int base) { - static const char *digits = "0123456789abcdefghijklmnopqrstuvwxyz"; + static FAR const char *digits = "0123456789abcdefghijklmnopqrstuvwxyz"; int intval = abs(val), digit, pos, len; - char *buf = str; + FAR char *buf = str; char swap; if (base >= 2 && base <= 36) diff --git a/libc/stdlib/lib_strtod.c b/libc/stdlib/lib_strtod.c index 2f7ed81f55..9b7462368b 100644 --- a/libc/stdlib/lib_strtod.c +++ b/libc/stdlib/lib_strtod.c @@ -87,7 +87,7 @@ static inline int is_real(double x) * ****************************************************************************/ -double_t strtod(const char *str, char **endptr) +double_t strtod(FAR const char *str, FAR char **endptr) { double_t number; int exponent; @@ -238,4 +238,3 @@ double_t strtod(const char *str, char **endptr) } #endif /* CONFIG_HAVE_DOUBLE */ - diff --git a/libc/stdlib/lib_strtol.c b/libc/stdlib/lib_strtol.c index dd17691a07..5518172949 100644 --- a/libc/stdlib/lib_strtol.c +++ b/libc/stdlib/lib_strtol.c @@ -64,7 +64,7 @@ * ****************************************************************************/ -long strtol(const char *nptr, char **endptr, int base) +long strtol(FAR const char *nptr, FAR char **endptr, int base) { unsigned long accum = 0; bool negate = false; @@ -101,4 +101,3 @@ long strtol(const char *nptr, char **endptr, int base) return (long)accum; } - diff --git a/libc/stdlib/lib_strtoll.c b/libc/stdlib/lib_strtoll.c index af4afb90d1..7ed5ecab20 100644 --- a/libc/stdlib/lib_strtoll.c +++ b/libc/stdlib/lib_strtoll.c @@ -66,7 +66,7 @@ * ****************************************************************************/ -long long strtoll(const char *nptr, char **endptr, int base) +long long strtoll(FAR const char *nptr, FAR char **endptr, int base) { unsigned long long accum = 0; bool negate = false; @@ -105,4 +105,3 @@ long long strtoll(const char *nptr, char **endptr, int base) } #endif - diff --git a/libc/stdlib/lib_strtoul.c b/libc/stdlib/lib_strtoul.c index c9b0915e6f..712a658e26 100644 --- a/libc/stdlib/lib_strtoul.c +++ b/libc/stdlib/lib_strtoul.c @@ -63,7 +63,7 @@ * ****************************************************************************/ -unsigned long strtoul(const char *nptr, char **endptr, int base) +unsigned long strtoul(FAR const char *nptr, FAR char **endptr, int base) { unsigned long accum = 0; int value; @@ -96,4 +96,3 @@ unsigned long strtoul(const char *nptr, char **endptr, int base) return accum; } - diff --git a/libc/stdlib/lib_strtoull.c b/libc/stdlib/lib_strtoull.c index 7e961d7333..169058128a 100644 --- a/libc/stdlib/lib_strtoull.c +++ b/libc/stdlib/lib_strtoull.c @@ -64,7 +64,7 @@ * ****************************************************************************/ -unsigned long long strtoull(const char *nptr, char **endptr, int base) +unsigned long long strtoull(FAR const char *nptr, FAR char **endptr, int base) { unsigned long long accum = 0; int value; @@ -96,5 +96,5 @@ unsigned long long strtoull(const char *nptr, char **endptr, int base) } return accum; } -#endif +#endif diff --git a/mm/umm_heap/umm_mallinfo.c b/mm/umm_heap/umm_mallinfo.c index f7a5b9dc07..a6c1aaa847 100644 --- a/mm/umm_heap/umm_mallinfo.c +++ b/mm/umm_heap/umm_mallinfo.c @@ -69,7 +69,7 @@ struct mallinfo mallinfo(void) #else -int mallinfo(struct mallinfo *info) +int mallinfo(FAR struct mallinfo *info) { return mm_mallinfo(USR_HEAP, info); }