mirror of
https://github.com/apache/nuttx.git
synced 2026-09-20 21:06:58 +08:00
libs: fix nxstyle errors
fix erros reported by nxstyle Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
This commit is contained in:
committed by
Xiang Xiao
parent
8975a65197
commit
ed8e5e971b
@@ -115,7 +115,8 @@ double __cos(double x, double y)
|
||||
z = x * x;
|
||||
w = z * z;
|
||||
r =
|
||||
z * (g_c1 + z * (g_c2 + z * g_c3)) + w * w * (g_c4 + z * (g_c5 + z * g_c6));
|
||||
z * (g_c1 + z * (g_c2 + z * g_c3)) +
|
||||
w * w * (g_c4 + z * (g_c5 + z * g_c6));
|
||||
hz = 0.5 * z;
|
||||
w = 1.0 - hz;
|
||||
|
||||
|
||||
@@ -56,7 +56,8 @@
|
||||
static double asin_aux(double x)
|
||||
{
|
||||
long double y;
|
||||
double y_cos, y_sin;
|
||||
double y_cos;
|
||||
double y_sin;
|
||||
|
||||
y = 0.0;
|
||||
y_sin = 0.0;
|
||||
|
||||
@@ -44,7 +44,8 @@
|
||||
static float asinf_aux(float x)
|
||||
{
|
||||
double y;
|
||||
float y_sin, y_cos;
|
||||
float y_sin;
|
||||
float y_cos;
|
||||
|
||||
y = 0.0;
|
||||
y_sin = 0.0F;
|
||||
|
||||
@@ -43,7 +43,9 @@
|
||||
|
||||
static long double asinl_aux(long double x)
|
||||
{
|
||||
long double y, y_cos, y_sin;
|
||||
long double y;
|
||||
long double y_cos;
|
||||
long double y_sin;
|
||||
|
||||
y = 0.0;
|
||||
y_sin = 0.0;
|
||||
|
||||
@@ -77,7 +77,8 @@ double erf(double x)
|
||||
|
||||
z = fabs(x);
|
||||
t = 1.0 / (1.0 + P * z);
|
||||
t = 1.0 - (((((A5 * t + A4) * t) + A3) * t + A2) * t + A1) * t * exp(-z * z);
|
||||
t = 1.0 -
|
||||
(((((A5 * t + A4) * t) + A3) * t + A2) * t + A1) * t * exp(-z * z);
|
||||
return copysign(t, x);
|
||||
}
|
||||
|
||||
|
||||
@@ -75,6 +75,7 @@ float erff(float x)
|
||||
|
||||
z = fabsf(x);
|
||||
t = 1.0F / (1.0F + P * z);
|
||||
t = 1.0F - (((((A5 * t + A4) * t) + A3) * t + A2) * t + A1) * t * expf(-z * z);
|
||||
t = 1.0F -
|
||||
(((((A5 * t + A4) * t) + A3) * t + A2) * t + A1) * t * expf(-z * z);
|
||||
return copysignf(t, x);
|
||||
}
|
||||
|
||||
@@ -61,11 +61,13 @@ long double erfl(long double x)
|
||||
* erf comes from formula 7.1.26
|
||||
*/
|
||||
|
||||
long double t, z;
|
||||
long double t;
|
||||
long double z;
|
||||
|
||||
z = fabsl(x);
|
||||
t = 1.0 / (1.0 + P * z);
|
||||
t = 1.0 - (((((A5 * t + A4) * t) + A3) * t + A2) * t + A1) * t * expl(-z * z);
|
||||
t = 1.0 -
|
||||
(((((A5 * t + A4) * t) + A3) * t + A2) * t + A1) * t * expl(-z * z);
|
||||
return copysignl(t, x);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -62,6 +62,5 @@ long double floorl(long double x)
|
||||
}
|
||||
|
||||
return modx;
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -72,7 +72,6 @@ double log(double x)
|
||||
iter = 0;
|
||||
relax_factor = 1;
|
||||
|
||||
|
||||
while (y > y_old + epsilon || y < y_old - epsilon)
|
||||
{
|
||||
y_old = y;
|
||||
|
||||
@@ -71,6 +71,10 @@
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
double rint(double x)
|
||||
{
|
||||
long linteger;
|
||||
|
||||
@@ -71,6 +71,10 @@
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
float rintf(float x)
|
||||
{
|
||||
long linteger;
|
||||
|
||||
@@ -71,6 +71,10 @@
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
long double rintl(long double x)
|
||||
{
|
||||
int64_t llinteger;
|
||||
|
||||
@@ -44,7 +44,8 @@
|
||||
#ifdef CONFIG_HAVE_DOUBLE
|
||||
double sqrt(double x)
|
||||
{
|
||||
long double y, y1;
|
||||
long double y;
|
||||
long double y1;
|
||||
|
||||
if (x < 0.0)
|
||||
{
|
||||
|
||||
@@ -44,7 +44,8 @@
|
||||
#ifdef CONFIG_HAVE_LONG_DOUBLE
|
||||
long double sqrtl(long double x)
|
||||
{
|
||||
long double y, y1;
|
||||
long double y;
|
||||
long double y1;
|
||||
|
||||
/* Filter out invalid/trivial inputs */
|
||||
|
||||
@@ -56,17 +57,17 @@ long double sqrtl(long double x)
|
||||
|
||||
if (isnan(x))
|
||||
{
|
||||
return NAN;
|
||||
return NAN;
|
||||
}
|
||||
|
||||
if (isinf(x))
|
||||
{
|
||||
return INFINITY;
|
||||
return INFINITY;
|
||||
}
|
||||
|
||||
if (x == 0.0)
|
||||
{
|
||||
return 0.0;
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
/* Guess square root (using bit manipulation) */
|
||||
|
||||
@@ -59,9 +59,10 @@ union ldshape
|
||||
long double truncl(long double x)
|
||||
{
|
||||
union ldshape u =
|
||||
{
|
||||
x
|
||||
};
|
||||
{
|
||||
x
|
||||
};
|
||||
|
||||
int e = u.i.se & 0x7fff;
|
||||
int s = u.i.se >> 15;
|
||||
long double y;
|
||||
@@ -78,7 +79,7 @@ long double truncl(long double x)
|
||||
|
||||
__x = (x + 0x1p120f);
|
||||
UNUSED(__x);
|
||||
return x*0;
|
||||
return x * 0;
|
||||
}
|
||||
|
||||
/* y = int(|x|) - |x|, where int(|x|) is an integer neighbor of |x| */
|
||||
|
||||
@@ -6,19 +6,14 @@
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* References:
|
||||
*
|
||||
* crc16_tab calculated by Mark G. Mendel, Network Systems Corporation.
|
||||
* crc16part() logic derived from article Copyright (C) 1986 Stephen Satchell.
|
||||
*
|
||||
* "Programmers may incorporate any or all code into their programs,
|
||||
* giving proper credit within the source. Publication of the
|
||||
* source routines is permitted so long as proper credit is given
|
||||
* to Stephen Satchell, Satchell Evaluations and Chuck Forsberg,
|
||||
* Omen Technology."
|
||||
*
|
||||
* Re-released under the Modified BSD license which, I believe, is consistent with the
|
||||
* original authors' intent:
|
||||
* Re-released under the Modified BSD license which, I believe, is
|
||||
* consistent with the original authors' intent:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -49,6 +44,13 @@
|
||||
*
|
||||
************************************************************************************************/
|
||||
|
||||
/* References:
|
||||
*
|
||||
* crc16_tab calculated by Mark G. Mendel, Network Systems Corporation.
|
||||
* crc16part() logic derived from article Copyright (C) 1986 Stephen
|
||||
* Satchell.
|
||||
*/
|
||||
|
||||
/************************************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************************/
|
||||
@@ -102,6 +104,7 @@ static uint16_t crc16_tab[256] =
|
||||
/************************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************************/
|
||||
|
||||
/************************************************************************************************
|
||||
* Name: crc16part
|
||||
*
|
||||
@@ -116,7 +119,8 @@ uint16_t crc16part(FAR const uint8_t *src, size_t len, uint16_t crc16val)
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
crc16val = crc16_tab[((crc16val >> 8) & 0xff) ^ src[i]] ^ (crc16val << 8);
|
||||
crc16val = crc16_tab[((crc16val >> 8) & 0xff) ^
|
||||
src[i]] ^ (crc16val << 8);
|
||||
}
|
||||
|
||||
return crc16val;
|
||||
|
||||
@@ -90,6 +90,7 @@ static const uint32_t crc32_tab[] =
|
||||
/************************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************************/
|
||||
|
||||
/************************************************************************************************
|
||||
* Name: crc32part
|
||||
*
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
/****************************************************************************
|
||||
* CRC8 table generated with:
|
||||
*
|
||||
* #define POLY 0xB2 // ((uint8_t) 0x14D) ^ 0xFF
|
||||
* #define POLY 0xB2 ((uint8_t) 0x14D) ^ 0xFF
|
||||
*
|
||||
* printf(" ");
|
||||
* for (y = 0; y < 256; y++)
|
||||
|
||||
@@ -188,18 +188,19 @@ FAR char *envpath_next(ENVPATH_HANDLE handle, FAR const char *relpath)
|
||||
|
||||
path = envpath->next;
|
||||
if (*path == '\0')
|
||||
{
|
||||
/* If it points to a NULL it means that either (1) the PATH varialbe
|
||||
* is empty, or (2) we have already examined all of the paths in the
|
||||
* path variable.
|
||||
{
|
||||
/* If it points to a NULL it means that either (1) the PATH
|
||||
* varialbe is empty, or (2) we have already examined all of the
|
||||
* paths in the path variable.
|
||||
*/
|
||||
|
||||
return (FAR char *)NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Okay... 'path' points to the beginning of the string. The string may
|
||||
* be terminated either with (1) ':' which separates the path from the
|
||||
* next path in the list, or (2) NUL which marks the end of the list.
|
||||
/* Okay... 'path' points to the beginning of the string. The string
|
||||
* may be terminated either with (1) ':' which separates the path from
|
||||
* the next path in the list, or (2) NUL which marks the end of the
|
||||
* list.
|
||||
*/
|
||||
|
||||
endptr = strchr(path, ':');
|
||||
|
||||
@@ -94,9 +94,9 @@ static int kbd_reget(FAR struct kbd_getstate_s *state, FAR uint8_t *pch)
|
||||
/* Return the next character */
|
||||
|
||||
*pch = state->buf[state->ndx];
|
||||
state->ndx++;
|
||||
state->nch--;
|
||||
return KBD_PRESS;
|
||||
state->ndx++;
|
||||
state->nch--;
|
||||
return KBD_PRESS;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@@ -169,7 +169,9 @@ int kbd_decode(FAR struct lib_instream_s *stream,
|
||||
|
||||
if (ch != ASCII_ESC)
|
||||
{
|
||||
/* Not the beginning of an escape sequence. Return the character. */
|
||||
/* Not the beginning of an escape sequence.
|
||||
* Return the character.
|
||||
*/
|
||||
|
||||
return kbd_reget(state, pch);
|
||||
}
|
||||
|
||||
@@ -122,7 +122,8 @@ void kbd_release(uint8_t ch, FAR struct lib_outstream_s *stream)
|
||||
void kbd_specpress(enum kbd_keycode_e keycode,
|
||||
FAR struct lib_outstream_s *stream)
|
||||
{
|
||||
DEBUGASSERT(stream && keycode >= KEYCODE_FWDDEL && keycode <= LAST_KEYCODE);
|
||||
DEBUGASSERT(stream && keycode >=
|
||||
KEYCODE_FWDDEL && keycode <= LAST_KEYCODE);
|
||||
kbd_encode((uint8_t)keycode, stream, ('a' + KBD_SPECPRESS));
|
||||
}
|
||||
|
||||
@@ -146,6 +147,7 @@ void kbd_specpress(enum kbd_keycode_e keycode,
|
||||
void kbd_specrel(enum kbd_keycode_e keycode,
|
||||
FAR struct lib_outstream_s *stream)
|
||||
{
|
||||
DEBUGASSERT(stream && keycode >= KEYCODE_FWDDEL && keycode <= LAST_KEYCODE);
|
||||
DEBUGASSERT(stream && keycode >=
|
||||
KEYCODE_FWDDEL && keycode <= LAST_KEYCODE);
|
||||
kbd_encode((uint8_t)keycode, stream, ('a' + KBD_SPECREL));
|
||||
}
|
||||
|
||||
+187
-160
File diff suppressed because it is too large
Load Diff
@@ -53,7 +53,7 @@
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Indices, counts, helper macros ******************************************/
|
||||
/* Indices, counts, helper macros *******************************************/
|
||||
|
||||
#define NDX_ESC 0
|
||||
#define NDX_BRACKET 1
|
||||
@@ -134,11 +134,11 @@ static enum slcdret_e slcd_reget(FAR struct slcdstate_s *state,
|
||||
*pch = state->buf[state->ndx];
|
||||
*parg = 0;
|
||||
|
||||
/* Bump up the indices and return false (meaning a normal character) */
|
||||
/* Bump up the indices and return false (meaning a normal character) */
|
||||
|
||||
state->ndx++;
|
||||
state->nch--;
|
||||
return SLCDRET_CHAR;
|
||||
state->ndx++;
|
||||
state->nch--;
|
||||
return SLCDRET_CHAR;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@@ -173,7 +173,6 @@ static enum slcdret_e slcd_reget(FAR struct slcdstate_s *state,
|
||||
enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream,
|
||||
FAR struct slcdstate_s *state, FAR uint8_t *pch,
|
||||
FAR uint8_t *parg)
|
||||
|
||||
{
|
||||
enum slcdcode_e code;
|
||||
uint8_t count;
|
||||
|
||||
@@ -48,3 +48,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT;
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
@@ -83,9 +83,9 @@
|
||||
*
|
||||
* Input Parameters:
|
||||
* src - The src argument points to the string being passed in.
|
||||
* dest - The dest argument points to a numstr into which the function stores
|
||||
* the numeric address; this must be large enough to hold the numeric
|
||||
* address (32 bits for AF_INET, 128 bits for AF_INET6).
|
||||
* dest - The dest argument points to a numstr into which the function
|
||||
* stores the numeric address; this must be large enough to hold the
|
||||
* numeric address (32 bits for AF_INET, 128 bits for AF_INET6).
|
||||
*
|
||||
* Returned Value:
|
||||
* inet_ipv4_pton() will returns 1 if the conversion succeeds. It will
|
||||
@@ -193,9 +193,9 @@ static int inet_ipv4_pton(FAR const char *src, FAR void *dest)
|
||||
*
|
||||
* Input Parameters:
|
||||
* src - The src argument points to the string being passed in.
|
||||
* dest - The dest argument points to a numstr into which the function stores
|
||||
* the numeric address; this must be large enough to hold the numeric
|
||||
* address (32 bits for AF_INET, 128 bits for AF_INET6).
|
||||
* dest - The dest argument points to a numstr into which the function
|
||||
* stores the numeric address; this must be large enough to hold the
|
||||
* numeric address (32 bits for AF_INET, 128 bits for AF_INET6).
|
||||
*
|
||||
* Returned Value:
|
||||
* inet_ipv6_pton() will returns 1 if the conversion succeeds. It will
|
||||
@@ -324,7 +324,6 @@ static int inet_ipv6_pton(FAR const char *src, FAR void *dest)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Return zero if there is any problem parsing the input */
|
||||
|
||||
return 0;
|
||||
@@ -373,15 +372,15 @@ static int inet_ipv6_pton(FAR const char *src, FAR void *dest)
|
||||
* AF_INET or AF_INET6.
|
||||
* src - The src argument points to the string being passed in.
|
||||
* dest - The dest argument points to memory into which the function stores
|
||||
* the numeric address; this must be large enough to hold the numeric
|
||||
* address (32 bits for AF_INET, 128 bits for AF_INET6).
|
||||
* the numeric address; this must be large enough to hold the
|
||||
* numeric address (32 bits for AF_INET, 128 bits for AF_INET6).
|
||||
*
|
||||
* Returned Value:
|
||||
* The inet_pton() function returns 1 if the conversion succeeds, with the
|
||||
* address pointed to by dest in network byte order. It will return 0 if the
|
||||
* input is not a valid IPv4 dotted-decimal string or a valid IPv6 address
|
||||
* string, or -1 with errno set to EAFNOSUPPORT if the af argument is
|
||||
* unknown.
|
||||
* address pointed to by dest in network byte order. It will return 0 if
|
||||
* the input is not a valid IPv4 dotted-decimal string or a valid IPv6
|
||||
* address string, or -1 with errno set to EAFNOSUPPORT if the af argument
|
||||
* is unknown.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/****************************************************************************
|
||||
* libs/libc/stdio/lib_lowoutstream.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011-2012, 2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2009, 2011-2012, 2017 Gregory Nutt.
|
||||
* All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
||||
@@ -56,6 +56,7 @@ FAR char *__ultoa_invert(unsigned long val, FAR char *str, int base)
|
||||
upper = 1;
|
||||
base &= ~XTOA_UPPER;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
int v;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* libs/libc/stdio/lib_vdprintf.c
|
||||
*
|
||||
* Copyright (C) 2012 Andrew Tridgell. All rights reserved.
|
||||
* Authors: Author: Andrew Tridgell <andrew@tridgell.net>
|
||||
* Authors: Andrew Tridgell <andrew@tridgell.net>
|
||||
* Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -54,6 +54,6 @@ int vdprintf(int fd, FAR const IPTR char *fmt, va_list ap)
|
||||
|
||||
/* Wrap the fd in a stream object and let lib_vsprintf do the work. */
|
||||
|
||||
lib_rawoutstream(&rawoutstream, fd);
|
||||
return lib_vsprintf(&rawoutstream.public, fmt, ap);
|
||||
lib_rawoutstream(&rawoutstream, fd);
|
||||
return lib_vsprintf(&rawoutstream.public, fmt, ap);
|
||||
}
|
||||
|
||||
@@ -66,8 +66,8 @@ int vfscanf(FAR FILE *stream, FAR const IPTR char *fmt, va_list ap)
|
||||
lib_stdinstream(&stdinstream, stream);
|
||||
|
||||
/* Hold the stream semaphore throughout the lib_vscanf call so that
|
||||
* this thread can get its entire message out before being pre-empted by
|
||||
* the next thread.
|
||||
* this thread can get its entire message out before being pre-empted
|
||||
* by the next thread.
|
||||
*/
|
||||
|
||||
lib_take_semaphore(stream);
|
||||
|
||||
@@ -66,8 +66,8 @@ int vsnprintf(FAR char *buf, size_t size, FAR const IPTR char *format,
|
||||
|
||||
/* "If the value of [size] is zero on a call to vsnprintf(), nothing shall
|
||||
* be written, the number of bytes that would have been written had [size]
|
||||
* been sufficiently large excluding the terminating null shall be returned,
|
||||
* and [buf] may be a null pointer." -- opengroup.org
|
||||
* been sufficiently large excluding the terminating null shall be
|
||||
* returned, and [buf] may be a null pointer." -- opengroup.org
|
||||
*/
|
||||
|
||||
if (size > 0)
|
||||
|
||||
@@ -52,7 +52,10 @@
|
||||
FAR char *itoa(int val, FAR char *str, int base)
|
||||
{
|
||||
static FAR const char *digits = "0123456789abcdefghijklmnopqrstuvwxyz";
|
||||
int intval = abs(val), digit, pos, len;
|
||||
int intval = abs(val);
|
||||
int digit;
|
||||
int pos;
|
||||
int len;
|
||||
FAR char *buf = str;
|
||||
char swap;
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@ loop:
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
pm = (FAR char *)base + (nel / 2) * width;
|
||||
if (nel > 7)
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
|
||||
static inline int is_real(double x)
|
||||
{
|
||||
const double infinite = 1.0/0.0;
|
||||
const double infinite = 1.0 / 0.0;
|
||||
return (x < infinite) && (x >= -infinite);
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ double strtod(FAR const char *str, FAR char **endptr)
|
||||
int n;
|
||||
int num_digits;
|
||||
int num_decimals;
|
||||
const double infinite = 1.0/0.0;
|
||||
const double infinite = 1.0 / 0.0;
|
||||
|
||||
/* Skip leading whitespace */
|
||||
|
||||
@@ -113,10 +113,14 @@ double strtod(FAR const char *str, FAR char **endptr)
|
||||
{
|
||||
case '-':
|
||||
negative = 1; /* Fall through to increment position */
|
||||
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case '+':
|
||||
p++;
|
||||
|
||||
/* FALLTHROUGH */
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -177,10 +181,14 @@ double strtod(FAR const char *str, FAR char **endptr)
|
||||
{
|
||||
case '-':
|
||||
negative = 1; /* Fall through to increment pos */
|
||||
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case '+':
|
||||
p++;
|
||||
|
||||
/* FALLTHROUGH */
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
|
||||
static inline int is_real(float x)
|
||||
{
|
||||
const float infinite = 1.0F/0.0F;
|
||||
const float infinite = 1.0F / 0.0F;
|
||||
return (x < infinite) && (x >= -infinite);
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ float strtof(FAR const char *str, FAR char **endptr)
|
||||
int n;
|
||||
int num_digits;
|
||||
int num_decimals;
|
||||
const float infinite = 1.0F/0.0F;
|
||||
const float infinite = 1.0F / 0.0F;
|
||||
|
||||
/* Skip leading whitespace */
|
||||
|
||||
@@ -115,10 +115,14 @@ float strtof(FAR const char *str, FAR char **endptr)
|
||||
{
|
||||
case '-':
|
||||
negative = 1; /* Fall through to increment position */
|
||||
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case '+':
|
||||
p++;
|
||||
|
||||
/* FALLTHROUGH */
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -179,10 +183,14 @@ float strtof(FAR const char *str, FAR char **endptr)
|
||||
{
|
||||
case '-':
|
||||
negative = 1; /* Fall through to increment pos */
|
||||
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case '+':
|
||||
p++;
|
||||
|
||||
/* FALLTHROUGH */
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
|
||||
static inline int is_real(long double x)
|
||||
{
|
||||
const long double infinite = 1.0L/0.0L;
|
||||
const long double infinite = 1.0L / 0.0L;
|
||||
return (x < infinite) && (x >= -infinite);
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ long double strtold(FAR const char *str, FAR char **endptr)
|
||||
int n;
|
||||
int num_digits;
|
||||
int num_decimals;
|
||||
const long double infinite = 1.0L/0.0L;
|
||||
const long double infinite = 1.0L / 0.0L;
|
||||
|
||||
/* Skip leading whitespace */
|
||||
|
||||
@@ -113,10 +113,14 @@ long double strtold(FAR const char *str, FAR char **endptr)
|
||||
{
|
||||
case '-':
|
||||
negative = 1; /* Fall through to increment position */
|
||||
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case '+':
|
||||
p++;
|
||||
|
||||
/* FALLTHROUGH */
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -177,10 +181,14 @@ long double strtold(FAR const char *str, FAR char **endptr)
|
||||
{
|
||||
case '-':
|
||||
negative = 1; /* Fall through to increment pos */
|
||||
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case '+':
|
||||
p++;
|
||||
|
||||
/* FALLTHROUGH */
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
#include <string.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Global Functions
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/* memset that must not be optimized away by compiler (not even with LTO). */
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Name: memccpy
|
||||
*
|
||||
|
||||
@@ -133,7 +133,6 @@ FAR char *strtok_r(FAR char *str, FAR const char *delim, FAR char **saveptr)
|
||||
*pend && strchr(delim, *pend) == NULL;
|
||||
pend++);
|
||||
|
||||
|
||||
/* pend either points to the end of the string or to
|
||||
* the first delimiter after the string.
|
||||
*/
|
||||
@@ -153,5 +152,6 @@ FAR char *strtok_r(FAR char *str, FAR const char *delim, FAR char **saveptr)
|
||||
{
|
||||
*saveptr = pend;
|
||||
}
|
||||
|
||||
return pbegin;
|
||||
}
|
||||
|
||||
@@ -294,6 +294,7 @@ typedef uint32_t UIntN;
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: memcpy
|
||||
*
|
||||
|
||||
@@ -49,10 +49,11 @@
|
||||
*
|
||||
* Description:
|
||||
* The wcscmp() function returns zero if the wide-character strings at s1
|
||||
* and s2 are equal. It returns an integer greater than zero if at the first
|
||||
* differing position i, the corresponding wide-character s1[i] is greater
|
||||
* than s2[i]. It returns an integer less than zero if at the first differ-
|
||||
* ing position i, the corresponding wide-character s1[i] is less than s2[i]
|
||||
* and s2 are equal. It returns an integer greater than zero if at the
|
||||
* first differing position i, the corresponding wide-character s1[i] is
|
||||
* greater than s2[i]. It returns an integer less than zero if at the
|
||||
* first differing position i, the corresponding wide-character s1[i] is
|
||||
* less than s2[i]
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
@@ -49,8 +49,8 @@
|
||||
*
|
||||
* Description:
|
||||
* The wcscoll() compares the wide-character string pointed to by a to the
|
||||
* wide-character string pointed to by b using an interpretation appropriate
|
||||
* to the current LC_COLLATE state.
|
||||
* wide-character string pointed to by b using an interpretation
|
||||
* appropriate to the current LC_COLLATE state.
|
||||
*
|
||||
* The current implementation of wcscoll() simply uses wcscmp() and does
|
||||
* not support any language-specific sorting.
|
||||
|
||||
@@ -21,11 +21,11 @@
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* citrus Id: wcslen.c,v 1.1 1999/12/29 21:47:45 tshiozak Exp
|
||||
* citrus Id: wcslen.c,v 1.1 1999/12/29 21:47:45 tshiozak Exp
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
@@ -52,7 +52,8 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
long long int wcstoll(FAR const wchar_t *nptr, FAR wchar_t **endptr, int base)
|
||||
long long int wcstoll(FAR const wchar_t *nptr,
|
||||
FAR wchar_t **endptr, int base)
|
||||
{
|
||||
return strtoll((FAR const char *)nptr, (FAR char **)endptr, base);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,8 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
unsigned long int wcstoul(FAR const wchar_t *nptr, FAR wchar_t **endptr, int base)
|
||||
unsigned long int wcstoul(FAR const wchar_t *nptr,
|
||||
FAR wchar_t **endptr, int base)
|
||||
{
|
||||
return strtoul((const char *)nptr, (char **)endptr, base);
|
||||
}
|
||||
|
||||
@@ -47,8 +47,9 @@
|
||||
* Name: wcstoull
|
||||
*
|
||||
* Description:
|
||||
* The wcstoull() function is the wide-character equivalent of the strtoull()
|
||||
* function. It converts a wchar string to unsigned long long value.
|
||||
* The wcstoull() function is the wide-character equivalent of the
|
||||
* strtoull() function. It converts a wchar string to unsigned long long
|
||||
* value.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
@@ -48,10 +48,10 @@
|
||||
* Name: wcsxfrm
|
||||
*
|
||||
* Description:
|
||||
* The wcsxfrm() transforms the wide-character string pointed to by b to the
|
||||
* wide-character string pointed to by a, comparing two transformed wide
|
||||
* strings with wcscmp() should return the same result as comparing the
|
||||
* original strings with wcscoll().
|
||||
* The wcsxfrm() transforms the wide-character string pointed to by b to
|
||||
* the wide-character string pointed to by a, comparing two transformed
|
||||
* wide strings with wcscmp() should return the same result as comparing
|
||||
* the original strings with wcscoll().
|
||||
* No more than n wide characters are transformed, including the trailing
|
||||
* null character. The current implementation of wcsxfrm() simply uses
|
||||
* wcslcpy() and does not support any language-specific transformations.
|
||||
|
||||
@@ -65,6 +65,7 @@ FAR wchar_t *wmemchr(FAR const wchar_t *s, wchar_t c, size_t n)
|
||||
|
||||
return (FAR wchar_t *) s;
|
||||
}
|
||||
|
||||
s++;
|
||||
}
|
||||
|
||||
|
||||
@@ -46,9 +46,9 @@
|
||||
* Name: wmemmove
|
||||
*
|
||||
* Description:
|
||||
* The wmemmove() function is the wide-character equivalent of the memmove()
|
||||
* function. It copies n wide characters from the array starting at src to
|
||||
* the array starting at dest. The arrays may overlap.
|
||||
* The wmemmove() function is the wide-character equivalent of the
|
||||
* memmove() function. It copies n wide characters from the array starting
|
||||
* at src to the array starting at dest. The arrays may overlap.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
@@ -18,16 +19,17 @@
|
||||
* or promote products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user