libs/libc/stdio: A few more coding standard fixes for nano-printf file: all global data names must begin with g_. All structure names must end with _s.
This commit is contained in:
parent
e05149b745
commit
e5ea84c1ff
@ -68,7 +68,7 @@
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
const double __dtoa_scale_up[] =
|
||||
const double g_dtoa_scale_up[] =
|
||||
{
|
||||
#if DBL_MAX_10_EXP >= 1
|
||||
1e1,
|
||||
@ -123,7 +123,7 @@ const double __dtoa_scale_up[] =
|
||||
#endif
|
||||
};
|
||||
|
||||
const double __dtoa_scale_down[] =
|
||||
const double g_dtoa_scale_down[] =
|
||||
{
|
||||
#if DBL_MIN_10_EXP <= -1
|
||||
1e-1,
|
||||
@ -178,7 +178,7 @@ const double __dtoa_scale_down[] =
|
||||
#endif
|
||||
};
|
||||
|
||||
const double __dtoa_round[] =
|
||||
const double g_dtoa_round[] =
|
||||
{
|
||||
#if DBL_DIG >= 30
|
||||
5e30,
|
||||
|
@ -63,7 +63,7 @@
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
int __dtoa_engine(double x, FAR struct dtoa *dtoa, int max_digits,
|
||||
int __dtoa_engine(double x, FAR struct dtoa_s *dtoa, int max_digits,
|
||||
int max_decimals)
|
||||
{
|
||||
int32_t exp = 0;
|
||||
@ -104,7 +104,7 @@ int __dtoa_engine(double x, FAR struct dtoa *dtoa, int max_digits,
|
||||
{
|
||||
for (i = DTOA_SCALE_UP_NUM - 1; i >= 0; i--)
|
||||
{
|
||||
y = x * __dtoa_scale_up[i];
|
||||
y = x * g_dtoa_scale_up[i];
|
||||
if (y < MAX_MANT)
|
||||
{
|
||||
x = y;
|
||||
@ -116,7 +116,7 @@ int __dtoa_engine(double x, FAR struct dtoa *dtoa, int max_digits,
|
||||
{
|
||||
for (i = DTOA_SCALE_DOWN_NUM - 1; i >= 0; i--)
|
||||
{
|
||||
y = x * __dtoa_scale_down[i];
|
||||
y = x * g_dtoa_scale_down[i];
|
||||
if (y >= MIN_MANT)
|
||||
{
|
||||
x = y;
|
||||
@ -139,7 +139,7 @@ int __dtoa_engine(double x, FAR struct dtoa *dtoa, int max_digits,
|
||||
* int. Check for overflow and adjust mantissa and exponent values
|
||||
*/
|
||||
|
||||
x = x + __dtoa_round[max_digits];
|
||||
x = x + g_dtoa_round[max_digits];
|
||||
|
||||
if (x >= MAX_MANT)
|
||||
{
|
||||
|
@ -164,7 +164,7 @@
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
struct dtoa
|
||||
struct dtoa_s
|
||||
{
|
||||
int32_t exp;
|
||||
uint8_t flags;
|
||||
@ -175,15 +175,15 @@ struct dtoa
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
extern const double __dtoa_scale_up[];
|
||||
extern const double __dtoa_scale_down[];
|
||||
extern const double __dtoa_round[];
|
||||
extern const double g_dtoa_scale_up[];
|
||||
extern const double g_dtoa_scale_down[];
|
||||
extern const double g_dtoa_round[];
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
int __dtoa_engine(double x, FAR struct dtoa *dtoa, int max_digits,
|
||||
int __dtoa_engine(double x, FAR struct dtoa_s *dtoa, int max_digits,
|
||||
int max_decimals);
|
||||
|
||||
#endif /* __LIBS_LIBC_STDIO_NANO_DTOA_ENGINE_H */
|
||||
|
@ -329,7 +329,7 @@ int lib_vsprintf(FAR struct lib_outstream_s *stream,
|
||||
{
|
||||
unsigned char __buf[11]; /* Size for -1 in octal, without '\0' */
|
||||
# if PRINTF_LEVEL >= PRINTF_FLT
|
||||
struct dtoa __dtoa;
|
||||
struct dtoa_s __dtoa;
|
||||
# endif
|
||||
} u;
|
||||
const char *pnt;
|
||||
|
@ -48,8 +48,8 @@
|
||||
|
||||
/* Next flags are to use with `base'. Unused fields are reserved. */
|
||||
|
||||
#define XTOA_PREFIX 0x0100 /* Put prefix for octal or hex */
|
||||
#define XTOA_UPPER 0x0200 /* Use upper case letters */
|
||||
#define XTOA_PREFIX 0x0100 /* Put prefix for octal or hex */
|
||||
#define XTOA_UPPER 0x0200 /* Use upper case letters */
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
|
Loading…
Reference in New Issue
Block a user