summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-10-23 14:31:13 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-10-23 17:39:39 +0300
commitca260d2f5337536e30d1b2501434bd2a93a3e72e (patch)
tree7a8af9ad83101ceaae165614c6ae525f4499086f
parentbb5f8cf4951fc5813d60ab806c57c5b5d713f38c (diff)
libcamera: Standardise on C compatibility headers
Now that our usage of C compatibility header is documented, use them consistently through the source code. While at it, group the C and C++ include statements as defined in the coding style, and fix a handful of #include ordering issues. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
-rw-r--r--include/libcamera/timer.h2
-rw-r--r--src/cam/capture.cpp2
-rw-r--r--src/cam/options.cpp2
-rw-r--r--src/ipa/rkisp1/rkisp1.cpp2
-rw-r--r--src/libcamera/device_enumerator_udev.cpp5
-rw-r--r--src/libcamera/include/event_dispatcher_poll.h4
-rw-r--r--src/libcamera/include/ipc_unixsocket.h2
-rw-r--r--src/libcamera/log.cpp6
-rw-r--r--src/libcamera/media_device.cpp3
-rw-r--r--src/libcamera/media_object.cpp3
-rw-r--r--src/libcamera/stream.cpp2
-rw-r--r--test/ipa/ipa_interface_test.cpp3
-rw-r--r--test/media_device/media_device_print_test.cpp2
-rw-r--r--test/pipeline/ipu3/ipu3_pipeline_test.cpp1
-rw-r--r--test/v4l2_subdevice/test_formats.cpp2
-rw-r--r--test/v4l2_videodevice/capture_async.cpp4
-rw-r--r--test/v4l2_videodevice/controls.cpp2
-rw-r--r--test/v4l2_videodevice/formats.cpp2
18 files changed, 22 insertions, 27 deletions
diff --git a/include/libcamera/timer.h b/include/libcamera/timer.h
index 34e7b8ac..f55fe3c0 100644
--- a/include/libcamera/timer.h
+++ b/include/libcamera/timer.h
@@ -8,7 +8,7 @@
#define __LIBCAMERA_TIMER_H__
#include <chrono>
-#include <cstdint>
+#include <stdint.h>
#include <libcamera/object.h>
#include <libcamera/signal.h>
diff --git a/src/cam/capture.cpp b/src/cam/capture.cpp
index 8a939c62..d05c01f1 100644
--- a/src/cam/capture.cpp
+++ b/src/cam/capture.cpp
@@ -6,9 +6,9 @@
*/
#include <chrono>
-#include <climits>
#include <iomanip>
#include <iostream>
+#include <limits.h>
#include <sstream>
#include "capture.h"
diff --git a/src/cam/options.cpp b/src/cam/options.cpp
index 7c3948df..1f0631ec 100644
--- a/src/cam/options.cpp
+++ b/src/cam/options.cpp
@@ -5,7 +5,7 @@
* options.cpp - cam - Options parsing
*/
-#include <cassert>
+#include <assert.h>
#include <getopt.h>
#include <iomanip>
#include <iostream>
diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp
index 570145ce..9a13f5c7 100644
--- a/src/ipa/rkisp1/rkisp1.cpp
+++ b/src/ipa/rkisp1/rkisp1.cpp
@@ -6,9 +6,9 @@
*/
#include <algorithm>
-#include <cstdint>
#include <math.h>
#include <queue>
+#include <stdint.h>
#include <string.h>
#include <linux/rkisp1-config.h>
diff --git a/src/libcamera/device_enumerator_udev.cpp b/src/libcamera/device_enumerator_udev.cpp
index ddcd59ea..b2c5fd22 100644
--- a/src/libcamera/device_enumerator_udev.cpp
+++ b/src/libcamera/device_enumerator_udev.cpp
@@ -8,11 +8,10 @@
#include "device_enumerator_udev.h"
#include <algorithm>
-#include <list>
-#include <map>
-
#include <fcntl.h>
#include <libudev.h>
+#include <list>
+#include <map>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/sysmacros.h>
diff --git a/src/libcamera/include/event_dispatcher_poll.h b/src/libcamera/include/event_dispatcher_poll.h
index d82b302c..1f073861 100644
--- a/src/libcamera/include/event_dispatcher_poll.h
+++ b/src/libcamera/include/event_dispatcher_poll.h
@@ -7,12 +7,12 @@
#ifndef __LIBCAMERA_EVENT_DISPATCHER_POLL_H__
#define __LIBCAMERA_EVENT_DISPATCHER_POLL_H__
-#include <libcamera/event_dispatcher.h>
-
#include <list>
#include <map>
#include <vector>
+#include <libcamera/event_dispatcher.h>
+
struct pollfd;
namespace libcamera {
diff --git a/src/libcamera/include/ipc_unixsocket.h b/src/libcamera/include/ipc_unixsocket.h
index 03e9fe49..820d0561 100644
--- a/src/libcamera/include/ipc_unixsocket.h
+++ b/src/libcamera/include/ipc_unixsocket.h
@@ -8,7 +8,7 @@
#ifndef __LIBCAMERA_IPC_UNIXSOCKET_H__
#define __LIBCAMERA_IPC_UNIXSOCKET_H__
-#include <cstdint>
+#include <stdint.h>
#include <sys/types.h>
#include <vector>
diff --git a/src/libcamera/log.cpp b/src/libcamera/log.cpp
index 51f9f86b..50f345b9 100644
--- a/src/libcamera/log.cpp
+++ b/src/libcamera/log.cpp
@@ -7,14 +7,14 @@
#include "log.h"
-#include <cstdio>
-#include <cstdlib>
-#include <ctime>
#include <fstream>
#include <iostream>
#include <list>
+#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <syslog.h>
+#include <time.h>
#include <unordered_set>
#include <libcamera/logging.h>
diff --git a/src/libcamera/media_device.cpp b/src/libcamera/media_device.cpp
index bd99deba..0d6630fb 100644
--- a/src/libcamera/media_device.cpp
+++ b/src/libcamera/media_device.cpp
@@ -9,11 +9,10 @@
#include <errno.h>
#include <fcntl.h>
+#include <string>
#include <string.h>
#include <sys/ioctl.h>
#include <unistd.h>
-
-#include <string>
#include <vector>
#include <linux/media.h>
diff --git a/src/libcamera/media_object.cpp b/src/libcamera/media_object.cpp
index 8794ff45..ef32065c 100644
--- a/src/libcamera/media_object.cpp
+++ b/src/libcamera/media_object.cpp
@@ -8,10 +8,9 @@
#include "media_object.h"
#include <errno.h>
+#include <string>
#include <string.h>
#include <unistd.h>
-
-#include <string>
#include <vector>
#include <linux/media.h>
diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp
index 610920d1..b8e7209c 100644
--- a/src/libcamera/stream.cpp
+++ b/src/libcamera/stream.cpp
@@ -9,8 +9,8 @@
#include <algorithm>
#include <array>
-#include <climits>
#include <iomanip>
+#include <limits.h>
#include <sstream>
#include <libcamera/request.h>
diff --git a/test/ipa/ipa_interface_test.cpp b/test/ipa/ipa_interface_test.cpp
index 0bdeb167..cafc249b 100644
--- a/test/ipa/ipa_interface_test.cpp
+++ b/test/ipa/ipa_interface_test.cpp
@@ -6,13 +6,12 @@
*/
#include <fcntl.h>
+#include <iostream>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
-#include <iostream>
-
#include <libcamera/event_dispatcher.h>
#include <libcamera/event_notifier.h>
#include <libcamera/timer.h>
diff --git a/test/media_device/media_device_print_test.cpp b/test/media_device/media_device_print_test.cpp
index 30d929b8..8dd8a151 100644
--- a/test/media_device/media_device_print_test.cpp
+++ b/test/media_device/media_device_print_test.cpp
@@ -4,8 +4,8 @@
*
* media_device_print_test.cpp - Print out media devices
*/
-#include <iostream>
+#include <iostream>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
diff --git a/test/pipeline/ipu3/ipu3_pipeline_test.cpp b/test/pipeline/ipu3/ipu3_pipeline_test.cpp
index 8bfcd609..a5c6be09 100644
--- a/test/pipeline/ipu3/ipu3_pipeline_test.cpp
+++ b/test/pipeline/ipu3/ipu3_pipeline_test.cpp
@@ -6,7 +6,6 @@
*/
#include <iostream>
-
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
diff --git a/test/v4l2_subdevice/test_formats.cpp b/test/v4l2_subdevice/test_formats.cpp
index e90c2c24..5cf5d566 100644
--- a/test/v4l2_subdevice/test_formats.cpp
+++ b/test/v4l2_subdevice/test_formats.cpp
@@ -5,8 +5,8 @@
* libcamera V4L2 Subdevice format handling test
*/
-#include <climits>
#include <iostream>
+#include <limits.h>
#include "v4l2_subdevice.h"
#include "v4l2_subdevice_test.h"
diff --git a/test/v4l2_videodevice/capture_async.cpp b/test/v4l2_videodevice/capture_async.cpp
index 17eb528b..442a4fe5 100644
--- a/test/v4l2_videodevice/capture_async.cpp
+++ b/test/v4l2_videodevice/capture_async.cpp
@@ -5,12 +5,12 @@
* libcamera V4L2 API tests
*/
+#include <iostream>
+
#include <libcamera/buffer.h>
#include <libcamera/event_dispatcher.h>
#include <libcamera/timer.h>
-#include <iostream>
-
#include "thread.h"
#include "v4l2_videodevice_test.h"
diff --git a/test/v4l2_videodevice/controls.cpp b/test/v4l2_videodevice/controls.cpp
index 975c852b..42c653d4 100644
--- a/test/v4l2_videodevice/controls.cpp
+++ b/test/v4l2_videodevice/controls.cpp
@@ -5,8 +5,8 @@
* controls.cpp - V4L2 device controls handling test
*/
-#include <climits>
#include <iostream>
+#include <limits.h>
#include "v4l2_videodevice.h"
diff --git a/test/v4l2_videodevice/formats.cpp b/test/v4l2_videodevice/formats.cpp
index ee7d357d..d504d178 100644
--- a/test/v4l2_videodevice/formats.cpp
+++ b/test/v4l2_videodevice/formats.cpp
@@ -5,8 +5,8 @@
* libcamera V4L2 device format handling test
*/
-#include <climits>
#include <iostream>
+#include <limits.h>
#include "v4l2_videodevice.h"