You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/09/22 08:08:50 UTC

[GitHub] [incubator-nuttx] FASTSHIFT opened a new pull request #4595: libc/misc: add lib_glob.

FASTSHIFT opened a new pull request #4595:
URL: https://github.com/apache/incubator-nuttx/pull/4595


   ## Summary
   Add `glob`.
   
   Reference:
   https://man7.org/linux/man-pages/man7/glob.7.html
   ## Impact
   
   ## Testing
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on pull request #4595: libc/misc: add lib_glob

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on pull request #4595:
URL: https://github.com/apache/incubator-nuttx/pull/4595#issuecomment-927103879


   > We test with some open source project, the result is right in our test case.
   
   It would be interesting if you could contribute it and make it part of the CI for `sim` jobs.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] FASTSHIFT commented on a change in pull request #4595: libc/misc: add lib_glob

Posted by GitBox <gi...@apache.org>.
FASTSHIFT commented on a change in pull request #4595:
URL: https://github.com/apache/incubator-nuttx/pull/4595#discussion_r715295064



##########
File path: libs/libc/misc/lib_glob.c
##########
@@ -0,0 +1,525 @@
+/****************************************************************************
+ * libs/libc/misc/lib_glob.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <dirent.h>
+#include <errno.h>
+#include <fnmatch.h>
+#include <glob.h>
+#include <limits.h>
+#include <pwd.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include "libc.h"
+
+/****************************************************************************
+ * Private Type Declarations
+ ****************************************************************************/
+
+struct match_s
+{
+  FAR struct match_s *next;
+  char name[];
+};
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+static int append(FAR struct match_s **tail, FAR const char *name,
+                  size_t len, int mark);
+static int do_glob(FAR char *buf, size_t pos, int type, FAR char *pat,
+                   int flags,
+                   CODE int (*errfunc)(FAR const char *path, int err),
+                   FAR struct match_s **tail);
+static int ignore_err(FAR const char *path, int err);
+static void freelist(FAR struct match_s *head);
+static int sort(FAR const void *a, FAR const void *b);
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: append
+ ****************************************************************************/
+
+static int append(FAR struct match_s **tail, FAR const char *name,
+                  size_t len, int mark)
+{
+  FAR struct match_s *new = lib_malloc(sizeof(struct match_s) + len + 2);
+  if (!new)
+    {
+      return -1;
+    }
+
+  (*tail)->next = new;
+  new->next = NULL;
+  memcpy(new->name, name, len + 1);
+  if (mark && len && name[len - 1] != '/')
+    {
+      new->name[len] = '/';
+      new->name[len + 1] = 0;
+    }
+
+  *tail = new;
+  return 0;
+}
+
+/****************************************************************************
+ * Name: do_glob
+ ****************************************************************************/
+
+static int do_glob(FAR char *buf, size_t pos, int type, FAR char *pat,
+                   int flags,
+                   CODE int (*errfunc)(FAR const char *path, int err),
+                   FAR struct match_s **tail)
+{
+  /* If GLOB_MARK is unused, we don't care about type. */
+
+  if (!type && !(flags & GLOB_MARK))
+    {
+      type = DT_REG;
+    }
+
+  /* Special-case the remaining pattern being all slashes, in
+   * which case we can use caller-passed type if it's a dir.
+   */
+
+  if (*pat && type != DT_DIR)
+    {
+      type = 0;
+    }
+
+  while (pos + 1 < PATH_MAX && *pat == '/')
+    {
+      buf[pos++] = *pat++;
+    }
+
+  /* Consume maximal [escaped-]literal prefix of pattern, copying
+   * and un-escaping it to the running buffer as we go.
+   */
+
+  ptrdiff_t i = 0;
+  ptrdiff_t j = 0;

Review comment:
       Done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] FASTSHIFT commented on a change in pull request #4595: libc/misc: add lib_glob

Posted by GitBox <gi...@apache.org>.
FASTSHIFT commented on a change in pull request #4595:
URL: https://github.com/apache/incubator-nuttx/pull/4595#discussion_r714502164



