aboutsummaryrefslogtreecommitdiffstats
path: root/utils/v4l2-ctl/v4l2-ctl-common.cpp
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2020-05-10 18:25:47 -0700
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2020-05-11 09:21:29 +0200
commitbbdc0269bf49aa8dd8259d0c31efff2366f6647f (patch)
tree516c2ef42233cb6b5c71a8100a4ae71f87cf6fd8 /utils/v4l2-ctl/v4l2-ctl-common.cpp
parentc39488120a52f88b730c406e2c6abf3176f5d06f (diff)
utils: replace chr functions with std variants
*chr in std offers const overloads, which avoid conversions. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'utils/v4l2-ctl/v4l2-ctl-common.cpp')
-rw-r--r--utils/v4l2-ctl/v4l2-ctl-common.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp
index bbd00e95..47f5da1a 100644
--- a/utils/v4l2-ctl/v4l2-ctl-common.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp
@@ -1,7 +1,6 @@
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
-#include <string.h>
#include <inttypes.h>
#include <getopt.h>
#include <sys/types.h>
@@ -22,6 +21,7 @@
#include <sys/klog.h>
#endif
+#include <cstring>
#include <list>
#include <vector>
#include <map>
@@ -152,7 +152,7 @@ static int calc_node_val(const char *s)
{
int n = 0;
- s = strrchr(s, '/') + 1;
+ s = std::strrchr(s, '/') + 1;
for (unsigned i = 0; prefixes[i]; i++) {
unsigned l = strlen(prefixes[i]);
@@ -741,7 +741,7 @@ static bool parse_subset(char *optarg)
memset(&subset, 0, sizeof(subset));
while (*optarg) {
- p = strchr(optarg, ',');
+ p = std::strchr(optarg, ',');
if (p)
*p = 0;
if (optarg[0] == 0) {
@@ -808,7 +808,7 @@ void common_cmd(const std::string &media_bus_info, int ch, char *optarg)
common_usage();
std::exit(EXIT_FAILURE);
}
- if (strchr(value, '=')) {
+ if (std::strchr(value, '=')) {
common_usage();
std::exit(EXIT_FAILURE);
}
@@ -824,7 +824,7 @@ void common_cmd(const std::string &media_bus_info, int ch, char *optarg)
common_usage();
std::exit(EXIT_FAILURE);
}
- if (const char *equal = strchr(value, '=')) {
+ if (const char *equal = std::strchr(value, '=')) {
set_ctrls[std::string(value, (equal - value))] = equal + 1;
}
else {

Privacy Policy