This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
The following commit(s) were added to refs/heads/master by this push:
new 345e30313 nshlib:Add macro restrictions to code that uses floating
point numbers
345e30313 is described below
commit 345e303133806b72cd2e3ed1b701f684e091abd7
Author: anjiahao <[email protected]>
AuthorDate: Thu May 16 11:01:56 2024 +0800
nshlib:Add macro restrictions to code that uses floating point numbers
Signed-off-by: anjiahao <[email protected]>
---
nshlib/nsh_fscmds.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/nshlib/nsh_fscmds.c b/nshlib/nsh_fscmds.c
index e435ef310..413ed2463 100644
--- a/nshlib/nsh_fscmds.c
+++ b/nshlib/nsh_fscmds.c
@@ -516,6 +516,7 @@ static int ls_handler(FAR struct nsh_vtbl_s *vtbl, FAR
const char *dirpath,
if ((lsflags & LSFLAGS_SIZE) != 0)
{
+#ifdef CONFIG_HAVE_FLOAT
if (lsflags & LSFLAGS_HUMANREADBLE && buf.st_size >= KB)
{
if (buf.st_size >= GB)
@@ -532,6 +533,7 @@ static int ls_handler(FAR struct nsh_vtbl_s *vtbl, FAR
const char *dirpath,
}
}
else
+#endif
{
nsh_output(vtbl, "%12" PRIdOFF, buf.st_size);
}
@@ -1535,10 +1537,11 @@ int cmd_ls(FAR struct nsh_vtbl_s *vtbl, int argc, FAR
char **argv)
lsflags |= LSFLAGS_SIZE;
break;
+#ifdef CONFIG_HAVE_FLOAT
case 'h':
lsflags |= LSFLAGS_HUMANREADBLE;
break;
-
+#endif
case '?':
default:
nsh_error(vtbl, g_fmtarginvalid, argv[0]);