All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] utils: replace chr functions with std variants
@ 2020-05-11  1:25 Rosen Penev
  2020-05-11  1:25 ` [PATCH 2/3] utils: switch strstr to std variant Rosen Penev
  2020-05-11  1:25 ` [PATCH 3/3] utils: switch C to C++ headers Rosen Penev
  0 siblings, 2 replies; 7+ messages in thread
From: Rosen Penev @ 2020-05-11  1:25 UTC (permalink / raw)
  To: linux-media

*chr in std offers const overloads, which avoid conversions.
---
 utils/cec-compliance/cec-test.cpp         |  5 +++--
 utils/cec-ctl/cec-ctl.cpp                 | 15 ++++++++-------
 utils/cec-follower/cec-follower.cpp       |  5 +++--
 utils/libcecutil/cec-parse.cpp            |  4 ++--
 utils/v4l2-compliance/v4l2-compliance.cpp |  5 +++--
 utils/v4l2-ctl/v4l2-ctl-common.cpp        | 10 +++++-----
 utils/v4l2-ctl/v4l2-ctl-edid.cpp          |  5 +++--
 utils/v4l2-ctl/v4l2-ctl-streaming.cpp     |  7 ++++---
 utils/v4l2-ctl/v4l2-ctl-vbi.cpp           |  5 +++--
 utils/v4l2-dbg/v4l2-dbg.cpp               |  4 ++--
 10 files changed, 36 insertions(+), 29 deletions(-)

diff --git a/utils/cec-compliance/cec-test.cpp b/utils/cec-compliance/cec-test.cpp
index 50d434b9..a84f83d3 100644
--- a/utils/cec-compliance/cec-test.cpp
+++ b/utils/cec-compliance/cec-test.cpp
@@ -3,10 +3,11 @@
  * Copyright 2016 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  */
 
+#include <cstring>
+
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <string.h>
 #include <inttypes.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -1530,7 +1531,7 @@ void listTests()
 
 int setExpectedResult(char *optarg, bool no_warnings)
 {
-	char *equal = strchr(optarg, '=');
+	char *equal = std::strchr(optarg, '=');
 
 	if (!equal || equal == optarg || !isdigit(equal[1]))
 		return 1;
diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp
index b8edb105..899b83b1 100644
--- a/utils/cec-ctl/cec-ctl.cpp
+++ b/utils/cec-ctl/cec-ctl.cpp
@@ -3,10 +3,11 @@
  * Copyright 2016 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  */
 
+#include <cstring>
+
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <string.h>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
@@ -1650,7 +1651,7 @@ static void stress_test_power_cycle(struct node &node, unsigned cnt,
 
 static int calc_node_val(const char *s)
 {
-	s = strrchr(s, '/') + 1;
+	s = std::strrchr(s, '/') + 1;
 
 	if (!memcmp(s, "cec", 3))
 		return atol(s + 3);
@@ -1917,7 +1918,7 @@ int main(int argc, char **argv)
 		case OptIgnore: {
 			bool all_la = !strncmp(optarg, "all", 3);
 			bool all_opcodes = true;
-			const char *sep = strchr(optarg, ',');
+			const char *sep = std::strchr(optarg, ',');
 			unsigned la_mask = 0xffff, opcode, la = 0;
 
 			if (sep)
@@ -2068,7 +2069,7 @@ int main(int argc, char **argv)
 							size--;
 							break;
 						}
-						value = strchr(value, ':');
+						value = std::strchr(value, ':');
 						if (value == NULL)
 							break;
 						value++;
@@ -2109,7 +2110,7 @@ int main(int argc, char **argv)
 							size--;
 							break;
 						}
-						value = strchr(value, ':');
+						value = std::strchr(value, ':');
 						if (value == NULL)
 							break;
 						value++;
@@ -2150,7 +2151,7 @@ int main(int argc, char **argv)
 							size--;
 							break;
 						}
-						value = strchr(value, ':');
+						value = std::strchr(value, ':');
 						if (value == NULL)
 							break;
 						value++;
@@ -2184,7 +2185,7 @@ int main(int argc, char **argv)
 							size--;
 							break;
 						}
-						value = strchr(value, ':');
+						value = std::strchr(value, ':');
 						if (value == NULL)
 							break;
 						value++;
diff --git a/utils/cec-follower/cec-follower.cpp b/utils/cec-follower/cec-follower.cpp
index 7c8c044e..589426ec 100644
--- a/utils/cec-follower/cec-follower.cpp
+++ b/utils/cec-follower/cec-follower.cpp
@@ -3,10 +3,11 @@
  * Copyright 2016 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  */
 
