xiaoxiang781216 commented on code in PR #18745:
URL: https://github.com/apache/nuttx/pull/18745#discussion_r3097904270
##########
tools/mkallsyms.sh:
##########
@@ -64,7 +64,8 @@ if [ -f "${1}" ];then
${nm} -n ${1} | grep -E " [T|t] " | uniq | \
while read addr type name
do
- echo " { \"$(${filt} $name | sed -e "s/(.*)$//")\", (FAR ${CONST} void
*)0x$addr },"
+ demangled=$(printf '%s\n' "$name" | ${filt} | sed -e "s/(.*)$//")
Review Comment:
move to new patch
##########
arch/sim/src/sim/posix/sim_host_v4l2.c:
##########
@@ -120,37 +120,24 @@ static bool host_video_is_capture_device(const char
*host_video_dev_path)
return available;
}
-static int host_video_get_device_path_by_index(const char *dirpath,
- int index,
+static int host_video_get_device_path_by_index(int index,
char *devpath,
size_t devpathlen)
{
- DIR *dir;
- struct dirent *entry;
int count = 0;
+ int i;
- dir = opendir(dirpath);
Review Comment:
merge to previous patch
##########
arch/sim/src/sim/posix/sim_host_v4l2.c:
##########
@@ -120,37 +120,24 @@ static bool host_video_is_capture_device(const char
*host_video_dev_path)
return available;
}
-static int host_video_get_device_path_by_index(const char *dirpath,
- int index,
+static int host_video_get_device_path_by_index(int index,
char *devpath,
size_t devpathlen)
{
- DIR *dir;
- struct dirent *entry;
int count = 0;
+ int i;
- dir = opendir(dirpath);
- if (dir == NULL)
- {
- return -errno;
- }
-
- while ((entry = readdir(dir)) != NULL)
+ for (i = 0; i < HOST_MAX_VIDEO_DEVICES; i++)
{
- char path[PATH_MAX];
-
- if (strncmp(entry->d_name, "video", 5) != 0)
- {
- continue;
- }
+ char path[32];
- if (snprintf(path, sizeof(path), "/dev/%s", entry->d_name) >=
+ if (snprintf(path, sizeof(path), "/dev/video%d", i) >=
Review Comment:
why not format to devpath directly
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]