1
0
Fork 0
forked from nuttx/nuttx-update

stdlib: Fix forgotten FARs

This commit is contained in:
Paul A. Patience 2015-11-18 14:22:43 -05:00
parent 432395218a
commit bfc95c641f
8 changed files with 25 additions and 28 deletions

View file

@ -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) 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 */

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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);
}