summaryrefslogtreecommitdiff
path: root/src
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 /src
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>
Diffstat (limited to 'src')
-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
10 files changed, 14 insertions, 17 deletions
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>