+#include <cstring>
+
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <string.h>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
@@ -386,7 +387,7 @@ int main(int argc, char **argv)
 		case OptIgnore: {
 			bool all_la = !strncmp(optarg, "all", 3);
 			bool all_opcodes = true;
-			const char *sep = strchr(optarg, ',');
+			const char *sep = std::strchr(optarg, ',');
 			unsigned la_mask = 0xffff, opcode, la = 0;
 
 			if (sep)
diff --git a/utils/libcecutil/cec-parse.cpp b/utils/libcecutil/cec-parse.cpp
index 5fffcce7..8c869fec 100644
--- a/utils/libcecutil/cec-parse.cpp
+++ b/utils/libcecutil/cec-parse.cpp
@@ -6,7 +6,6 @@
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <string.h>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
@@ -18,6 +17,7 @@
 #include <errno.h>
 #include <sys/ioctl.h>
 #include <stdarg.h>
+#include <cstring>
 #include <ctime>
 #include <cerrno>
 #include <string>
@@ -191,7 +191,7 @@ unsigned cec_parse_phys_addr(const char *value)
 {
 	unsigned p1, p2, p3, p4;
 
-	if (!strchr(value, '.'))
+	if (!std::strchr(value, '.'))
 		return strtoul(value, NULL, 0);
 	if (sscanf(value, "%x.%x.%x.%x", &p1, &p2, &p3, &p4) != 4) {
 		fprintf(stderr, "Expected a physical address of the form x.x.x.x\n");
diff --git a/utils/v4l2-compliance/v4l2-compliance.cpp b/utils/v4l2-compliance/v4l2-compliance.cpp
index 676b9278..549e37f7 100644
--- a/utils/v4l2-compliance/v4l2-compliance.cpp
+++ b/utils/v4l2-compliance/v4l2-compliance.cpp
@@ -18,10 +18,11 @@
     Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335  USA
  */
 
+#include <cstring>
+
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <string.h>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
@@ -1582,7 +1583,7 @@ int main(int argc, char **argv)
 			break;
 		case OptStreamFrom:
 		case OptStreamFromHdr: {
-			char *equal = strchr(optarg, '=');
+			char *equal = std::strchr(optarg, '=');
 			bool has_hdr = ch == OptStreamFromHdr;
 
 			if (equal == optarg)
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 {
diff --git a/utils/v4l2-ctl/v4l2-ctl-edid.cpp b/utils/v4l2-ctl/v4l2-ctl-edid.cpp
index a2df6089..b13d8209 100644
--- a/utils/v4l2-ctl/v4l2-ctl-edid.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-edid.cpp
@@ -1,7 +1,8 @@
+#include <cstring>
+
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <string.h>
 #include <inttypes.h>
 #include <fcntl.h>
 #include <ctype.h>
@@ -710,7 +711,7 @@ static unsigned short parse_phys_addr(const char *value)
 {
 	unsigned p1, p2, p3, p4;
 
-	if (!strchr(value, '.'))
+	if (!std::strchr(value, '.'))
 		return strtoul(value, NULL, 0);
 	if (sscanf(value, "%x.%x.%x.%x", &p1, &p2, &p3, &p4) != 4) {
 		fprintf(stderr, "Expected a physical address of the form x.x.x.x\n");
diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
index 0d5a1e1a..8578610d 100644
--- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
@@ -1,7 +1,8 @@
+#include <cstring>
+
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <string.h>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
@@ -1660,7 +1661,7 @@ static FILE *open_output_file(cv4l_fd &fd)
 	if (!host_to)
 		return NULL;
 
-	char *p = strchr(host_to, ':');
+	char *p = std::strchr(host_to, ':');
 	struct sockaddr_in serv_addr;
 	struct hostent *server;
 	struct v4l2_fract aspect;
@@ -1925,7 +1926,7 @@ static FILE *open_input_file(cv4l_fd &fd, __u32 type)
 	if (!host_from)
 		return NULL;
 
-	char *p = strchr(host_from, ':');
+	char *p = std::strchr(host_from, ':');
 	int listen_fd;
 	socklen_t clilen;
 	struct sockaddr_in serv_addr = {}, cli_addr;
diff --git a/utils/v4l2-ctl/v4l2-ctl-vbi.cpp b/utils/v4l2-ctl/v4l2-ctl-vbi.cpp
index 6a4f627f..ee55012f 100644
--- a/utils/v4l2-ctl/v4l2-ctl-vbi.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-vbi.cpp
@@ -1,7 +1,8 @@
+#include <cstring>
+
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <string.h>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
@@ -98,7 +99,7 @@ void vbi_cmd(int ch, char *optarg)
 			std::exit(EXIT_FAILURE);
 		}
 		while (*optarg) {
-			subs = strchr(optarg, ',');
+			subs = std::strchr(optarg, ',');
 			if (subs)
 				*subs = 0;
 
diff --git a/utils/v4l2-dbg/v4l2-dbg.cpp b/utils/v4l2-dbg/v4l2-dbg.cpp
index f2fd8269..86266376 100644
--- a/utils/v4l2-dbg/v4l2-dbg.cpp
+++ b/utils/v4l2-dbg/v4l2-dbg.cpp
@@ -19,7 +19,6 @@
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <string.h>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
@@ -43,6 +42,7 @@
 
 #include <linux/videodev2.h>
 
+#include <cstring>
 #include <list>
 #include <vector>
 #include <map>
@@ -731,7 +731,7 @@ int main(int argc, char **argv)
 			goto list_done;
 		}
 
-		p = strchr(chip_info.name, ' ');
+		p = std::strchr(chip_info.name, ' ');
 		if (p)
 			*p = '\0';
 		name = chip_info.name;
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/3] utils: switch strstr to std variant
  2020-05-11  1:25 [PATCH 1/3] utils: replace chr functions with std variants Rosen Penev
@ 2020-05-11  1:25 ` Rosen Penev
  2020-05-11  7:23   ` Hans Verkuil
  2020-05-11  1:25 ` [PATCH 3/3] utils: switch C to C++ headers Rosen Penev
  1 sibling, 1 reply; 7+ messages in thread
From: Rosen Penev @ 2020-05-11  1:25 UTC (permalink / raw)
  To: linux-media

strstr has const overloads in std, avoiding pointless conversions.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 utils/libcecutil/cec-log.cpp       | 2 +-
 utils/v4l2-ctl/v4l2-ctl-common.cpp | 4 ++--
 utils/v4l2-ctl/v4l2-ctl-misc.cpp   | 6 +++---
 utils/v4l2-dbg/v4l2-dbg.cpp        | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/utils/libcecutil/cec-log.cpp b/utils/libcecutil/cec-log.cpp
index 9410c071..0dcb4675 100644
--- a/utils/libcecutil/cec-log.cpp
+++ b/utils/libcecutil/cec-log.cpp
@@ -62,7 +62,7 @@ static void log_arg(const struct cec_arg *arg, const char *arg_name, __u32 val)
 		}
 		return;
 	case CEC_ARG_TYPE_U16:
-		if (strstr(arg_name, "phys-addr"))
+		if (std::strstr(arg_name, "phys-addr"))
 			printf("\t%s: %x.%x.%x.%x\n", arg_name, cec_phys_addr_exp(val));
 		else
 			printf("\t%s: %u (0x%04x)\n", arg_name, val, val);
diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp
index 47f5da1a..0640a521 100644
--- a/utils/v4l2-ctl/v4l2-ctl-common.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp
@@ -1190,13 +1190,13 @@ void common_get(cv4l_fd &_fd)
 				char *q;
 
 				buf[len] = 0;
-				while ((q = strstr(p, "START STATUS"))) {
+				while ((q = std::strstr(p, "START STATUS"))) {
 					p = q + 1;
 				}
 				if (p) {
 					while (p > buf && *p != '<') p--;
 					q = p;
-					while ((q = strstr(q, "<6>"))) {
+					while ((q = std::strstr(q, "<6>"))) {
 						memcpy(q, "   ", 3);
 					}
 					printf("%s", p);
diff --git a/utils/v4l2-ctl/v4l2-ctl-misc.cpp b/utils/v4l2-ctl/v4l2-ctl-misc.cpp
index 6db87568..deb481b4 100644
--- a/utils/v4l2-ctl/v4l2-ctl-misc.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-misc.cpp
@@ -212,11 +212,11 @@ void misc_cmd(int ch, char *optarg)
 				jpegcomp.quality = strtol(value, 0L, 0);
 				break;
 			case 17:
-				if (strstr(value, "dht"))
+				if (std::strstr(value, "dht"))
 					jpegcomp.jpeg_markers |= V4L2_JPEG_MARKER_DHT;
-				if (strstr(value, "dqt"))
+				if (std::strstr(value, "dqt"))
 					jpegcomp.jpeg_markers |= V4L2_JPEG_MARKER_DQT;
-				if (strstr(value, "dri"))
+				if (std::strstr(value, "dri"))
 					jpegcomp.jpeg_markers |= V4L2_JPEG_MARKER_DRI;
 				break;
 			case 18:
diff --git a/utils/v4l2-dbg/v4l2-dbg.cpp b/utils/v4l2-dbg/v4l2-dbg.cpp
index 86266376..06301ae0 100644
--- a/utils/v4l2-dbg/v4l2-dbg.cpp
+++ b/utils/v4l2-dbg/v4l2-dbg.cpp
@@ -784,14 +784,14 @@ list_done:
 				char *q;
 
 				buf[len] = 0;
-				while ((q = strstr(p, "START STATUS"))) {
+				while ((q = std::strstr(p, "START STATUS"))) {
 					found_status = true;
 					p = q + 1;
 				}
 				if (found_status) {
 					while (p > buf && *p != '<') p--;
 					q = p;
-					while ((q = strstr(q, "<6>"))) {
+					while ((q = std::strstr(q, "<6>"))) {
 						memcpy(q, "   ", 3);
 					}
 					printf("%s", p);
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/3] utils: switch C to C++ headers
  2020-05-11  1:25 [PATCH 1/3] utils: replace chr functions with std variants Rosen Penev
  2020-05-11  1:25 ` [PATCH 2/3] utils: switch strstr to std variant Rosen Penev
@ 2020-05-11  1:25 ` Rosen Penev
  2020-05-11  7:21   ` Hans Verkuil
  1 sibling, 1 reply; 7+ messages in thread
From: Rosen Penev @ 2020-05-11  1:25 UTC (permalink / raw)
  To: linux-media

Recently, I changed exit() to the std variant, which caused build
failures on older platforms. Switch all headers to the C++ variants
to avoid this.

These C headers are deprecated by C++14.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 utils/cec-compliance/cec-compliance.cpp          | 10 +++++-----
 utils/cec-compliance/cec-test-adapter.cpp        | 10 +++++-----
 utils/cec-compliance/cec-test-audio.cpp          | 10 +++++-----
 utils/cec-compliance/cec-test-fuzzing.cpp        | 10 +++++-----
 utils/cec-compliance/cec-test-power.cpp          | 10 +++++-----
 utils/cec-compliance/cec-test.cpp                |  8 ++++----
 utils/cec-ctl/cec-ctl.cpp                        | 10 +++++-----
 utils/cec-ctl/cec-pin.cpp                        | 12 ++++++------
 utils/cec-follower/cec-follower.cpp              |  8 ++++----
 utils/cec-follower/cec-processing.cpp            | 10 +++++-----
 utils/cec-follower/cec-tuner.cpp                 |  2 +-
 utils/common/media-info.cpp                      | 10 +++++-----
 utils/common/v4l2-info.cpp                       | 10 +++++-----
 utils/libcecutil/cec-info.cpp                    |  2 +-
 utils/libcecutil/cec-log.cpp                     |  8 ++++----
 utils/libcecutil/cec-parse.cpp                   | 10 +++++-----
 utils/rds-ctl/rds-ctl.cpp                        | 14 +++++++-------
 utils/v4l2-compliance/v4l2-compliance.cpp        | 12 ++++++------
 utils/v4l2-compliance/v4l2-test-buffers.cpp      | 10 +++++-----
 utils/v4l2-compliance/v4l2-test-codecs.cpp       | 12 ++++++------
 utils/v4l2-compliance/v4l2-test-colors.cpp       | 12 ++++++------
 utils/v4l2-compliance/v4l2-test-controls.cpp     | 10 +++++-----
 utils/v4l2-compliance/v4l2-test-debug.cpp        | 12 ++++++------
 utils/v4l2-compliance/v4l2-test-formats.cpp      | 12 ++++++------
 utils/v4l2-compliance/v4l2-test-input-output.cpp | 10 +++++-----
 utils/v4l2-compliance/v4l2-test-io-config.cpp    | 10 +++++-----
 utils/v4l2-compliance/v4l2-test-media.cpp        | 12 ++++++------
 utils/v4l2-compliance/v4l2-test-subdevs.cpp      | 12 ++++++------
 utils/v4l2-ctl/v4l2-ctl-common.cpp               | 10 +++++-----
 utils/v4l2-ctl/v4l2-ctl-edid.cpp                 |  8 ++++----
 utils/v4l2-ctl/v4l2-ctl-io.cpp                   | 12 ++++++------
 utils/v4l2-ctl/v4l2-ctl-meta.cpp                 | 12 ++++++------
 utils/v4l2-ctl/v4l2-ctl-misc.cpp                 | 12 ++++++------
 utils/v4l2-ctl/v4l2-ctl-modes.cpp                |  4 ++--
 utils/v4l2-ctl/v4l2-ctl-overlay.cpp              | 12 ++++++------
 utils/v4l2-ctl/v4l2-ctl-sdr.cpp                  | 12 ++++++------
 utils/v4l2-ctl/v4l2-ctl-selection.cpp            | 12 ++++++------
 utils/v4l2-ctl/v4l2-ctl-stds.cpp                 | 12 ++++++------
 utils/v4l2-ctl/v4l2-ctl-streaming.cpp            | 10 +++++-----
 utils/v4l2-ctl/v4l2-ctl-subdev.cpp               | 12 ++++++------
 utils/v4l2-ctl/v4l2-ctl-tuner.cpp                | 10 +++++-----
 utils/v4l2-ctl/v4l2-ctl-vbi.cpp                  | 10 +++++-----
 utils/v4l2-ctl/v4l2-ctl-vidcap.cpp               | 12 ++++++------
 utils/v4l2-ctl/v4l2-ctl-vidout.cpp               | 12 ++++++------
 utils/v4l2-ctl/v4l2-ctl.cpp                      | 12 ++++++------
 utils/v4l2-dbg/v4l2-dbg.cpp                      | 10 +++++-----
 46 files changed, 236 insertions(+), 236 deletions(-)

diff --git a/utils/cec-compliance/cec-compliance.cpp b/utils/cec-compliance/cec-compliance.cpp
index d0580579..60298846 100644
--- a/utils/cec-compliance/cec-compliance.cpp
+++ b/utils/cec-compliance/cec-compliance.cpp
@@ -4,17 +4,17 @@
  */
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/time.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <sys/wait.h>
 #include <sstream>
diff --git a/utils/cec-compliance/cec-test-adapter.cpp b/utils/cec-compliance/cec-test-adapter.cpp
index df7374df..b7a8159d 100644
--- a/utils/cec-compliance/cec-test-adapter.cpp
+++ b/utils/cec-compliance/cec-test-adapter.cpp
@@ -4,16 +4,16 @@
  */
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <sys/wait.h>
 #include <sstream>
diff --git a/utils/cec-compliance/cec-test-audio.cpp b/utils/cec-compliance/cec-test-audio.cpp
index d422a7da..edf528c9 100644
--- a/utils/cec-compliance/cec-test-audio.cpp
+++ b/utils/cec-compliance/cec-test-audio.cpp
@@ -4,15 +4,15 @@
  */
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <config.h>
 
diff --git a/utils/cec-compliance/cec-test-fuzzing.cpp b/utils/cec-compliance/cec-test-fuzzing.cpp
index ce0bf12d..708a8ec3 100644
--- a/utils/cec-compliance/cec-test-fuzzing.cpp
+++ b/utils/cec-compliance/cec-test-fuzzing.cpp
@@ -4,15 +4,15 @@
  */
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <config.h>
 #include <sstream>
diff --git a/utils/cec-compliance/cec-test-power.cpp b/utils/cec-compliance/cec-test-power.cpp
index 2758c36d..e35264aa 100644
--- a/utils/cec-compliance/cec-test-power.cpp
+++ b/utils/cec-compliance/cec-test-power.cpp
@@ -4,15 +4,15 @@
  */
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <config.h>
 
diff --git a/utils/cec-compliance/cec-test.cpp b/utils/cec-compliance/cec-test.cpp
index a84f83d3..1a05c5ae 100644
--- a/utils/cec-compliance/cec-test.cpp
+++ b/utils/cec-compliance/cec-test.cpp
@@ -6,14 +6,14 @@
 #include <cstring>
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
+#include <cstdlib>
+#include <cstdio>
 #include <inttypes.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <config.h>
 #include <sstream>
diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp
index 899b83b1..3c6c6f98 100644
--- a/utils/cec-ctl/cec-ctl.cpp
+++ b/utils/cec-ctl/cec-ctl.cpp
@@ -6,8 +6,8 @@
 #include <cstring>
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
+#include <cstdlib>
+#include <cstdio>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
@@ -15,10 +15,10 @@
 #include <sys/time.h>
 #include <dirent.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
-#include <stdarg.h>
+#include <cstdarg>
 #include <ctime>
 #include <cerrno>
 #include <string>
diff --git a/utils/cec-ctl/cec-pin.cpp b/utils/cec-ctl/cec-pin.cpp
index c09d6bbd..3ff4734f 100644
--- a/utils/cec-ctl/cec-pin.cpp
+++ b/utils/cec-ctl/cec-pin.cpp
@@ -4,19 +4,19 @@
  */
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/time.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
-#include <stdarg.h>
+#include <cstdarg>
 #include <cerrno>
 #include <string>
 #include <vector>
diff --git a/utils/cec-follower/cec-follower.cpp b/utils/cec-follower/cec-follower.cpp
index 589426ec..c6e0a1d1 100644
--- a/utils/cec-follower/cec-follower.cpp
+++ b/utils/cec-follower/cec-follower.cpp
@@ -6,15 +6,15 @@
 #include <cstring>
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
+#include <cstdlib>
+#include <cstdio>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <sys/wait.h>
 #include <sstream>
diff --git a/utils/cec-follower/cec-processing.cpp b/utils/cec-follower/cec-processing.cpp
index bc8c9c09..e2c5c8e2 100644
--- a/utils/cec-follower/cec-processing.cpp
+++ b/utils/cec-follower/cec-processing.cpp
@@ -4,16 +4,16 @@
  */
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/time.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <config.h>
 
diff --git a/utils/cec-follower/cec-tuner.cpp b/utils/cec-follower/cec-tuner.cpp
index 4aecebce..7ac0decb 100644
--- a/utils/cec-follower/cec-tuner.cpp
+++ b/utils/cec-follower/cec-tuner.cpp
@@ -4,7 +4,7 @@
  */
 
 #include <sys/ioctl.h>
-#include <stdlib.h>
+#include <cstdlib>
 
 #include "cec-follower.h"
 #include "compiler.h"
diff --git a/utils/common/media-info.cpp b/utils/common/media-info.cpp
index 8aa12f34..d37c5acb 100644
--- a/utils/common/media-info.cpp
+++ b/utils/common/media-info.cpp
@@ -4,15 +4,15 @@
  */
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <sys/sysmacros.h>
diff --git a/utils/common/v4l2-info.cpp b/utils/common/v4l2-info.cpp
index 0aac8504..28116fd3 100644
--- a/utils/common/v4l2-info.cpp
+++ b/utils/common/v4l2-info.cpp
@@ -4,15 +4,15 @@
  */
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <sys/sysmacros.h>
diff --git a/utils/libcecutil/cec-info.cpp b/utils/libcecutil/cec-info.cpp
index f6e60918..ed244437 100644
--- a/utils/libcecutil/cec-info.cpp
+++ b/utils/libcecutil/cec-info.cpp
@@ -5,7 +5,7 @@
  * Copyright 2017 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  */
 
-#include <stdio.h>
+#include <cstdio>
 #include <string>
 #include <unistd.h>
 #include <fcntl.h>
diff --git a/utils/libcecutil/cec-log.cpp b/utils/libcecutil/cec-log.cpp
index 0dcb4675..40028630 100644
--- a/utils/libcecutil/cec-log.cpp
+++ b/utils/libcecutil/cec-log.cpp
@@ -4,11 +4,11 @@
  */
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
-#include <stdarg.h>
+#include <cstdarg>
 #include <string>
 #include <linux/cec-funcs.h>
 #include "cec-htng-funcs.h"
diff --git a/utils/libcecutil/cec-parse.cpp b/utils/libcecutil/cec-parse.cpp
index 8c869fec..024b6285 100644
--- a/utils/libcecutil/cec-parse.cpp
+++ b/utils/libcecutil/cec-parse.cpp
@@ -4,8 +4,8 @@
  */
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
+#include <cstdlib>
+#include <cstdio>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
@@ -13,10 +13,10 @@
 #include <sys/time.h>
 #include <dirent.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
-#include <stdarg.h>
+#include <cstdarg>
 #include <cstring>
 #include <ctime>
 #include <cerrno>
diff --git a/utils/rds-ctl/rds-ctl.cpp b/utils/rds-ctl/rds-ctl.cpp
index 73fc7e3c..fbc4d310 100644
--- a/utils/rds-ctl/rds-ctl.cpp
+++ b/utils/rds-ctl/rds-ctl.cpp
@@ -8,21 +8,21 @@
  */
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <wchar.h>
-#include <locale.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
+#include <cwchar>
+#include <clocale>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include <fcntl.h>
-#include <errno.h>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <dirent.h>
 #include <config.h>
-#include <signal.h>
+#include <csignal>
 
 #include <linux/videodev2.h>
 #include <libv4l2rds.h>
diff --git a/utils/v4l2-compliance/v4l2-compliance.cpp b/utils/v4l2-compliance/v4l2-compliance.cpp
index 549e37f7..49606975 100644
--- a/utils/v4l2-compliance/v4l2-compliance.cpp
+++ b/utils/v4l2-compliance/v4l2-compliance.cpp
@@ -21,22 +21,22 @@
 #include <cstring>
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
+#include <cstdlib>
+#include <cstdio>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <sys/sysmacros.h>
 #include <dirent.h>
-#include <math.h>
+#include <cmath>
 #include <sys/utsname.h>
-#include <signal.h>
+#include <csignal>
 #include <vector>
 
 #include "v4l2-compliance.h"
diff --git a/utils/v4l2-compliance/v4l2-test-buffers.cpp b/utils/v4l2-compliance/v4l2-test-buffers.cpp
index fc49fff6..e2df126d 100644
--- a/utils/v4l2-compliance/v4l2-test-buffers.cpp
+++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp
@@ -19,9 +19,9 @@
  */
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -29,8 +29,8 @@
 #include <sys/wait.h>
 #include <sys/epoll.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <poll.h>
 #include <sys/ioctl.h>
 #include <netinet/in.h>
diff --git a/utils/v4l2-compliance/v4l2-test-codecs.cpp b/utils/v4l2-compliance/v4l2-test-codecs.cpp
index 3fd44c8b..377574ec 100644
--- a/utils/v4l2-compliance/v4l2-test-codecs.cpp
+++ b/utils/v4l2-compliance/v4l2-test-codecs.cpp
@@ -19,17 +19,17 @@
  */
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
-#include <assert.h>
+#include <cassert>
 #include "v4l2-compliance.h"
 
 int testEncoder(struct node *node)
diff --git a/utils/v4l2-compliance/v4l2-test-colors.cpp b/utils/v4l2-compliance/v4l2-test-colors.cpp
index 09d29a3e..6996877d 100644
--- a/utils/v4l2-compliance/v4l2-test-colors.cpp
+++ b/utils/v4l2-compliance/v4l2-test-colors.cpp
@@ -15,19 +15,19 @@
  */
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <sys/time.h>
-#include <math.h>
+#include <cmath>
 
 #include "compiler.h"
 #include "v4l2-compliance.h"
diff --git a/utils/v4l2-compliance/v4l2-test-controls.cpp b/utils/v4l2-compliance/v4l2-test-controls.cpp
index d81dddb2..c3c27119 100644
--- a/utils/v4l2-compliance/v4l2-test-controls.cpp
+++ b/utils/v4l2-compliance/v4l2-test-controls.cpp
@@ -19,15 +19,15 @@
  */
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <vector>
 
diff --git a/utils/v4l2-compliance/v4l2-test-debug.cpp b/utils/v4l2-compliance/v4l2-test-debug.cpp
index 3f43e661..206b4b82 100644
--- a/utils/v4l2-compliance/v4l2-test-debug.cpp
+++ b/utils/v4l2-compliance/v4l2-test-debug.cpp
@@ -19,19 +19,19 @@
  */
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <sys/time.h>
-#include <math.h>
+#include <cmath>
 #include "v4l2-compliance.h"
 
 int testRegister(struct node *node)
diff --git a/utils/v4l2-compliance/v4l2-test-formats.cpp b/utils/v4l2-compliance/v4l2-test-formats.cpp
index e1b00f3c..7780442e 100644
--- a/utils/v4l2-compliance/v4l2-test-formats.cpp
+++ b/utils/v4l2-compliance/v4l2-test-formats.cpp
@@ -19,17 +19,17 @@
  */
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
-#include <assert.h>
+#include <cassert>
 
 #include "compiler.h"
 #include "v4l2-compliance.h"
diff --git a/utils/v4l2-compliance/v4l2-test-input-output.cpp b/utils/v4l2-compliance/v4l2-test-input-output.cpp
index 80ecf75d..a7fe81d8 100644
--- a/utils/v4l2-compliance/v4l2-test-input-output.cpp
+++ b/utils/v4l2-compliance/v4l2-test-input-output.cpp
@@ -19,15 +19,15 @@
  */
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include "v4l2-compliance.h"
 
diff --git a/utils/v4l2-compliance/v4l2-test-io-config.cpp b/utils/v4l2-compliance/v4l2-test-io-config.cpp
index 9ade11e8..be885cb3 100644
--- a/utils/v4l2-compliance/v4l2-test-io-config.cpp
+++ b/utils/v4l2-compliance/v4l2-test-io-config.cpp
@@ -19,15 +19,15 @@
  */
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include "v4l2-compliance.h"
 
diff --git a/utils/v4l2-compliance/v4l2-test-media.cpp b/utils/v4l2-compliance/v4l2-test-media.cpp
index bcd8a725..94c25932 100644
--- a/utils/v4l2-compliance/v4l2-test-media.cpp
+++ b/utils/v4l2-compliance/v4l2-test-media.cpp
@@ -19,19 +19,19 @@
  */
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/sysmacros.h>
 #include <fcntl.h>
 #include <dirent.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
-#include <assert.h>
+#include <cassert>
 #include <set>
 #include <fstream>
 
diff --git a/utils/v4l2-compliance/v4l2-test-subdevs.cpp b/utils/v4l2-compliance/v4l2-test-subdevs.cpp
index 489639fb..54d3c430 100644
--- a/utils/v4l2-compliance/v4l2-test-subdevs.cpp
+++ b/utils/v4l2-compliance/v4l2-test-subdevs.cpp
@@ -19,17 +19,17 @@
  */
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
-#include <assert.h>
+#include <cassert>
 
 #include "v4l2-compliance.h"
 
diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp
index 0640a521..bf267432 100644
--- a/utils/v4l2-ctl/v4l2-ctl-common.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp
@@ -1,18 +1,18 @@
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
+#include <cstdlib>
+#include <cstdio>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <sys/sysmacros.h>
 #include <sys/time.h>
 #include <dirent.h>
-#include <math.h>
+#include <cmath>
 #include <linux/media.h>
 
 #include "v4l2-ctl.h"
diff --git a/utils/v4l2-ctl/v4l2-ctl-edid.cpp b/utils/v4l2-ctl/v4l2-ctl-edid.cpp
index b13d8209..d028d248 100644
--- a/utils/v4l2-ctl/v4l2-ctl-edid.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-edid.cpp
@@ -1,12 +1,12 @@
 #include <cstring>
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
+#include <cstdlib>
+#include <cstdio>
 #include <inttypes.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 
 #include "v4l2-ctl.h"
diff --git a/utils/v4l2-ctl/v4l2-ctl-io.cpp b/utils/v4l2-ctl/v4l2-ctl-io.cpp
index 9e83c03a..379198b5 100644
--- a/utils/v4l2-ctl/v4l2-ctl-io.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-io.cpp
@@ -1,18 +1,18 @@
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <dirent.h>
-#include <math.h>
+#include <cmath>
 
 #include "v4l2-ctl.h"
 
diff --git a/utils/v4l2-ctl/v4l2-ctl-meta.cpp b/utils/v4l2-ctl/v4l2-ctl-meta.cpp
index 3e71a6eb..718be765 100644
--- a/utils/v4l2-ctl/v4l2-ctl-meta.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-meta.cpp
@@ -1,18 +1,18 @@
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <dirent.h>
-#include <math.h>
+#include <cmath>
 
 #include "v4l2-ctl.h"
 
diff --git a/utils/v4l2-ctl/v4l2-ctl-misc.cpp b/utils/v4l2-ctl/v4l2-ctl-misc.cpp
index deb481b4..5a89aa7e 100644
--- a/utils/v4l2-ctl/v4l2-ctl-misc.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-misc.cpp
@@ -1,18 +1,18 @@
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <dirent.h>
-#include <math.h>
+#include <cmath>
 
 #include "v4l2-ctl.h"
 
diff --git a/utils/v4l2-ctl/v4l2-ctl-modes.cpp b/utils/v4l2-ctl/v4l2-ctl-modes.cpp
index b311ce5d..e076be6e 100644
--- a/utils/v4l2-ctl/v4l2-ctl-modes.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-modes.cpp
@@ -6,8 +6,8 @@
  * reserved.
  */
 
-#include <stdio.h>
-#include <stdbool.h>
+#include <cstdio>
+
 #include "v4l2-ctl.h"
 
 static bool valid_params(int width, int height, int refresh_rate)
diff --git a/utils/v4l2-ctl/v4l2-ctl-overlay.cpp b/utils/v4l2-ctl/v4l2-ctl-overlay.cpp
index 16344a15..a16e10db 100644
--- a/utils/v4l2-ctl/v4l2-ctl-overlay.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-overlay.cpp
@@ -1,18 +1,18 @@
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <dirent.h>
-#include <math.h>
+#include <cmath>
 
 #include <linux/fb.h>
 #include <vector>
diff --git a/utils/v4l2-ctl/v4l2-ctl-sdr.cpp b/utils/v4l2-ctl/v4l2-ctl-sdr.cpp
index 71a65913..67603285 100644
--- a/utils/v4l2-ctl/v4l2-ctl-sdr.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-sdr.cpp
@@ -1,18 +1,18 @@
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <dirent.h>
-#include <math.h>
+#include <cmath>
 
 #include "v4l2-ctl.h"
 
diff --git a/utils/v4l2-ctl/v4l2-ctl-selection.cpp b/utils/v4l2-ctl/v4l2-ctl-selection.cpp
index be62eb03..9f3e0397 100644
--- a/utils/v4l2-ctl/v4l2-ctl-selection.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-selection.cpp
@@ -1,18 +1,18 @@
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <dirent.h>
-#include <math.h>
+#include <cmath>
 
 #include "v4l2-ctl.h"
 
diff --git a/utils/v4l2-ctl/v4l2-ctl-stds.cpp b/utils/v4l2-ctl/v4l2-ctl-stds.cpp
index 8dd06c43..3eb67316 100644
--- a/utils/v4l2-ctl/v4l2-ctl-stds.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-stds.cpp
@@ -1,18 +1,18 @@
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <dirent.h>
-#include <math.h>
+#include <cmath>
 
 #include "v4l2-ctl.h"
 
diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
index 8578610d..fab8f36b 100644
--- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
@@ -1,8 +1,8 @@
 #include <cstring>
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
+#include <cstdlib>
+#include <cstdio>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
@@ -11,13 +11,13 @@
 #include <netinet/in.h>
 #include <netdb.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <sys/mman.h>
 #include <dirent.h>
-#include <math.h>
+#include <cmath>
 #include <linux/media.h>
 
 #include "compiler.h"
diff --git a/utils/v4l2-ctl/v4l2-ctl-subdev.cpp b/utils/v4l2-ctl/v4l2-ctl-subdev.cpp
index 9e17a58d..1bf35b1d 100644
--- a/utils/v4l2-ctl/v4l2-ctl-subdev.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-subdev.cpp
@@ -1,18 +1,18 @@
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <dirent.h>
-#include <math.h>
+#include <cmath>
 
 #include "v4l2-ctl.h"
 
diff --git a/utils/v4l2-ctl/v4l2-ctl-tuner.cpp b/utils/v4l2-ctl/v4l2-ctl-tuner.cpp
index 981b8765..54635998 100644
--- a/utils/v4l2-ctl/v4l2-ctl-tuner.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-tuner.cpp
@@ -1,14 +1,14 @@
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <dirent.h>
diff --git a/utils/v4l2-ctl/v4l2-ctl-vbi.cpp b/utils/v4l2-ctl/v4l2-ctl-vbi.cpp
index ee55012f..c09bc3e2 100644
--- a/utils/v4l2-ctl/v4l2-ctl-vbi.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-vbi.cpp
@@ -1,19 +1,19 @@
 #include <cstring>
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
+#include <cstdlib>
+#include <cstdio>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <dirent.h>
-#include <math.h>
+#include <cmath>
 
 #include "compiler.h"
 #include "v4l2-ctl.h"
diff --git a/utils/v4l2-ctl/v4l2-ctl-vidcap.cpp b/utils/v4l2-ctl/v4l2-ctl-vidcap.cpp
index 6e920c1d..68896248 100644
--- a/utils/v4l2-ctl/v4l2-ctl-vidcap.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-vidcap.cpp
@@ -1,18 +1,18 @@
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <dirent.h>
-#include <math.h>
+#include <cmath>
 
 #include "v4l2-ctl.h"
 
diff --git a/utils/v4l2-ctl/v4l2-ctl-vidout.cpp b/utils/v4l2-ctl/v4l2-ctl-vidout.cpp
index e3cb4bcb..39952eef 100644
--- a/utils/v4l2-ctl/v4l2-ctl-vidout.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-vidout.cpp
@@ -1,18 +1,18 @@
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <dirent.h>
-#include <math.h>
+#include <cmath>
 
 #include "v4l2-ctl.h"
 
diff --git a/utils/v4l2-ctl/v4l2-ctl.cpp b/utils/v4l2-ctl/v4l2-ctl.cpp
index e7b270cd..3d784bc2 100644
--- a/utils/v4l2-ctl/v4l2-ctl.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl.cpp
@@ -21,22 +21,22 @@
  */
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/epoll.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <sys/sysmacros.h>
 #include <dirent.h>
-#include <math.h>
+#include <cmath>
 
 #include <linux/media.h>
 
diff --git a/utils/v4l2-dbg/v4l2-dbg.cpp b/utils/v4l2-dbg/v4l2-dbg.cpp
index 06301ae0..765362f6 100644
--- a/utils/v4l2-dbg/v4l2-dbg.cpp
+++ b/utils/v4l2-dbg/v4l2-dbg.cpp
@@ -17,18 +17,18 @@
  */
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
+#include <cstdlib>
+#include <cstdio>
 #include <inttypes.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cctype>
+#include <cerrno>
 #include <sys/ioctl.h>
 #include <sys/time.h>
-#include <math.h>
+#include <cmath>
 
 #ifdef ANDROID
 #include <android-config.h>
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/3] utils: switch C to C++ headers
  2020-05-11  1:25 ` [PATCH 3/3] utils: switch C to C++ headers Rosen Penev
@ 2020-05-11  7:21   ` Hans Verkuil
  2020-05-12 20:51     ` Rosen Penev
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Verkuil @ 2020-05-11  7:21 UTC (permalink / raw)
  To: Rosen Penev, linux-media

On 11/05/2020 03:25, Rosen Penev wrote:
> Recently, I changed exit() to the std variant, which caused build
> failures on older platforms. Switch all headers to the C++ variants
> to avoid this.
> 
> These C headers are deprecated by C++14.

What build failure? Can you show what the error is? And which older
platforms?

I'd really like to know what the precise problem is that this patch
fixes.

I'll merge patches 1 and 2, but not this one. I need a better and more
detailed commit log message.

Regards,

	Hans


> 
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
>  utils/cec-compliance/cec-compliance.cpp          | 10 +++++-----
>  utils/cec-compliance/cec-test-adapter.cpp        | 10 +++++-----
>  utils/cec-compliance/cec-test-audio.cpp          | 10 +++++-----
>  utils/cec-compliance/cec-test-fuzzing.cpp        | 10 +++++-----
>  utils/cec-compliance/cec-test-power.cpp          | 10 +++++-----
>  utils/cec-compliance/cec-test.cpp                |  8 ++++----
>  utils/cec-ctl/cec-ctl.cpp                        | 10 +++++-----
>  utils/cec-ctl/cec-pin.cpp                        | 12 ++++++------
>  utils/cec-follower/cec-follower.cpp              |  8 ++++----
>  utils/cec-follower/cec-processing.cpp            | 10 +++++-----
>  utils/cec-follower/cec-tuner.cpp                 |  2 +-
>  utils/common/media-info.cpp                      | 10 +++++-----
>  utils/common/v4l2-info.cpp                       | 10 +++++-----
>  utils/libcecutil/cec-info.cpp                    |  2 +-
>  utils/libcecutil/cec-log.cpp                     |  8 ++++----
>  utils/libcecutil/cec-parse.cpp                   | 10 +++++-----
>  utils/rds-ctl/rds-ctl.cpp                        | 14 +++++++-------
>  utils/v4l2-compliance/v4l2-compliance.cpp        | 12 ++++++------
>  utils/v4l2-compliance/v4l2-test-buffers.cpp      | 10 +++++-----
>  utils/v4l2-compliance/v4l2-test-codecs.cpp       | 12 ++++++------
>  utils/v4l2-compliance/v4l2-test-colors.cpp       | 12 ++++++------
>  utils/v4l2-compliance/v4l2-test-controls.cpp     | 10 +++++-----
>  utils/v4l2-compliance/v4l2-test-debug.cpp        | 12 ++++++------
>  utils/v4l2-compliance/v4l2-test-formats.cpp      | 12 ++++++------
>  utils/v4l2-compliance/v4l2-test-input-output.cpp | 10 +++++-----
>  utils/v4l2-compliance/v4l2-test-io-config.cpp    | 10 +++++-----
>  utils/v4l2-compliance/v4l2-test-media.cpp        | 12 ++++++------
>  utils/v4l2-compliance/v4l2-test-subdevs.cpp      | 12 ++++++------
>  utils/v4l2-ctl/v4l2-ctl-common.cpp               | 10 +++++-----
>  utils/v4l2-ctl/v4l2-ctl-edid.cpp                 |  8 ++++----
>  utils/v4l2-ctl/v4l2-ctl-io.cpp                   | 12 ++++++------
>  utils/v4l2-ctl/v4l2-ctl-meta.cpp                 | 12 ++++++------
>  utils/v4l2-ctl/v4l2-ctl-misc.cpp                 | 12 ++++++------
>  utils/v4l2-ctl/v4l2-ctl-modes.cpp                |  4 ++--
>  utils/v4l2-ctl/v4l2-ctl-overlay.cpp              | 12 ++++++------
>  utils/v4l2-ctl/v4l2-ctl-sdr.cpp                  | 12 ++++++------
>  utils/v4l2-ctl/v4l2-ctl-selection.cpp            | 12 ++++++------
>  utils/v4l2-ctl/v4l2-ctl-stds.cpp                 | 12 ++++++------
>  utils/v4l2-ctl/v4l2-ctl-streaming.cpp            | 10 +++++-----
>  utils/v4l2-ctl/v4l2-ctl-subdev.cpp               | 12 ++++++------
>  utils/v4l2-ctl/v4l2-ctl-tuner.cpp                | 10 +++++-----
>  utils/v4l2-ctl/v4l2-ctl-vbi.cpp                  | 10 +++++-----
>  utils/v4l2-ctl/v4l2-ctl-vidcap.cpp               | 12 ++++++------
>  utils/v4l2-ctl/v4l2-ctl-vidout.cpp               | 12 ++++++------
>  utils/v4l2-ctl/v4l2-ctl.cpp                      | 12 ++++++------
>  utils/v4l2-dbg/v4l2-dbg.cpp                      | 10 +++++-----
>  46 files changed, 236 insertions(+), 236 deletions(-)
> 
> diff --git a/utils/cec-compliance/cec-compliance.cpp b/utils/cec-compliance/cec-compliance.cpp
> index d0580579..60298846 100644
> --- a/utils/cec-compliance/cec-compliance.cpp
> +++ b/utils/cec-compliance/cec-compliance.cpp
> @@ -4,17 +4,17 @@
>   */
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <getopt.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <sys/time.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <sys/wait.h>
>  #include <sstream>
> diff --git a/utils/cec-compliance/cec-test-adapter.cpp b/utils/cec-compliance/cec-test-adapter.cpp
> index df7374df..b7a8159d 100644
> --- a/utils/cec-compliance/cec-test-adapter.cpp
> +++ b/utils/cec-compliance/cec-test-adapter.cpp
> @@ -4,16 +4,16 @@
>   */
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <getopt.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <sys/wait.h>
>  #include <sstream>
> diff --git a/utils/cec-compliance/cec-test-audio.cpp b/utils/cec-compliance/cec-test-audio.cpp
> index d422a7da..edf528c9 100644
> --- a/utils/cec-compliance/cec-test-audio.cpp
> +++ b/utils/cec-compliance/cec-test-audio.cpp
> @@ -4,15 +4,15 @@
>   */
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <config.h>
>  
> diff --git a/utils/cec-compliance/cec-test-fuzzing.cpp b/utils/cec-compliance/cec-test-fuzzing.cpp
> index ce0bf12d..708a8ec3 100644
> --- a/utils/cec-compliance/cec-test-fuzzing.cpp
> +++ b/utils/cec-compliance/cec-test-fuzzing.cpp
> @@ -4,15 +4,15 @@
>   */
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <config.h>
>  #include <sstream>
> diff --git a/utils/cec-compliance/cec-test-power.cpp b/utils/cec-compliance/cec-test-power.cpp
> index 2758c36d..e35264aa 100644
> --- a/utils/cec-compliance/cec-test-power.cpp
> +++ b/utils/cec-compliance/cec-test-power.cpp
> @@ -4,15 +4,15 @@
>   */
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <config.h>
>  
> diff --git a/utils/cec-compliance/cec-test.cpp b/utils/cec-compliance/cec-test.cpp
> index a84f83d3..1a05c5ae 100644
> --- a/utils/cec-compliance/cec-test.cpp
> +++ b/utils/cec-compliance/cec-test.cpp
> @@ -6,14 +6,14 @@
>  #include <cstring>
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> +#include <cstdlib>
> +#include <cstdio>
>  #include <inttypes.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <config.h>
>  #include <sstream>
> diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp
> index 899b83b1..3c6c6f98 100644
> --- a/utils/cec-ctl/cec-ctl.cpp
> +++ b/utils/cec-ctl/cec-ctl.cpp
> @@ -6,8 +6,8 @@
>  #include <cstring>
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> +#include <cstdlib>
> +#include <cstdio>
>  #include <inttypes.h>
>  #include <getopt.h>
>  #include <sys/types.h>
> @@ -15,10 +15,10 @@
>  #include <sys/time.h>
>  #include <dirent.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
> -#include <stdarg.h>
> +#include <cstdarg>
>  #include <ctime>
>  #include <cerrno>
>  #include <string>
> diff --git a/utils/cec-ctl/cec-pin.cpp b/utils/cec-ctl/cec-pin.cpp
> index c09d6bbd..3ff4734f 100644
> --- a/utils/cec-ctl/cec-pin.cpp
> +++ b/utils/cec-ctl/cec-pin.cpp
> @@ -4,19 +4,19 @@
>   */
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <getopt.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <sys/time.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
> -#include <stdarg.h>
> +#include <cstdarg>
>  #include <cerrno>
>  #include <string>
>  #include <vector>
> diff --git a/utils/cec-follower/cec-follower.cpp b/utils/cec-follower/cec-follower.cpp
> index 589426ec..c6e0a1d1 100644
> --- a/utils/cec-follower/cec-follower.cpp
> +++ b/utils/cec-follower/cec-follower.cpp
> @@ -6,15 +6,15 @@
>  #include <cstring>
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> +#include <cstdlib>
> +#include <cstdio>
>  #include <inttypes.h>
>  #include <getopt.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <sys/wait.h>
>  #include <sstream>
> diff --git a/utils/cec-follower/cec-processing.cpp b/utils/cec-follower/cec-processing.cpp
> index bc8c9c09..e2c5c8e2 100644
> --- a/utils/cec-follower/cec-processing.cpp
> +++ b/utils/cec-follower/cec-processing.cpp
> @@ -4,16 +4,16 @@
>   */
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <sys/time.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <config.h>
>  
> diff --git a/utils/cec-follower/cec-tuner.cpp b/utils/cec-follower/cec-tuner.cpp
> index 4aecebce..7ac0decb 100644
> --- a/utils/cec-follower/cec-tuner.cpp
> +++ b/utils/cec-follower/cec-tuner.cpp
> @@ -4,7 +4,7 @@
>   */
>  
>  #include <sys/ioctl.h>
> -#include <stdlib.h>
> +#include <cstdlib>
>  
>  #include "cec-follower.h"
>  #include "compiler.h"
> diff --git a/utils/common/media-info.cpp b/utils/common/media-info.cpp
> index 8aa12f34..d37c5acb 100644
> --- a/utils/common/media-info.cpp
> +++ b/utils/common/media-info.cpp
> @@ -4,15 +4,15 @@
>   */
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <sys/time.h>
>  #include <sys/sysmacros.h>
> diff --git a/utils/common/v4l2-info.cpp b/utils/common/v4l2-info.cpp
> index 0aac8504..28116fd3 100644
> --- a/utils/common/v4l2-info.cpp
> +++ b/utils/common/v4l2-info.cpp
> @@ -4,15 +4,15 @@
>   */
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <sys/time.h>
>  #include <sys/sysmacros.h>
> diff --git a/utils/libcecutil/cec-info.cpp b/utils/libcecutil/cec-info.cpp
> index f6e60918..ed244437 100644
> --- a/utils/libcecutil/cec-info.cpp
> +++ b/utils/libcecutil/cec-info.cpp
> @@ -5,7 +5,7 @@
>   * Copyright 2017 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
>   */
>  
> -#include <stdio.h>
> +#include <cstdio>
>  #include <string>
>  #include <unistd.h>
>  #include <fcntl.h>
> diff --git a/utils/libcecutil/cec-log.cpp b/utils/libcecutil/cec-log.cpp
> index 0dcb4675..40028630 100644
> --- a/utils/libcecutil/cec-log.cpp
> +++ b/utils/libcecutil/cec-log.cpp
> @@ -4,11 +4,11 @@
>   */
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
> -#include <stdarg.h>
> +#include <cstdarg>
>  #include <string>
>  #include <linux/cec-funcs.h>
>  #include "cec-htng-funcs.h"
> diff --git a/utils/libcecutil/cec-parse.cpp b/utils/libcecutil/cec-parse.cpp
> index 8c869fec..024b6285 100644
> --- a/utils/libcecutil/cec-parse.cpp
> +++ b/utils/libcecutil/cec-parse.cpp
> @@ -4,8 +4,8 @@
>   */
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> +#include <cstdlib>
> +#include <cstdio>
>  #include <inttypes.h>
>  #include <getopt.h>
>  #include <sys/types.h>
> @@ -13,10 +13,10 @@
>  #include <sys/time.h>
>  #include <dirent.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
> -#include <stdarg.h>
> +#include <cstdarg>
>  #include <cstring>
>  #include <ctime>
>  #include <cerrno>
> diff --git a/utils/rds-ctl/rds-ctl.cpp b/utils/rds-ctl/rds-ctl.cpp
> index 73fc7e3c..fbc4d310 100644
> --- a/utils/rds-ctl/rds-ctl.cpp
> +++ b/utils/rds-ctl/rds-ctl.cpp
> @@ -8,21 +8,21 @@
>   */
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> -#include <wchar.h>
> -#include <locale.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
> +#include <cwchar>
> +#include <clocale>
>  #include <inttypes.h>
>  #include <getopt.h>
>  #include <sys/types.h>
>  #include <fcntl.h>
> -#include <errno.h>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <sys/time.h>
>  #include <dirent.h>
>  #include <config.h>
> -#include <signal.h>
> +#include <csignal>
>  
>  #include <linux/videodev2.h>
>  #include <libv4l2rds.h>
> diff --git a/utils/v4l2-compliance/v4l2-compliance.cpp b/utils/v4l2-compliance/v4l2-compliance.cpp
> index 549e37f7..49606975 100644
> --- a/utils/v4l2-compliance/v4l2-compliance.cpp
> +++ b/utils/v4l2-compliance/v4l2-compliance.cpp
> @@ -21,22 +21,22 @@
>  #include <cstring>
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> +#include <cstdlib>
> +#include <cstdio>
>  #include <inttypes.h>
>  #include <getopt.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <sys/time.h>
>  #include <sys/sysmacros.h>
>  #include <dirent.h>
> -#include <math.h>
> +#include <cmath>
>  #include <sys/utsname.h>
> -#include <signal.h>
> +#include <csignal>
>  #include <vector>
>  
>  #include "v4l2-compliance.h"
> diff --git a/utils/v4l2-compliance/v4l2-test-buffers.cpp b/utils/v4l2-compliance/v4l2-test-buffers.cpp
> index fc49fff6..e2df126d 100644
> --- a/utils/v4l2-compliance/v4l2-test-buffers.cpp
> +++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp
> @@ -19,9 +19,9 @@
>   */
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
> @@ -29,8 +29,8 @@
>  #include <sys/wait.h>
>  #include <sys/epoll.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <poll.h>
>  #include <sys/ioctl.h>
>  #include <netinet/in.h>
> diff --git a/utils/v4l2-compliance/v4l2-test-codecs.cpp b/utils/v4l2-compliance/v4l2-test-codecs.cpp
> index 3fd44c8b..377574ec 100644
> --- a/utils/v4l2-compliance/v4l2-test-codecs.cpp
> +++ b/utils/v4l2-compliance/v4l2-test-codecs.cpp
> @@ -19,17 +19,17 @@
>   */
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
> -#include <assert.h>
> +#include <cassert>
>  #include "v4l2-compliance.h"
>  
>  int testEncoder(struct node *node)
> diff --git a/utils/v4l2-compliance/v4l2-test-colors.cpp b/utils/v4l2-compliance/v4l2-test-colors.cpp
> index 09d29a3e..6996877d 100644
> --- a/utils/v4l2-compliance/v4l2-test-colors.cpp
> +++ b/utils/v4l2-compliance/v4l2-test-colors.cpp
> @@ -15,19 +15,19 @@
>   */
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <getopt.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <sys/time.h>
> -#include <math.h>
> +#include <cmath>
>  
>  #include "compiler.h"
>  #include "v4l2-compliance.h"
> diff --git a/utils/v4l2-compliance/v4l2-test-controls.cpp b/utils/v4l2-compliance/v4l2-test-controls.cpp
> index d81dddb2..c3c27119 100644
> --- a/utils/v4l2-compliance/v4l2-test-controls.cpp
> +++ b/utils/v4l2-compliance/v4l2-test-controls.cpp
> @@ -19,15 +19,15 @@
>   */
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <vector>
>  
> diff --git a/utils/v4l2-compliance/v4l2-test-debug.cpp b/utils/v4l2-compliance/v4l2-test-debug.cpp
> index 3f43e661..206b4b82 100644
> --- a/utils/v4l2-compliance/v4l2-test-debug.cpp
> +++ b/utils/v4l2-compliance/v4l2-test-debug.cpp
> @@ -19,19 +19,19 @@
>   */
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <getopt.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <sys/time.h>
> -#include <math.h>
> +#include <cmath>
>  #include "v4l2-compliance.h"
>  
>  int testRegister(struct node *node)
> diff --git a/utils/v4l2-compliance/v4l2-test-formats.cpp b/utils/v4l2-compliance/v4l2-test-formats.cpp
> index e1b00f3c..7780442e 100644
> --- a/utils/v4l2-compliance/v4l2-test-formats.cpp
> +++ b/utils/v4l2-compliance/v4l2-test-formats.cpp
> @@ -19,17 +19,17 @@
>   */
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
> -#include <assert.h>
> +#include <cassert>
>  
>  #include "compiler.h"
>  #include "v4l2-compliance.h"
> diff --git a/utils/v4l2-compliance/v4l2-test-input-output.cpp b/utils/v4l2-compliance/v4l2-test-input-output.cpp
> index 80ecf75d..a7fe81d8 100644
> --- a/utils/v4l2-compliance/v4l2-test-input-output.cpp
> +++ b/utils/v4l2-compliance/v4l2-test-input-output.cpp
> @@ -19,15 +19,15 @@
>   */
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include "v4l2-compliance.h"
>  
> diff --git a/utils/v4l2-compliance/v4l2-test-io-config.cpp b/utils/v4l2-compliance/v4l2-test-io-config.cpp
> index 9ade11e8..be885cb3 100644
> --- a/utils/v4l2-compliance/v4l2-test-io-config.cpp
> +++ b/utils/v4l2-compliance/v4l2-test-io-config.cpp
> @@ -19,15 +19,15 @@
>   */
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include "v4l2-compliance.h"
>  
> diff --git a/utils/v4l2-compliance/v4l2-test-media.cpp b/utils/v4l2-compliance/v4l2-test-media.cpp
> index bcd8a725..94c25932 100644
> --- a/utils/v4l2-compliance/v4l2-test-media.cpp
> +++ b/utils/v4l2-compliance/v4l2-test-media.cpp
> @@ -19,19 +19,19 @@
>   */
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <sys/sysmacros.h>
>  #include <fcntl.h>
>  #include <dirent.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
> -#include <assert.h>
> +#include <cassert>
>  #include <set>
>  #include <fstream>
>  
> diff --git a/utils/v4l2-compliance/v4l2-test-subdevs.cpp b/utils/v4l2-compliance/v4l2-test-subdevs.cpp
> index 489639fb..54d3c430 100644
> --- a/utils/v4l2-compliance/v4l2-test-subdevs.cpp
> +++ b/utils/v4l2-compliance/v4l2-test-subdevs.cpp
> @@ -19,17 +19,17 @@
>   */
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
> -#include <assert.h>
> +#include <cassert>
>  
>  #include "v4l2-compliance.h"
>  
> diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp
> index 0640a521..bf267432 100644
> --- a/utils/v4l2-ctl/v4l2-ctl-common.cpp
> +++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp
> @@ -1,18 +1,18 @@
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> +#include <cstdlib>
> +#include <cstdio>
>  #include <inttypes.h>
>  #include <getopt.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <sys/sysmacros.h>
>  #include <sys/time.h>
>  #include <dirent.h>
> -#include <math.h>
> +#include <cmath>
>  #include <linux/media.h>
>  
>  #include "v4l2-ctl.h"
> diff --git a/utils/v4l2-ctl/v4l2-ctl-edid.cpp b/utils/v4l2-ctl/v4l2-ctl-edid.cpp
> index b13d8209..d028d248 100644
> --- a/utils/v4l2-ctl/v4l2-ctl-edid.cpp
> +++ b/utils/v4l2-ctl/v4l2-ctl-edid.cpp
> @@ -1,12 +1,12 @@
>  #include <cstring>
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> +#include <cstdlib>
> +#include <cstdio>
>  #include <inttypes.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  
>  #include "v4l2-ctl.h"
> diff --git a/utils/v4l2-ctl/v4l2-ctl-io.cpp b/utils/v4l2-ctl/v4l2-ctl-io.cpp
> index 9e83c03a..379198b5 100644
> --- a/utils/v4l2-ctl/v4l2-ctl-io.cpp
> +++ b/utils/v4l2-ctl/v4l2-ctl-io.cpp
> @@ -1,18 +1,18 @@
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <getopt.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <sys/time.h>
>  #include <dirent.h>
> -#include <math.h>
> +#include <cmath>
>  
>  #include "v4l2-ctl.h"
>  
> diff --git a/utils/v4l2-ctl/v4l2-ctl-meta.cpp b/utils/v4l2-ctl/v4l2-ctl-meta.cpp
> index 3e71a6eb..718be765 100644
> --- a/utils/v4l2-ctl/v4l2-ctl-meta.cpp
> +++ b/utils/v4l2-ctl/v4l2-ctl-meta.cpp
> @@ -1,18 +1,18 @@
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <getopt.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <sys/time.h>
>  #include <dirent.h>
> -#include <math.h>
> +#include <cmath>
>  
>  #include "v4l2-ctl.h"
>  
> diff --git a/utils/v4l2-ctl/v4l2-ctl-misc.cpp b/utils/v4l2-ctl/v4l2-ctl-misc.cpp
> index deb481b4..5a89aa7e 100644
> --- a/utils/v4l2-ctl/v4l2-ctl-misc.cpp
> +++ b/utils/v4l2-ctl/v4l2-ctl-misc.cpp
> @@ -1,18 +1,18 @@
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <getopt.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <sys/time.h>
>  #include <dirent.h>
> -#include <math.h>
> +#include <cmath>
>  
>  #include "v4l2-ctl.h"
>  
> diff --git a/utils/v4l2-ctl/v4l2-ctl-modes.cpp b/utils/v4l2-ctl/v4l2-ctl-modes.cpp
> index b311ce5d..e076be6e 100644
> --- a/utils/v4l2-ctl/v4l2-ctl-modes.cpp
> +++ b/utils/v4l2-ctl/v4l2-ctl-modes.cpp
> @@ -6,8 +6,8 @@
>   * reserved.
>   */
>  
> -#include <stdio.h>
> -#include <stdbool.h>
> +#include <cstdio>
> +
>  #include "v4l2-ctl.h"
>  
>  static bool valid_params(int width, int height, int refresh_rate)
> diff --git a/utils/v4l2-ctl/v4l2-ctl-overlay.cpp b/utils/v4l2-ctl/v4l2-ctl-overlay.cpp
> index 16344a15..a16e10db 100644
> --- a/utils/v4l2-ctl/v4l2-ctl-overlay.cpp
> +++ b/utils/v4l2-ctl/v4l2-ctl-overlay.cpp
> @@ -1,18 +1,18 @@
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <getopt.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <sys/time.h>
>  #include <dirent.h>
> -#include <math.h>
> +#include <cmath>
>  
>  #include <linux/fb.h>
>  #include <vector>
> diff --git a/utils/v4l2-ctl/v4l2-ctl-sdr.cpp b/utils/v4l2-ctl/v4l2-ctl-sdr.cpp
> index 71a65913..67603285 100644
> --- a/utils/v4l2-ctl/v4l2-ctl-sdr.cpp
> +++ b/utils/v4l2-ctl/v4l2-ctl-sdr.cpp
> @@ -1,18 +1,18 @@
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <getopt.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <sys/time.h>
>  #include <dirent.h>
> -#include <math.h>
> +#include <cmath>
>  
>  #include "v4l2-ctl.h"
>  
> diff --git a/utils/v4l2-ctl/v4l2-ctl-selection.cpp b/utils/v4l2-ctl/v4l2-ctl-selection.cpp
> index be62eb03..9f3e0397 100644
> --- a/utils/v4l2-ctl/v4l2-ctl-selection.cpp
> +++ b/utils/v4l2-ctl/v4l2-ctl-selection.cpp
> @@ -1,18 +1,18 @@
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <getopt.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <sys/time.h>
>  #include <dirent.h>
> -#include <math.h>
> +#include <cmath>
>  
>  #include "v4l2-ctl.h"
>  
> diff --git a/utils/v4l2-ctl/v4l2-ctl-stds.cpp b/utils/v4l2-ctl/v4l2-ctl-stds.cpp
> index 8dd06c43..3eb67316 100644
> --- a/utils/v4l2-ctl/v4l2-ctl-stds.cpp
> +++ b/utils/v4l2-ctl/v4l2-ctl-stds.cpp
> @@ -1,18 +1,18 @@
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <getopt.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <sys/time.h>
>  #include <dirent.h>
> -#include <math.h>
> +#include <cmath>
>  
>  #include "v4l2-ctl.h"
>  
> diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
> index 8578610d..fab8f36b 100644
> --- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
> +++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
> @@ -1,8 +1,8 @@
>  #include <cstring>
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> +#include <cstdlib>
> +#include <cstdio>
>  #include <inttypes.h>
>  #include <getopt.h>
>  #include <sys/types.h>
> @@ -11,13 +11,13 @@
>  #include <netinet/in.h>
>  #include <netdb.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <sys/time.h>
>  #include <sys/mman.h>
>  #include <dirent.h>
> -#include <math.h>
> +#include <cmath>
>  #include <linux/media.h>
>  
>  #include "compiler.h"
> diff --git a/utils/v4l2-ctl/v4l2-ctl-subdev.cpp b/utils/v4l2-ctl/v4l2-ctl-subdev.cpp
> index 9e17a58d..1bf35b1d 100644
> --- a/utils/v4l2-ctl/v4l2-ctl-subdev.cpp
> +++ b/utils/v4l2-ctl/v4l2-ctl-subdev.cpp
> @@ -1,18 +1,18 @@
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <getopt.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <sys/time.h>
>  #include <dirent.h>
> -#include <math.h>
> +#include <cmath>
>  
>  #include "v4l2-ctl.h"
>  
> diff --git a/utils/v4l2-ctl/v4l2-ctl-tuner.cpp b/utils/v4l2-ctl/v4l2-ctl-tuner.cpp
> index 981b8765..54635998 100644
> --- a/utils/v4l2-ctl/v4l2-ctl-tuner.cpp
> +++ b/utils/v4l2-ctl/v4l2-ctl-tuner.cpp
> @@ -1,14 +1,14 @@
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <getopt.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <sys/time.h>
>  #include <dirent.h>
> diff --git a/utils/v4l2-ctl/v4l2-ctl-vbi.cpp b/utils/v4l2-ctl/v4l2-ctl-vbi.cpp
> index ee55012f..c09bc3e2 100644
> --- a/utils/v4l2-ctl/v4l2-ctl-vbi.cpp
> +++ b/utils/v4l2-ctl/v4l2-ctl-vbi.cpp
> @@ -1,19 +1,19 @@
>  #include <cstring>
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> +#include <cstdlib>
> +#include <cstdio>
>  #include <inttypes.h>
>  #include <getopt.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <sys/time.h>
>  #include <dirent.h>
> -#include <math.h>
> +#include <cmath>
>  
>  #include "compiler.h"
>  #include "v4l2-ctl.h"
> diff --git a/utils/v4l2-ctl/v4l2-ctl-vidcap.cpp b/utils/v4l2-ctl/v4l2-ctl-vidcap.cpp
> index 6e920c1d..68896248 100644
> --- a/utils/v4l2-ctl/v4l2-ctl-vidcap.cpp
> +++ b/utils/v4l2-ctl/v4l2-ctl-vidcap.cpp
> @@ -1,18 +1,18 @@
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <getopt.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <sys/time.h>
>  #include <dirent.h>
> -#include <math.h>
> +#include <cmath>
>  
>  #include "v4l2-ctl.h"
>  
> diff --git a/utils/v4l2-ctl/v4l2-ctl-vidout.cpp b/utils/v4l2-ctl/v4l2-ctl-vidout.cpp
> index e3cb4bcb..39952eef 100644
> --- a/utils/v4l2-ctl/v4l2-ctl-vidout.cpp
> +++ b/utils/v4l2-ctl/v4l2-ctl-vidout.cpp
> @@ -1,18 +1,18 @@
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <getopt.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <sys/time.h>
>  #include <dirent.h>
> -#include <math.h>
> +#include <cmath>
>  
>  #include "v4l2-ctl.h"
>  
> diff --git a/utils/v4l2-ctl/v4l2-ctl.cpp b/utils/v4l2-ctl/v4l2-ctl.cpp
> index e7b270cd..3d784bc2 100644
> --- a/utils/v4l2-ctl/v4l2-ctl.cpp
> +++ b/utils/v4l2-ctl/v4l2-ctl.cpp
> @@ -21,22 +21,22 @@
>   */
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> +#include <cstdlib>
> +#include <cstdio>
> +#include <cstring>
>  #include <inttypes.h>
>  #include <getopt.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <sys/epoll.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <sys/time.h>
>  #include <sys/sysmacros.h>
>  #include <dirent.h>
> -#include <math.h>
> +#include <cmath>
>  
>  #include <linux/media.h>
>  
> diff --git a/utils/v4l2-dbg/v4l2-dbg.cpp b/utils/v4l2-dbg/v4l2-dbg.cpp
> index 06301ae0..765362f6 100644
> --- a/utils/v4l2-dbg/v4l2-dbg.cpp
> +++ b/utils/v4l2-dbg/v4l2-dbg.cpp
> @@ -17,18 +17,18 @@
>   */
>  
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> +#include <cstdlib>
> +#include <cstdio>
>  #include <inttypes.h>
>  #include <getopt.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <ctype.h>
> -#include <errno.h>
> +#include <cctype>
> +#include <cerrno>
>  #include <sys/ioctl.h>
>  #include <sys/time.h>
> -#include <math.h>
> +#include <cmath>
>  
>  #ifdef ANDROID
>  #include <android-config.h>
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/3] utils: switch strstr to std variant
  2020-05-11  1:25 ` [PATCH 2/3] utils: switch strstr to std variant Rosen Penev
@ 2020-05-11  7:23   ` Hans Verkuil
  2020-05-12  6:00     ` Rosen Penev
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Verkuil @ 2020-05-11  7:23 UTC (permalink / raw)
  To: Rosen Penev, linux-media

On 11/05/2020 03:25, Rosen Penev wrote:
> strstr has const overloads in std, avoiding pointless conversions.
> 
> Signed-off-by: Rosen Penev <rosenp@gmail.com>

This introduces a compile error:

v4l2-ctl-misc.cpp: In function ‘void misc_cmd(int, char*)’:
v4l2-ctl-misc.cpp:215:14: error: ‘strstr’ is not a member of ‘std’; did you mean ‘strstr’?
  215 |     if (std::strstr(value, "dht"))
      |              ^~~~~~
In file included from v4l2-ctl-misc.cpp:4:
/usr/include/string.h:323:1: note: ‘strstr’ declared here
  323 | strstr (const char *__haystack, const char *__needle) __THROW
      | ^~~~~~
v4l2-ctl-misc.cpp:217:14: error: ‘strstr’ is not a member of ‘std’; did you mean ‘strstr’?
  217 |     if (std::strstr(value, "dqt"))
      |              ^~~~~~
In file included from v4l2-ctl-misc.cpp:4:
/usr/include/string.h:323:1: note: ‘strstr’ declared here
  323 | strstr (const char *__haystack, const char *__needle) __THROW
      | ^~~~~~
v4l2-ctl-misc.cpp:219:14: error: ‘strstr’ is not a member of ‘std’; did you mean ‘strstr’?
  219 |     if (std::strstr(value, "dri"))
      |              ^~~~~~
In file included from v4l2-ctl-misc.cpp:4:
/usr/include/string.h:323:1: note: ‘strstr’ declared here
  323 | strstr (const char *__haystack, const char *__needle) __THROW
      | ^~~~~~

Probably a missing header.

Regards,

	Hans

> ---
>  utils/libcecutil/cec-log.cpp       | 2 +-
>  utils/v4l2-ctl/v4l2-ctl-common.cpp | 4 ++--
>  utils/v4l2-ctl/v4l2-ctl-misc.cpp   | 6 +++---
>  utils/v4l2-dbg/v4l2-dbg.cpp        | 4 ++--
>  4 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/utils/libcecutil/cec-log.cpp b/utils/libcecutil/cec-log.cpp
> index 9410c071..0dcb4675 100644
> --- a/utils/libcecutil/cec-log.cpp
> +++ b/utils/libcecutil/cec-log.cpp
> @@ -62,7 +62,7 @@ static void log_arg(const struct cec_arg *arg, const char *arg_name, __u32 val)
>  		}
>  		return;
>  	case CEC_ARG_TYPE_U16:
> -		if (strstr(arg_name, "phys-addr"))
> +		if (std::strstr(arg_name, "phys-addr"))
>  			printf("\t%s: %x.%x.%x.%x\n", arg_name, cec_phys_addr_exp(val));
>  		else
>  			printf("\t%s: %u (0x%04x)\n", arg_name, val, val);
> diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp
> index 47f5da1a..0640a521 100644
> --- a/utils/v4l2-ctl/v4l2-ctl-common.cpp
> +++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp
> @@ -1190,13 +1190,13 @@ void common_get(cv4l_fd &_fd)
>  				char *q;
>  
>  				buf[len] = 0;
> -				while ((q = strstr(p, "START STATUS"))) {
> +				while ((q = std::strstr(p, "START STATUS"))) {
>  					p = q + 1;
>  				}
>  				if (p) {
>  					while (p > buf && *p != '<') p--;
>  					q = p;
> -					while ((q = strstr(q, "<6>"))) {
> +					while ((q = std::strstr(q, "<6>"))) {
>  						memcpy(q, "   ", 3);
>  					}
>  					printf("%s", p);
> diff --git a/utils/v4l2-ctl/v4l2-ctl-misc.cpp b/utils/v4l2-ctl/v4l2-ctl-misc.cpp
> index 6db87568..deb481b4 100644
> --- a/utils/v4l2-ctl/v4l2-ctl-misc.cpp
> +++ b/utils/v4l2-ctl/v4l2-ctl-misc.cpp
> @@ -212,11 +212,11 @@ void misc_cmd(int ch, char *optarg)
>  				jpegcomp.quality = strtol(value, 0L, 0);
>  				break;
>  			case 17:
> -				if (strstr(value, "dht"))
> +				if (std::strstr(value, "dht"))
>  					jpegcomp.jpeg_markers |= V4L2_JPEG_MARKER_DHT;
> -				if (strstr(value, "dqt"))
> +				if (std::strstr(value, "dqt"))
>  					jpegcomp.jpeg_markers |= V4L2_JPEG_MARKER_DQT;
> -				if (strstr(value, "dri"))
> +				if (std::strstr(value, "dri"))
>  					jpegcomp.jpeg_markers |= V4L2_JPEG_MARKER_DRI;
>  				break;
>  			case 18:
> diff --git a/utils/v4l2-dbg/v4l2-dbg.cpp b/utils/v4l2-dbg/v4l2-dbg.cpp
> index 86266376..06301ae0 100644
> --- a/utils/v4l2-dbg/v4l2-dbg.cpp
> +++ b/utils/v4l2-dbg/v4l2-dbg.cpp
> @@ -784,14 +784,14 @@ list_done:
>  				char *q;
>  
>  				buf[len] = 0;
> -				while ((q = strstr(p, "START STATUS"))) {
> +				while ((q = std::strstr(p, "START STATUS"))) {
>  					found_status = true;
>  					p = q + 1;
>  				}
>  				if (found_status) {
>  					while (p > buf && *p != '<') p--;
>  					q = p;
> -					while ((q = strstr(q, "<6>"))) {
> +					while ((q = std::strstr(q, "<6>"))) {
>  						memcpy(q, "   ", 3);
>  					}
>  					printf("%s", p);
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/3] utils: switch strstr to std variant
  2020-05-11  7:23   ` Hans Verkuil
@ 2020-05-12  6:00     ` Rosen Penev
  0 siblings, 0 replies; 7+ messages in thread
From: Rosen Penev @ 2020-05-12  6:00 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: Linux Media Mailing List

On Mon, May 11, 2020 at 12:23 AM Hans Verkuil <hverkuil@xs4all.nl> wrote:
>
> On 11/05/2020 03:25, Rosen Penev wrote:
> > strstr has const overloads in std, avoiding pointless conversions.
> >
> > Signed-off-by: Rosen Penev <rosenp@gmail.com>
>
> This introduces a compile error:
>
> v4l2-ctl-misc.cpp: In function ‘void misc_cmd(int, char*)’:
> v4l2-ctl-misc.cpp:215:14: error: ‘strstr’ is not a member of ‘std’; did you mean ‘strstr’?
>   215 |     if (std::strstr(value, "dht"))
>       |              ^~~~~~
> In file included from v4l2-ctl-misc.cpp:4:
> /usr/include/string.h:323:1: note: ‘strstr’ declared here
>   323 | strstr (const char *__haystack, const char *__needle) __THROW
>       | ^~~~~~
> v4l2-ctl-misc.cpp:217:14: error: ‘strstr’ is not a member of ‘std’; did you mean ‘strstr’?
>   217 |     if (std::strstr(value, "dqt"))
>       |              ^~~~~~
> In file included from v4l2-ctl-misc.cpp:4:
> /usr/include/string.h:323:1: note: ‘strstr’ declared here
>   323 | strstr (const char *__haystack, const char *__needle) __THROW
>       | ^~~~~~
> v4l2-ctl-misc.cpp:219:14: error: ‘strstr’ is not a member of ‘std’; did you mean ‘strstr’?
>   219 |     if (std::strstr(value, "dri"))
>       |              ^~~~~~
> In file included from v4l2-ctl-misc.cpp:4:
> /usr/include/string.h:323:1: note: ‘strstr’ declared here
>   323 | strstr (const char *__haystack, const char *__needle) __THROW
>       | ^~~~~~
>
> Probably a missing header.
Fixed by my other patch of course :).
>
> Regards,
>
>         Hans
>
> > ---
> >  utils/libcecutil/cec-log.cpp       | 2 +-
> >  utils/v4l2-ctl/v4l2-ctl-common.cpp | 4 ++--
> >  utils/v4l2-ctl/v4l2-ctl-misc.cpp   | 6 +++---
> >  utils/v4l2-dbg/v4l2-dbg.cpp        | 4 ++--
> >  4 files changed, 8 insertions(+), 8 deletions(-)
> >
> > diff --git a/utils/libcecutil/cec-log.cpp b/utils/libcecutil/cec-log.cpp
> > index 9410c071..0dcb4675 100644
> > --- a/utils/libcecutil/cec-log.cpp
> > +++ b/utils/libcecutil/cec-log.cpp
> > @@ -62,7 +62,7 @@ static void log_arg(const struct cec_arg *arg, const char *arg_name, __u32 val)
> >               }
> >               return;
> >       case CEC_ARG_TYPE_U16:
> > -             if (strstr(arg_name, "phys-addr"))
> > +             if (std::strstr(arg_name, "phys-addr"))
> >                       printf("\t%s: %x.%x.%x.%x\n", arg_name, cec_phys_addr_exp(val));
> >               else
> >                       printf("\t%s: %u (0x%04x)\n", arg_name, val, val);
> > diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp
> > index 47f5da1a..0640a521 100644
> > --- a/utils/v4l2-ctl/v4l2-ctl-common.cpp
> > +++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp
> > @@ -1190,13 +1190,13 @@ void common_get(cv4l_fd &_fd)
> >                               char *q;
> >
> >                               buf[len] = 0;
> > -                             while ((q = strstr(p, "START STATUS"))) {
> > +                             while ((q = std::strstr(p, "START STATUS"))) {
> >                                       p = q + 1;
> >                               }
> >                               if (p) {
> >                                       while (p > buf && *p != '<') p--;
> >                                       q = p;
> > -                                     while ((q = strstr(q, "<6>"))) {
> > +                                     while ((q = std::strstr(q, "<6>"))) {
> >                                               memcpy(q, "   ", 3);
> >                                       }
> >                                       printf("%s", p);
> > diff --git a/utils/v4l2-ctl/v4l2-ctl-misc.cpp b/utils/v4l2-ctl/v4l2-ctl-misc.cpp
> > index 6db87568..deb481b4 100644
> > --- a/utils/v4l2-ctl/v4l2-ctl-misc.cpp
> > +++ b/utils/v4l2-ctl/v4l2-ctl-misc.cpp
> > @@ -212,11 +212,11 @@ void misc_cmd(int ch, char *optarg)
> >                               jpegcomp.quality = strtol(value, 0L, 0);
> >                               break;
> >                       case 17:
> > -                             if (strstr(value, "dht"))
> > +                             if (std::strstr(value, "dht"))
> >                                       jpegcomp.jpeg_markers |= V4L2_JPEG_MARKER_DHT;
> > -                             if (strstr(value, "dqt"))
> > +                             if (std::strstr(value, "dqt"))
> >                                       jpegcomp.jpeg_markers |= V4L2_JPEG_MARKER_DQT;
> > -                             if (strstr(value, "dri"))
> > +                             if (std::strstr(value, "dri"))
> >                                       jpegcomp.jpeg_markers |= V4L2_JPEG_MARKER_DRI;
> >                               break;
> >                       case 18:
> > diff --git a/utils/v4l2-dbg/v4l2-dbg.cpp b/utils/v4l2-dbg/v4l2-dbg.cpp
> > index 86266376..06301ae0 100644
> > --- a/utils/v4l2-dbg/v4l2-dbg.cpp
> > +++ b/utils/v4l2-dbg/v4l2-dbg.cpp
> > @@ -784,14 +784,14 @@ list_done:
> >                               char *q;
> >
> >                               buf[len] = 0;
> > -                             while ((q = strstr(p, "START STATUS"))) {
> > +                             while ((q = std::strstr(p, "START STATUS"))) {
> >                                       found_status = true;
> >                                       p = q + 1;
> >                               }
> >                               if (found_status) {
> >                                       while (p > buf && *p != '<') p--;
> >                                       q = p;
> > -                                     while ((q = strstr(q, "<6>"))) {
> > +                                     while ((q = std::strstr(q, "<6>"))) {
> >                                               memcpy(q, "   ", 3);
> >                                       }
> >                                       printf("%s", p);
> >
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/3] utils: switch C to C++ headers
  2020-05-11  7:21   ` Hans Verkuil
@ 2020-05-12 20:51     ` Rosen Penev
  0 siblings, 0 replies; 7+ messages in thread
From: Rosen Penev @ 2020-05-12 20:51 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: Linux Media Mailing List

On Mon, May 11, 2020 at 12:21 AM Hans Verkuil <hverkuil@xs4all.nl> wrote:
>
> On 11/05/2020 03:25, Rosen Penev wrote:
> > Recently, I changed exit() to the std variant, which caused build
> > failures on older platforms. Switch all headers to the C++ variants
> > to avoid this.
> >
> > These C headers are deprecated by C++14.
>
> What build failure? Can you show what the error is? And which older
> platforms?
I actually cannot build this anymore. I'm getting some weird syscall errors:

../lib/libv4l2/../libv4lconvert/libv4lsyscall-priv.h:116:10: error:
‘SYS_mmap2’ undeclared (first use in this function)
  116 |  syscall(SYS_mmap2, (void *)(addr), (size_t)(len), \
      |          ^~~~~~~~~
../lib/libv4l2/libv4l2.c:112:44: note: in expansion of macro ‘SYS_MMAP’
  112 |  devices[index].convert_mmap_buf = (void *)SYS_MMAP(NULL,
      |                                            ^~~~~~~~
../lib/libv4l2/../libv4lconvert/libv4lsyscall-priv.h:116:10: note:
each undeclared identifier is reported only once for each function it
appears in
  116 |  syscall(SYS_mmap2, (void *)(addr), (size_t)(len), \
      |          ^~~~~~~~~
../lib/libv4l2/libv4l2.c:112:44: note: in expansion of macro ‘SYS_MMAP’
  112 |  devices[index].convert_mmap_buf = (void *)SYS_MMAP(NULL,
      |                                            ^~~~~~~~
../lib/libv4l2/../libv4lconvert/libv4lsyscall-priv.h:117:59: error:
‘MMAP2_PAGE_SHIFT’ undeclared (first use in this function); did you
mean ‘MAP_HUGE_SHIFT’?
  117 |    (int)(prot), (int)(flags), (int)(fd), (off_t)((off) >>
MMAP2_PAGE_SHIFT))
      |
^~~~~~~~~~~~~~~~
../lib/libv4l2/libv4l2.c:112:44: note: in expansion of macro ‘SYS_MMAP’
  112 |  devices[index].convert_mmap_buf = (void *)SYS_MMAP(NULL,
      |                                            ^~~~~~~~
../lib/libv4l2/libv4l2.c: In function ‘v4l2_map_buffers’:
../lib/libv4l2/../libv4lconvert/libv4lsyscall-priv.h:116:10: error:
‘SYS_mmap2’ undeclared (first use in this function)
  116 |  syscall(SYS_mmap2, (void *)(addr), (size_t)(len), \

Some other patch broke this I guess. This is on Fedora 32.
>
> I'd really like to know what the precise problem is that this patch
> fixes.
>
> I'll merge patches 1 and 2, but not this one. I need a better and more
> detailed commit log message.
>
> Regards,
>
>         Hans
>
>
> >
> > Signed-off-by: Rosen Penev <rosenp@gmail.com>
> > ---
> >  utils/cec-compliance/cec-compliance.cpp          | 10 +++++-----
> >  utils/cec-compliance/cec-test-adapter.cpp        | 10 +++++-----
> >  utils/cec-compliance/cec-test-audio.cpp          | 10 +++++-----
> >  utils/cec-compliance/cec-test-fuzzing.cpp        | 10 +++++-----
> >  utils/cec-compliance/cec-test-power.cpp          | 10 +++++-----
> >  utils/cec-compliance/cec-test.cpp                |  8 ++++----
> >  utils/cec-ctl/cec-ctl.cpp                        | 10 +++++-----
> >  utils/cec-ctl/cec-pin.cpp                        | 12 ++++++------
> >  utils/cec-follower/cec-follower.cpp              |  8 ++++----
> >  utils/cec-follower/cec-processing.cpp            | 10 +++++-----
> >  utils/cec-follower/cec-tuner.cpp                 |  2 +-
> >  utils/common/media-info.cpp                      | 10 +++++-----
> >  utils/common/v4l2-info.cpp                       | 10 +++++-----
> >  utils/libcecutil/cec-info.cpp                    |  2 +-
> >  utils/libcecutil/cec-log.cpp                     |  8 ++++----
> >  utils/libcecutil/cec-parse.cpp                   | 10 +++++-----
> >  utils/rds-ctl/rds-ctl.cpp                        | 14 +++++++-------
> >  utils/v4l2-compliance/v4l2-compliance.cpp        | 12 ++++++------
> >  utils/v4l2-compliance/v4l2-test-buffers.cpp      | 10 +++++-----
> >  utils/v4l2-compliance/v4l2-test-codecs.cpp       | 12 ++++++------
> >  utils/v4l2-compliance/v4l2-test-colors.cpp       | 12 ++++++------
> >  utils/v4l2-compliance/v4l2-test-controls.cpp     | 10 +++++-----
> >  utils/v4l2-compliance/v4l2-test-debug.cpp        | 12 ++++++------
> >  utils/v4l2-compliance/v4l2-test-formats.cpp      | 12 ++++++------
> >  utils/v4l2-compliance/v4l2-test-input-output.cpp | 10 +++++-----
> >  utils/v4l2-compliance/v4l2-test-io-config.cpp    | 10 +++++-----
> >  utils/v4l2-compliance/v4l2-test-media.cpp        | 12 ++++++------
> >  utils/v4l2-compliance/v4l2-test-subdevs.cpp      | 12 ++++++------
> >  utils/v4l2-ctl/v4l2-ctl-common.cpp               | 10 +++++-----
> >  utils/v4l2-ctl/v4l2-ctl-edid.cpp                 |  8 ++++----
> >  utils/v4l2-ctl/v4l2-ctl-io.cpp                   | 12 ++++++------
> >  utils/v4l2-ctl/v4l2-ctl-meta.cpp                 | 12 ++++++------
> >  utils/v4l2-ctl/v4l2-ctl-misc.cpp                 | 12 ++++++------
> >  utils/v4l2-ctl/v4l2-ctl-modes.cpp                |  4 ++--
> >  utils/v4l2-ctl/v4l2-ctl-overlay.cpp              | 12 ++++++------
> >  utils/v4l2-ctl/v4l2-ctl-sdr.cpp                  | 12 ++++++------
> >  utils/v4l2-ctl/v4l2-ctl-selection.cpp            | 12 ++++++------
> >  utils/v4l2-ctl/v4l2-ctl-stds.cpp                 | 12 ++++++------
> >  utils/v4l2-ctl/v4l2-ctl-streaming.cpp            | 10 +++++-----
> >  utils/v4l2-ctl/v4l2-ctl-subdev.cpp               | 12 ++++++------
> >  utils/v4l2-ctl/v4l2-ctl-tuner.cpp                | 10 +++++-----
> >  utils/v4l2-ctl/v4l2-ctl-vbi.cpp                  | 10 +++++-----
> >  utils/v4l2-ctl/v4l2-ctl-vidcap.cpp               | 12 ++++++------
> >  utils/v4l2-ctl/v4l2-ctl-vidout.cpp               | 12 ++++++------
> >  utils/v4l2-ctl/v4l2-ctl.cpp                      | 12 ++++++------
> >  utils/v4l2-dbg/v4l2-dbg.cpp                      | 10 +++++-----
> >  46 files changed, 236 insertions(+), 236 deletions(-)
> >
> > diff --git a/utils/cec-compliance/cec-compliance.cpp b/utils/cec-compliance/cec-compliance.cpp
> > index d0580579..60298846 100644
> > --- a/utils/cec-compliance/cec-compliance.cpp
> > +++ b/utils/cec-compliance/cec-compliance.cpp
> > @@ -4,17 +4,17 @@
> >   */
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <getopt.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <sys/time.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <sys/wait.h>
> >  #include <sstream>
> > diff --git a/utils/cec-compliance/cec-test-adapter.cpp b/utils/cec-compliance/cec-test-adapter.cpp
> > index df7374df..b7a8159d 100644
> > --- a/utils/cec-compliance/cec-test-adapter.cpp
> > +++ b/utils/cec-compliance/cec-test-adapter.cpp
> > @@ -4,16 +4,16 @@
> >   */
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <getopt.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <sys/wait.h>
> >  #include <sstream>
> > diff --git a/utils/cec-compliance/cec-test-audio.cpp b/utils/cec-compliance/cec-test-audio.cpp
> > index d422a7da..edf528c9 100644
> > --- a/utils/cec-compliance/cec-test-audio.cpp
> > +++ b/utils/cec-compliance/cec-test-audio.cpp
> > @@ -4,15 +4,15 @@
> >   */
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <config.h>
> >
> > diff --git a/utils/cec-compliance/cec-test-fuzzing.cpp b/utils/cec-compliance/cec-test-fuzzing.cpp
> > index ce0bf12d..708a8ec3 100644
> > --- a/utils/cec-compliance/cec-test-fuzzing.cpp
> > +++ b/utils/cec-compliance/cec-test-fuzzing.cpp
> > @@ -4,15 +4,15 @@
> >   */
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <config.h>
> >  #include <sstream>
> > diff --git a/utils/cec-compliance/cec-test-power.cpp b/utils/cec-compliance/cec-test-power.cpp
> > index 2758c36d..e35264aa 100644
> > --- a/utils/cec-compliance/cec-test-power.cpp
> > +++ b/utils/cec-compliance/cec-test-power.cpp
> > @@ -4,15 +4,15 @@
> >   */
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <config.h>
> >
> > diff --git a/utils/cec-compliance/cec-test.cpp b/utils/cec-compliance/cec-test.cpp
> > index a84f83d3..1a05c5ae 100644
> > --- a/utils/cec-compliance/cec-test.cpp
> > +++ b/utils/cec-compliance/cec-test.cpp
> > @@ -6,14 +6,14 @@
> >  #include <cstring>
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> >  #include <inttypes.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <config.h>
> >  #include <sstream>
> > diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp
> > index 899b83b1..3c6c6f98 100644
> > --- a/utils/cec-ctl/cec-ctl.cpp
> > +++ b/utils/cec-ctl/cec-ctl.cpp
> > @@ -6,8 +6,8 @@
> >  #include <cstring>
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> >  #include <inttypes.h>
> >  #include <getopt.h>
> >  #include <sys/types.h>
> > @@ -15,10 +15,10 @@
> >  #include <sys/time.h>
> >  #include <dirent.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> > -#include <stdarg.h>
> > +#include <cstdarg>
> >  #include <ctime>
> >  #include <cerrno>
> >  #include <string>
> > diff --git a/utils/cec-ctl/cec-pin.cpp b/utils/cec-ctl/cec-pin.cpp
> > index c09d6bbd..3ff4734f 100644
> > --- a/utils/cec-ctl/cec-pin.cpp
> > +++ b/utils/cec-ctl/cec-pin.cpp
> > @@ -4,19 +4,19 @@
> >   */
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <getopt.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <sys/time.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> > -#include <stdarg.h>
> > +#include <cstdarg>
> >  #include <cerrno>
> >  #include <string>
> >  #include <vector>
> > diff --git a/utils/cec-follower/cec-follower.cpp b/utils/cec-follower/cec-follower.cpp
> > index 589426ec..c6e0a1d1 100644
> > --- a/utils/cec-follower/cec-follower.cpp
> > +++ b/utils/cec-follower/cec-follower.cpp
> > @@ -6,15 +6,15 @@
> >  #include <cstring>
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> >  #include <inttypes.h>
> >  #include <getopt.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <sys/wait.h>
> >  #include <sstream>
> > diff --git a/utils/cec-follower/cec-processing.cpp b/utils/cec-follower/cec-processing.cpp
> > index bc8c9c09..e2c5c8e2 100644
> > --- a/utils/cec-follower/cec-processing.cpp
> > +++ b/utils/cec-follower/cec-processing.cpp
> > @@ -4,16 +4,16 @@
> >   */
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <sys/time.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <config.h>
> >
> > diff --git a/utils/cec-follower/cec-tuner.cpp b/utils/cec-follower/cec-tuner.cpp
> > index 4aecebce..7ac0decb 100644
> > --- a/utils/cec-follower/cec-tuner.cpp
> > +++ b/utils/cec-follower/cec-tuner.cpp
> > @@ -4,7 +4,7 @@
> >   */
> >
> >  #include <sys/ioctl.h>
> > -#include <stdlib.h>
> > +#include <cstdlib>
> >
> >  #include "cec-follower.h"
> >  #include "compiler.h"
> > diff --git a/utils/common/media-info.cpp b/utils/common/media-info.cpp
> > index 8aa12f34..d37c5acb 100644
> > --- a/utils/common/media-info.cpp
> > +++ b/utils/common/media-info.cpp
> > @@ -4,15 +4,15 @@
> >   */
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <sys/time.h>
> >  #include <sys/sysmacros.h>
> > diff --git a/utils/common/v4l2-info.cpp b/utils/common/v4l2-info.cpp
> > index 0aac8504..28116fd3 100644
> > --- a/utils/common/v4l2-info.cpp
> > +++ b/utils/common/v4l2-info.cpp
> > @@ -4,15 +4,15 @@
> >   */
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <sys/time.h>
> >  #include <sys/sysmacros.h>
> > diff --git a/utils/libcecutil/cec-info.cpp b/utils/libcecutil/cec-info.cpp
> > index f6e60918..ed244437 100644
> > --- a/utils/libcecutil/cec-info.cpp
> > +++ b/utils/libcecutil/cec-info.cpp
> > @@ -5,7 +5,7 @@
> >   * Copyright 2017 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
> >   */
> >
> > -#include <stdio.h>
> > +#include <cstdio>
> >  #include <string>
> >  #include <unistd.h>
> >  #include <fcntl.h>
> > diff --git a/utils/libcecutil/cec-log.cpp b/utils/libcecutil/cec-log.cpp
> > index 0dcb4675..40028630 100644
> > --- a/utils/libcecutil/cec-log.cpp
> > +++ b/utils/libcecutil/cec-log.cpp
> > @@ -4,11 +4,11 @@
> >   */
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> > -#include <stdarg.h>
> > +#include <cstdarg>
> >  #include <string>
> >  #include <linux/cec-funcs.h>
> >  #include "cec-htng-funcs.h"
> > diff --git a/utils/libcecutil/cec-parse.cpp b/utils/libcecutil/cec-parse.cpp
> > index 8c869fec..024b6285 100644
> > --- a/utils/libcecutil/cec-parse.cpp
> > +++ b/utils/libcecutil/cec-parse.cpp
> > @@ -4,8 +4,8 @@
> >   */
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> >  #include <inttypes.h>
> >  #include <getopt.h>
> >  #include <sys/types.h>
> > @@ -13,10 +13,10 @@
> >  #include <sys/time.h>
> >  #include <dirent.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> > -#include <stdarg.h>
> > +#include <cstdarg>
> >  #include <cstring>
> >  #include <ctime>
> >  #include <cerrno>
> > diff --git a/utils/rds-ctl/rds-ctl.cpp b/utils/rds-ctl/rds-ctl.cpp
> > index 73fc7e3c..fbc4d310 100644
> > --- a/utils/rds-ctl/rds-ctl.cpp
> > +++ b/utils/rds-ctl/rds-ctl.cpp
> > @@ -8,21 +8,21 @@
> >   */
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > -#include <wchar.h>
> > -#include <locale.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> > +#include <cwchar>
> > +#include <clocale>
> >  #include <inttypes.h>
> >  #include <getopt.h>
> >  #include <sys/types.h>
> >  #include <fcntl.h>
> > -#include <errno.h>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <sys/time.h>
> >  #include <dirent.h>
> >  #include <config.h>
> > -#include <signal.h>
> > +#include <csignal>
> >
> >  #include <linux/videodev2.h>
> >  #include <libv4l2rds.h>
> > diff --git a/utils/v4l2-compliance/v4l2-compliance.cpp b/utils/v4l2-compliance/v4l2-compliance.cpp
> > index 549e37f7..49606975 100644
> > --- a/utils/v4l2-compliance/v4l2-compliance.cpp
> > +++ b/utils/v4l2-compliance/v4l2-compliance.cpp
> > @@ -21,22 +21,22 @@
> >  #include <cstring>
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> >  #include <inttypes.h>
> >  #include <getopt.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <sys/time.h>
> >  #include <sys/sysmacros.h>
> >  #include <dirent.h>
> > -#include <math.h>
> > +#include <cmath>
> >  #include <sys/utsname.h>
> > -#include <signal.h>
> > +#include <csignal>
> >  #include <vector>
> >
> >  #include "v4l2-compliance.h"
> > diff --git a/utils/v4l2-compliance/v4l2-test-buffers.cpp b/utils/v4l2-compliance/v4l2-test-buffers.cpp
> > index fc49fff6..e2df126d 100644
> > --- a/utils/v4l2-compliance/v4l2-test-buffers.cpp
> > +++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp
> > @@ -19,9 +19,9 @@
> >   */
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> > @@ -29,8 +29,8 @@
> >  #include <sys/wait.h>
> >  #include <sys/epoll.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <poll.h>
> >  #include <sys/ioctl.h>
> >  #include <netinet/in.h>
> > diff --git a/utils/v4l2-compliance/v4l2-test-codecs.cpp b/utils/v4l2-compliance/v4l2-test-codecs.cpp
> > index 3fd44c8b..377574ec 100644
> > --- a/utils/v4l2-compliance/v4l2-test-codecs.cpp
> > +++ b/utils/v4l2-compliance/v4l2-test-codecs.cpp
> > @@ -19,17 +19,17 @@
> >   */
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> > -#include <assert.h>
> > +#include <cassert>
> >  #include "v4l2-compliance.h"
> >
> >  int testEncoder(struct node *node)
> > diff --git a/utils/v4l2-compliance/v4l2-test-colors.cpp b/utils/v4l2-compliance/v4l2-test-colors.cpp
> > index 09d29a3e..6996877d 100644
> > --- a/utils/v4l2-compliance/v4l2-test-colors.cpp
> > +++ b/utils/v4l2-compliance/v4l2-test-colors.cpp
> > @@ -15,19 +15,19 @@
> >   */
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <getopt.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <sys/time.h>
> > -#include <math.h>
> > +#include <cmath>
> >
> >  #include "compiler.h"
> >  #include "v4l2-compliance.h"
> > diff --git a/utils/v4l2-compliance/v4l2-test-controls.cpp b/utils/v4l2-compliance/v4l2-test-controls.cpp
> > index d81dddb2..c3c27119 100644
> > --- a/utils/v4l2-compliance/v4l2-test-controls.cpp
> > +++ b/utils/v4l2-compliance/v4l2-test-controls.cpp
> > @@ -19,15 +19,15 @@
> >   */
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <vector>
> >
> > diff --git a/utils/v4l2-compliance/v4l2-test-debug.cpp b/utils/v4l2-compliance/v4l2-test-debug.cpp
> > index 3f43e661..206b4b82 100644
> > --- a/utils/v4l2-compliance/v4l2-test-debug.cpp
> > +++ b/utils/v4l2-compliance/v4l2-test-debug.cpp
> > @@ -19,19 +19,19 @@
> >   */
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <getopt.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <sys/time.h>
> > -#include <math.h>
> > +#include <cmath>
> >  #include "v4l2-compliance.h"
> >
> >  int testRegister(struct node *node)
> > diff --git a/utils/v4l2-compliance/v4l2-test-formats.cpp b/utils/v4l2-compliance/v4l2-test-formats.cpp
> > index e1b00f3c..7780442e 100644
> > --- a/utils/v4l2-compliance/v4l2-test-formats.cpp
> > +++ b/utils/v4l2-compliance/v4l2-test-formats.cpp
> > @@ -19,17 +19,17 @@
> >   */
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> > -#include <assert.h>
> > +#include <cassert>
> >
> >  #include "compiler.h"
> >  #include "v4l2-compliance.h"
> > diff --git a/utils/v4l2-compliance/v4l2-test-input-output.cpp b/utils/v4l2-compliance/v4l2-test-input-output.cpp
> > index 80ecf75d..a7fe81d8 100644
> > --- a/utils/v4l2-compliance/v4l2-test-input-output.cpp
> > +++ b/utils/v4l2-compliance/v4l2-test-input-output.cpp
> > @@ -19,15 +19,15 @@
> >   */
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include "v4l2-compliance.h"
> >
> > diff --git a/utils/v4l2-compliance/v4l2-test-io-config.cpp b/utils/v4l2-compliance/v4l2-test-io-config.cpp
> > index 9ade11e8..be885cb3 100644
> > --- a/utils/v4l2-compliance/v4l2-test-io-config.cpp
> > +++ b/utils/v4l2-compliance/v4l2-test-io-config.cpp
> > @@ -19,15 +19,15 @@
> >   */
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include "v4l2-compliance.h"
> >
> > diff --git a/utils/v4l2-compliance/v4l2-test-media.cpp b/utils/v4l2-compliance/v4l2-test-media.cpp
> > index bcd8a725..94c25932 100644
> > --- a/utils/v4l2-compliance/v4l2-test-media.cpp
> > +++ b/utils/v4l2-compliance/v4l2-test-media.cpp
> > @@ -19,19 +19,19 @@
> >   */
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <sys/sysmacros.h>
> >  #include <fcntl.h>
> >  #include <dirent.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> > -#include <assert.h>
> > +#include <cassert>
> >  #include <set>
> >  #include <fstream>
> >
> > diff --git a/utils/v4l2-compliance/v4l2-test-subdevs.cpp b/utils/v4l2-compliance/v4l2-test-subdevs.cpp
> > index 489639fb..54d3c430 100644
> > --- a/utils/v4l2-compliance/v4l2-test-subdevs.cpp
> > +++ b/utils/v4l2-compliance/v4l2-test-subdevs.cpp
> > @@ -19,17 +19,17 @@
> >   */
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> > -#include <assert.h>
> > +#include <cassert>
> >
> >  #include "v4l2-compliance.h"
> >
> > diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp
> > index 0640a521..bf267432 100644
> > --- a/utils/v4l2-ctl/v4l2-ctl-common.cpp
> > +++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp
> > @@ -1,18 +1,18 @@
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> >  #include <inttypes.h>
> >  #include <getopt.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <sys/sysmacros.h>
> >  #include <sys/time.h>
> >  #include <dirent.h>
> > -#include <math.h>
> > +#include <cmath>
> >  #include <linux/media.h>
> >
> >  #include "v4l2-ctl.h"
> > diff --git a/utils/v4l2-ctl/v4l2-ctl-edid.cpp b/utils/v4l2-ctl/v4l2-ctl-edid.cpp
> > index b13d8209..d028d248 100644
> > --- a/utils/v4l2-ctl/v4l2-ctl-edid.cpp
> > +++ b/utils/v4l2-ctl/v4l2-ctl-edid.cpp
> > @@ -1,12 +1,12 @@
> >  #include <cstring>
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> >  #include <inttypes.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >
> >  #include "v4l2-ctl.h"
> > diff --git a/utils/v4l2-ctl/v4l2-ctl-io.cpp b/utils/v4l2-ctl/v4l2-ctl-io.cpp
> > index 9e83c03a..379198b5 100644
> > --- a/utils/v4l2-ctl/v4l2-ctl-io.cpp
> > +++ b/utils/v4l2-ctl/v4l2-ctl-io.cpp
> > @@ -1,18 +1,18 @@
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <getopt.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <sys/time.h>
> >  #include <dirent.h>
> > -#include <math.h>
> > +#include <cmath>
> >
> >  #include "v4l2-ctl.h"
> >
> > diff --git a/utils/v4l2-ctl/v4l2-ctl-meta.cpp b/utils/v4l2-ctl/v4l2-ctl-meta.cpp
> > index 3e71a6eb..718be765 100644
> > --- a/utils/v4l2-ctl/v4l2-ctl-meta.cpp
> > +++ b/utils/v4l2-ctl/v4l2-ctl-meta.cpp
> > @@ -1,18 +1,18 @@
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <getopt.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <sys/time.h>
> >  #include <dirent.h>
> > -#include <math.h>
> > +#include <cmath>
> >
> >  #include "v4l2-ctl.h"
> >
> > diff --git a/utils/v4l2-ctl/v4l2-ctl-misc.cpp b/utils/v4l2-ctl/v4l2-ctl-misc.cpp
> > index deb481b4..5a89aa7e 100644
> > --- a/utils/v4l2-ctl/v4l2-ctl-misc.cpp
> > +++ b/utils/v4l2-ctl/v4l2-ctl-misc.cpp
> > @@ -1,18 +1,18 @@
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <getopt.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <sys/time.h>
> >  #include <dirent.h>
> > -#include <math.h>
> > +#include <cmath>
> >
> >  #include "v4l2-ctl.h"
> >
> > diff --git a/utils/v4l2-ctl/v4l2-ctl-modes.cpp b/utils/v4l2-ctl/v4l2-ctl-modes.cpp
> > index b311ce5d..e076be6e 100644
> > --- a/utils/v4l2-ctl/v4l2-ctl-modes.cpp
> > +++ b/utils/v4l2-ctl/v4l2-ctl-modes.cpp
> > @@ -6,8 +6,8 @@
> >   * reserved.
> >   */
> >
> > -#include <stdio.h>
> > -#include <stdbool.h>
> > +#include <cstdio>
> > +
> >  #include "v4l2-ctl.h"
> >
> >  static bool valid_params(int width, int height, int refresh_rate)
> > diff --git a/utils/v4l2-ctl/v4l2-ctl-overlay.cpp b/utils/v4l2-ctl/v4l2-ctl-overlay.cpp
> > index 16344a15..a16e10db 100644
> > --- a/utils/v4l2-ctl/v4l2-ctl-overlay.cpp
> > +++ b/utils/v4l2-ctl/v4l2-ctl-overlay.cpp
> > @@ -1,18 +1,18 @@
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <getopt.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <sys/time.h>
> >  #include <dirent.h>
> > -#include <math.h>
> > +#include <cmath>
> >
> >  #include <linux/fb.h>
> >  #include <vector>
> > diff --git a/utils/v4l2-ctl/v4l2-ctl-sdr.cpp b/utils/v4l2-ctl/v4l2-ctl-sdr.cpp
> > index 71a65913..67603285 100644
> > --- a/utils/v4l2-ctl/v4l2-ctl-sdr.cpp
> > +++ b/utils/v4l2-ctl/v4l2-ctl-sdr.cpp
> > @@ -1,18 +1,18 @@
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <getopt.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <sys/time.h>
> >  #include <dirent.h>
> > -#include <math.h>
> > +#include <cmath>
> >
> >  #include "v4l2-ctl.h"
> >
> > diff --git a/utils/v4l2-ctl/v4l2-ctl-selection.cpp b/utils/v4l2-ctl/v4l2-ctl-selection.cpp
> > index be62eb03..9f3e0397 100644
> > --- a/utils/v4l2-ctl/v4l2-ctl-selection.cpp
> > +++ b/utils/v4l2-ctl/v4l2-ctl-selection.cpp
> > @@ -1,18 +1,18 @@
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <getopt.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <sys/time.h>
> >  #include <dirent.h>
> > -#include <math.h>
> > +#include <cmath>
> >
> >  #include "v4l2-ctl.h"
> >
> > diff --git a/utils/v4l2-ctl/v4l2-ctl-stds.cpp b/utils/v4l2-ctl/v4l2-ctl-stds.cpp
> > index 8dd06c43..3eb67316 100644
> > --- a/utils/v4l2-ctl/v4l2-ctl-stds.cpp
> > +++ b/utils/v4l2-ctl/v4l2-ctl-stds.cpp
> > @@ -1,18 +1,18 @@
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <getopt.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <sys/time.h>
> >  #include <dirent.h>
> > -#include <math.h>
> > +#include <cmath>
> >
> >  #include "v4l2-ctl.h"
> >
> > diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
> > index 8578610d..fab8f36b 100644
> > --- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
> > +++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
> > @@ -1,8 +1,8 @@
> >  #include <cstring>
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> >  #include <inttypes.h>
> >  #include <getopt.h>
> >  #include <sys/types.h>
> > @@ -11,13 +11,13 @@
> >  #include <netinet/in.h>
> >  #include <netdb.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <sys/time.h>
> >  #include <sys/mman.h>
> >  #include <dirent.h>
> > -#include <math.h>
> > +#include <cmath>
> >  #include <linux/media.h>
> >
> >  #include "compiler.h"
> > diff --git a/utils/v4l2-ctl/v4l2-ctl-subdev.cpp b/utils/v4l2-ctl/v4l2-ctl-subdev.cpp
> > index 9e17a58d..1bf35b1d 100644
> > --- a/utils/v4l2-ctl/v4l2-ctl-subdev.cpp
> > +++ b/utils/v4l2-ctl/v4l2-ctl-subdev.cpp
> > @@ -1,18 +1,18 @@
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <getopt.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <sys/time.h>
> >  #include <dirent.h>
> > -#include <math.h>
> > +#include <cmath>
> >
> >  #include "v4l2-ctl.h"
> >
> > diff --git a/utils/v4l2-ctl/v4l2-ctl-tuner.cpp b/utils/v4l2-ctl/v4l2-ctl-tuner.cpp
> > index 981b8765..54635998 100644
> > --- a/utils/v4l2-ctl/v4l2-ctl-tuner.cpp
> > +++ b/utils/v4l2-ctl/v4l2-ctl-tuner.cpp
> > @@ -1,14 +1,14 @@
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <getopt.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <sys/time.h>
> >  #include <dirent.h>
> > diff --git a/utils/v4l2-ctl/v4l2-ctl-vbi.cpp b/utils/v4l2-ctl/v4l2-ctl-vbi.cpp
> > index ee55012f..c09bc3e2 100644
> > --- a/utils/v4l2-ctl/v4l2-ctl-vbi.cpp
> > +++ b/utils/v4l2-ctl/v4l2-ctl-vbi.cpp
> > @@ -1,19 +1,19 @@
> >  #include <cstring>
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> >  #include <inttypes.h>
> >  #include <getopt.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <sys/time.h>
> >  #include <dirent.h>
> > -#include <math.h>
> > +#include <cmath>
> >
> >  #include "compiler.h"
> >  #include "v4l2-ctl.h"
> > diff --git a/utils/v4l2-ctl/v4l2-ctl-vidcap.cpp b/utils/v4l2-ctl/v4l2-ctl-vidcap.cpp
> > index 6e920c1d..68896248 100644
> > --- a/utils/v4l2-ctl/v4l2-ctl-vidcap.cpp
> > +++ b/utils/v4l2-ctl/v4l2-ctl-vidcap.cpp
> > @@ -1,18 +1,18 @@
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <getopt.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <sys/time.h>
> >  #include <dirent.h>
> > -#include <math.h>
> > +#include <cmath>
> >
> >  #include "v4l2-ctl.h"
> >
> > diff --git a/utils/v4l2-ctl/v4l2-ctl-vidout.cpp b/utils/v4l2-ctl/v4l2-ctl-vidout.cpp
> > index e3cb4bcb..39952eef 100644
> > --- a/utils/v4l2-ctl/v4l2-ctl-vidout.cpp
> > +++ b/utils/v4l2-ctl/v4l2-ctl-vidout.cpp
> > @@ -1,18 +1,18 @@
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <getopt.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <sys/time.h>
> >  #include <dirent.h>
> > -#include <math.h>
> > +#include <cmath>
> >
> >  #include "v4l2-ctl.h"
> >
> > diff --git a/utils/v4l2-ctl/v4l2-ctl.cpp b/utils/v4l2-ctl/v4l2-ctl.cpp
> > index e7b270cd..3d784bc2 100644
> > --- a/utils/v4l2-ctl/v4l2-ctl.cpp
> > +++ b/utils/v4l2-ctl/v4l2-ctl.cpp
> > @@ -21,22 +21,22 @@
> >   */
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> > +#include <cstring>
> >  #include <inttypes.h>
> >  #include <getopt.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <sys/epoll.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <sys/time.h>
> >  #include <sys/sysmacros.h>
> >  #include <dirent.h>
> > -#include <math.h>
> > +#include <cmath>
> >
> >  #include <linux/media.h>
> >
> > diff --git a/utils/v4l2-dbg/v4l2-dbg.cpp b/utils/v4l2-dbg/v4l2-dbg.cpp
> > index 06301ae0..765362f6 100644
> > --- a/utils/v4l2-dbg/v4l2-dbg.cpp
> > +++ b/utils/v4l2-dbg/v4l2-dbg.cpp
> > @@ -17,18 +17,18 @@
> >   */
> >
> >  #include <unistd.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > +#include <cstdlib>
> > +#include <cstdio>
> >  #include <inttypes.h>
> >  #include <getopt.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> > -#include <ctype.h>
> > -#include <errno.h>
> > +#include <cctype>
> > +#include <cerrno>
> >  #include <sys/ioctl.h>
> >  #include <sys/time.h>
> > -#include <math.h>
> > +#include <cmath>
> >
> >  #ifdef ANDROID
> >  #include <android-config.h>
> >
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-05-12 20:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-11  1:25 [PATCH 1/3] utils: replace chr functions with std variants Rosen Penev
2020-05-11  1:25 ` [PATCH 2/3] utils: switch strstr to std variant Rosen Penev
2020-05-11  7:23   ` Hans Verkuil
2020-05-12  6:00     ` Rosen Penev
2020-05-11  1:25 ` [PATCH 3/3] utils: switch C to C++ headers Rosen Penev
2020-05-11  7:21   ` Hans Verkuil
2020-05-12 20:51     ` Rosen Penev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.