Merged in paulpatience/nuttx/stdlib (pull request #36)

stdlib: Fix forgotten FARs
This commit is contained in:
Gregory Nutt 2015-11-18 14:01:17 -06:00
commit f699072507
8 changed files with 25 additions and 28 deletions

View File

@ -150,8 +150,8 @@ 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,7 +190,7 @@ 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 */
@ -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);
}