summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2021-08-31 17:23:47 -0400
committerWilliam Wilgus <wilgus.william@gmail.com>2021-08-31 17:23:47 -0400
commita8253c57ddec8a1dfb2f77e7be9c451595fb094a (patch)
tree7638b14df6fa93950a031069d4367846a592d651
parentc04a944c98c52b6364c8a50aee0ab4e6149e99de (diff)
downloadrockbox-a8253c57dd.tar.gz
rockbox-a8253c57dd.tar.bz2
rockbox-a8253c57dd.zip
lib/argparse fix red
Change-Id: I7bbac6de6319bf86189f079b7330d650ea95de3c
-rw-r--r--apps/plugins/lib/arg_helper.c8
-rw-r--r--apps/plugins/lib/arg_helper.h5
2 files changed, 7 insertions, 6 deletions
diff --git a/apps/plugins/lib/arg_helper.c b/apps/plugins/lib/arg_helper.c
index 756549c2ad..d402300900 100644
--- a/apps/plugins/lib/arg_helper.c
+++ b/apps/plugins/lib/arg_helper.c
@@ -112,7 +112,7 @@ int bool_parse(const char **parameter, bool *choice)
return found;
}
-int longnum_parse(const char **parameter, long *number, unsigned long *decimal)
+int longnum_parse(const char **parameter, long *number, long *decimal)
{
/* passes number and or decimal portion of number base 10 only..
fractional portion is scaled by ARGPARSE_FRAC_DEC_MULTIPLIER
@@ -159,11 +159,11 @@ int longnum_parse(const char **parameter, long *number, unsigned long *decimal)
digits++;
start++;
}
- if (decimal && digits <= AP_MAX_FRAC_DIGITS)
+ if (decimal && digits <= ARGPARSE_MAX_FRAC_DIGITS)
{
- if(digits < AP_MAX_FRAC_DIGITS)
+ if(digits < ARGPARSE_MAX_FRAC_DIGITS)
{
- digits = AP_MAX_FRAC_DIGITS - digits;
+ digits = ARGPARSE_MAX_FRAC_DIGITS - digits;
while (digits--)
dec *= 10;
}
diff --git a/apps/plugins/lib/arg_helper.h b/apps/plugins/lib/arg_helper.h
index 248e8e4eaf..c7b14f7f7a 100644
--- a/apps/plugins/lib/arg_helper.h
+++ b/apps/plugins/lib/arg_helper.h
@@ -23,11 +23,12 @@
#include "plugin.h"
-#define ARGP_MAX_FRAC_DIGITS 9 /* Uses 30 bits max (0.999999999) */
+#define ARGPARSE_MAX_FRAC_DIGITS 9 /* Uses 30 bits max (0.999999999) */
#define ARGP_EXP(a, b) (a ##E## b)
#define ARGP_FRAC_DEC_MULTIPLIER(n) AP_EXP(1,n) /*1x10^n*/
-#define ARGPARSE_FRAC_DEC_MULTIPLIER (long) ARGP_FRAC_DEC_MULTIPLIER(ARGP_MAX_FRAC_DIGITS)
+#define ARGPARSE_FRAC_DEC_MULTIPLIER \
+ (long)ARGP_FRAC_DEC_MULTIPLIER(ARGPARSE_MAX_FRAC_DIGITS)
/* fills buf with a string upto buf_sz, null terminates the buffer
* strings break on WS by default but can be enclosed in single or double quotes