##########
File path: include/glob.h
##########
@@ -0,0 +1,110 @@
+/****************************************************************************
+ * include/glob.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __INCLUDE_GLOB_H
+#define __INCLUDE_GLOB_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <stddef.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* The following constants shall be provided as values
+ * for the flags argument:
+ */
+
+#define GLOB_APPEND   0x01 /* Append generated pathnames to
+                            * those previously obtained. */
+#define GLOB_DOOFFS   0x02 /* Specify how many null pointers
+                            * to add to the beginning of gl_pathv. */
+#define GLOB_ERR      0x04 /* Cause glob() to return on error. */
+#define GLOB_MARK     0x08 /* Each pathname that is a directory that
+                            * matches pattern has a slash appended. */
+#define GLOB_NOCHECK  0x10 /* If pattern does not match any pathname, then
+                            * return a list consisting of only pattern. */
+#define GLOB_NOESCAPE 0x20 /* Disable backslash escaping. */
+#define GLOB_NOSORT   0x40 /* Do not sort the pathnames returned. */
+
+/* The following constants shall be defined as error return values:
+ */
+
+#define GLOB_ABORTED  1 /* The scan was stopped because GLOB_ERR
+                         * was set or (*errfunc)() returned non-zero. */
+#define GLOB_NOMATCH  2 /* The pattern does not match any existing pathname,
+                         * and GLOB_NOCHECK was not set in flags. */
+#define GLOB_NOSPACE  3 /* An attempt to allocate memory failed. */
+#define GLOB_NOSYS    4 /* Reserved */
+
+/****************************************************************************
+ * Public Types
+ ****************************************************************************/
+
+typedef struct
+  {
+    size_t gl_pathc; /* Count of paths matched by pattern. */
+    char **gl_pathv; /* Pointer to a list of matched pathnames. */
+    size_t gl_offs;  /* Slots to reserve at the beginning of gl_pathv. */
+  } glob_t;
+
+/****************************************************************************
+ * Public Function Prototypes
+ ****************************************************************************/
+
+#ifdef __cplusplus
+#define EXTERN extern "C"
+extern "C"
+{
+#else
+#define EXTERN extern
+#endif
+
+/****************************************************************************
+ * Name: glob
+ *
+ * Description:
+ *   find pathnames matching a pattern.
+ *
+ ****************************************************************************/
+
+int glob(const char *pat, int flags,
+         int (*errfunc)(const char *path, int err),
+         glob_t *g);

Review comment:
       Done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on pull request #4595: libc/misc: add lib_glob

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on pull request #4595:
URL: https://github.com/apache/incubator-nuttx/pull/4595#issuecomment-926609377


   Do you have any tests for ensuring the implementation is correct? Regarding coding style, the PR seem okay now.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #4595: libc/misc: add lib_glob

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #4595:
URL: https://github.com/apache/incubator-nuttx/pull/4595#discussion_r713880483



##########
File path: include/glob.h
##########
@@ -0,0 +1,110 @@
+/****************************************************************************
+ * include/glob.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __INCLUDE_GLOB_H
+#define __INCLUDE_GLOB_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <stddef.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* The following constants shall be provided as values
+ * for the flags argument:
+ */
+
+#define GLOB_APPEND   0x01 /* Append generated pathnames to
+                            * those previously obtained. */
+#define GLOB_DOOFFS   0x02 /* Specify how many null pointers
+                            * to add to the beginning of gl_pathv. */
+#define GLOB_ERR      0x04 /* Cause glob() to return on error. */
+#define GLOB_MARK     0x08 /* Each pathname that is a directory that
+                            * matches pattern has a slash appended. */
+#define GLOB_NOCHECK  0x10 /* If pattern does not match any pathname, then
+                            * return a list consisting of only pattern. */
+#define GLOB_NOESCAPE 0x20 /* Disable backslash escaping. */
+#define GLOB_NOSORT   0x40 /* Do not sort the pathnames returned. */
+
+/* The following constants shall be defined as error return values:
+ */
+
+#define GLOB_ABORTED  1 /* The scan was stopped because GLOB_ERR
+                         * was set or (*errfunc)() returned non-zero. */
+#define GLOB_NOMATCH  2 /* The pattern does not match any existing pathname,
+                         * and GLOB_NOCHECK was not set in flags. */
+#define GLOB_NOSPACE  3 /* An attempt to allocate memory failed. */
+#define GLOB_NOSYS    4 /* Reserved */
+
+/****************************************************************************
+ * Public Types
+ ****************************************************************************/
+
+typedef struct
+  {
+    size_t gl_pathc; /* Count of paths matched by pattern. */
+    char **gl_pathv; /* Pointer to a list of matched pathnames. */
+    size_t gl_offs;  /* Slots to reserve at the beginning of gl_pathv. */
+  } glob_t;
+
+/****************************************************************************
+ * Public Function Prototypes
+ ****************************************************************************/
+
+#ifdef __cplusplus
+#define EXTERN extern "C"
+extern "C"
+{
+#else
+#define EXTERN extern
+#endif
+
+/****************************************************************************
+ * Name: glob
+ *
+ * Description:
+ *   find pathnames matching a pattern.
+ *
+ ****************************************************************************/
+
+int glob(const char *pat, int flags,
+         int (*errfunc)(const char *path, int err),
+         glob_t *g);

Review comment:
       ```suggestion
   int glob(FAR const char *pat, int flags,
            CODE int (*errfunc)(FAR const char *path, int err),
            FAR glob_t *g);
   ```
   This code is common to all architectures, so pointers to data and code need to be defined with the `FAR` and `CODE` qualifiers, respectively.
   
   Please double check the changes in this PR, there are several occurrences.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #4595: libc/misc: add lib_glob

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #4595:
URL: https://github.com/apache/incubator-nuttx/pull/4595#issuecomment-927091411


   We test with some open source project, the result is right in our test case.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #4595: libc/misc: add lib_glob

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #4595:
URL: https://github.com/apache/incubator-nuttx/pull/4595#discussion_r714733523



##########
File path: libs/libc/misc/lib_glob.c
##########
@@ -0,0 +1,525 @@
+/****************************************************************************
+ * libs/libc/misc/lib_glob.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <dirent.h>
+#include <errno.h>
+#include <fnmatch.h>
+#include <glob.h>
+#include <limits.h>
+#include <pwd.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include "libc.h"
+
+/****************************************************************************
+ * Private Type Declarations
+ ****************************************************************************/
+
+struct match_s
+{
+  FAR struct match_s *next;
+  char name[];
+};
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+static int append(FAR struct match_s **tail, FAR const char *name,
+                  size_t len, int mark);
+static int do_glob(FAR char *buf, size_t pos, int type, FAR char *pat,
+                   int flags,
+                   CODE int (*errfunc)(FAR const char *path, int err),
+                   FAR struct match_s **tail);
+static int ignore_err(FAR const char *path, int err);
+static void freelist(FAR struct match_s *head);
+static int sort(FAR const void *a, FAR const void *b);
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: append
+ ****************************************************************************/
+
+static int append(FAR struct match_s **tail, FAR const char *name,
+                  size_t len, int mark)
+{
+  FAR struct match_s *new = lib_malloc(sizeof(struct match_s) + len + 2);
+  if (!new)
+    {
+      return -1;
+    }
+
+  (*tail)->next = new;
+  new->next = NULL;
+  memcpy(new->name, name, len + 1);
+  if (mark && len && name[len - 1] != '/')
+    {
+      new->name[len] = '/';
+      new->name[len + 1] = 0;
+    }
+
+  *tail = new;
+  return 0;
+}
+
+/****************************************************************************
+ * Name: do_glob
+ ****************************************************************************/
+
+static int do_glob(FAR char *buf, size_t pos, int type, FAR char *pat,
+                   int flags,
+                   CODE int (*errfunc)(FAR const char *path, int err),
+                   FAR struct match_s **tail)
+{
+  /* If GLOB_MARK is unused, we don't care about type. */
+
+  if (!type && !(flags & GLOB_MARK))
+    {
+      type = DT_REG;
+    }
+
+  /* Special-case the remaining pattern being all slashes, in
+   * which case we can use caller-passed type if it's a dir.
+   */
+
+  if (*pat && type != DT_DIR)
+    {
+      type = 0;
+    }
+
+  while (pos + 1 < PATH_MAX && *pat == '/')
+    {
+      buf[pos++] = *pat++;
+    }
+
+  /* Consume maximal [escaped-]literal prefix of pattern, copying
+   * and un-escaping it to the running buffer as we go.
+   */
+
+  ptrdiff_t i = 0;
+  ptrdiff_t j = 0;

Review comment:
       Another NuttX restriction for generic code is the compliance to C89 standard, so variable declarations must be done in the beginning of the scope.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei merged pull request #4595: libc/misc: add lib_glob

Posted by GitBox <gi...@apache.org>.
gustavonihei merged pull request #4595:
URL: https://github.com/apache/incubator-nuttx/pull/4595


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #4595: libc/misc: add lib_glob

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #4595:
URL: https://github.com/apache/incubator-nuttx/pull/4595#discussion_r714733523



##########
File path: libs/libc/misc/lib_glob.c
##########
@@ -0,0 +1,525 @@
+/****************************************************************************
+ * libs/libc/misc/lib_glob.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <dirent.h>
+#include <errno.h>
+#include <fnmatch.h>
+#include <glob.h>
+#include <limits.h>
+#include <pwd.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include "libc.h"
+
+/****************************************************************************
+ * Private Type Declarations
+ ****************************************************************************/
+
+struct match_s
+{
+  FAR struct match_s *next;
+  char name[];
+};
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+static int append(FAR struct match_s **tail, FAR const char *name,
+                  size_t len, int mark);
+static int do_glob(FAR char *buf, size_t pos, int type, FAR char *pat,
+                   int flags,
+                   CODE int (*errfunc)(FAR const char *path, int err),
+                   FAR struct match_s **tail);
+static int ignore_err(FAR const char *path, int err);
+static void freelist(FAR struct match_s *head);
+static int sort(FAR const void *a, FAR const void *b);
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: append
+ ****************************************************************************/
+
+static int append(FAR struct match_s **tail, FAR const char *name,
+                  size_t len, int mark)
+{
+  FAR struct match_s *new = lib_malloc(sizeof(struct match_s) + len + 2);
+  if (!new)
+    {
+      return -1;
+    }
+
+  (*tail)->next = new;
+  new->next = NULL;
+  memcpy(new->name, name, len + 1);
+  if (mark && len && name[len - 1] != '/')
+    {
+      new->name[len] = '/';
+      new->name[len + 1] = 0;
+    }
+
+  *tail = new;
+  return 0;
+}
+
+/****************************************************************************
+ * Name: do_glob
+ ****************************************************************************/
+
+static int do_glob(FAR char *buf, size_t pos, int type, FAR char *pat,
+                   int flags,
+                   CODE int (*errfunc)(FAR const char *path, int err),
+                   FAR struct match_s **tail)
+{
+  /* If GLOB_MARK is unused, we don't care about type. */
+
+  if (!type && !(flags & GLOB_MARK))
+    {
+      type = DT_REG;
+    }
+
+  /* Special-case the remaining pattern being all slashes, in
+   * which case we can use caller-passed type if it's a dir.
+   */
+
+  if (*pat && type != DT_DIR)
+    {
+      type = 0;
+    }
+
+  while (pos + 1 < PATH_MAX && *pat == '/')
+    {
+      buf[pos++] = *pat++;
+    }
+
+  /* Consume maximal [escaped-]literal prefix of pattern, copying
+   * and un-escaping it to the running buffer as we go.
+   */
+
+  ptrdiff_t i = 0;
+  ptrdiff_t j = 0;

Review comment:
       Another NuttX restriction for generic code is the compliance to C89 standard, so variable declarations must be done in the beginning of the scope.
   https://cwiki.apache.org/confluence/display/NUTTX/Coding+Standard#funcbody (topic *Local variables first*)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org