summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-12-12 01:21:01 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-12-14 15:35:24 +0200
commit5cfbbcd20731a2160206cc1d935eac2c770376ae (patch)
tree817f2ef9c3ce6aa7fb2ace65466498c8f880c60b /test
parentbd4894d2596168b3435fb93b9e53dad84b2dcc7e (diff)
libcamera: Replace ARRAY_SIZE() with std::size()
C++17 has a std::size() function that returns the size of a C-style array. Use it instead of the custom ARRAY_SIZE macro. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Umang Jain <email@uajain.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'test')
-rw-r--r--test/ipc/unixsocket.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/ipc/unixsocket.cpp b/test/ipc/unixsocket.cpp
index 19a1d7dd..80157b34 100644
--- a/test/ipc/unixsocket.cpp
+++ b/test/ipc/unixsocket.cpp
@@ -6,6 +6,7 @@
*/
#include <algorithm>
+#include <array>
#include <fcntl.h>
#include <iostream>
#include <stdlib.h>
@@ -19,7 +20,6 @@
#include "libcamera/internal/ipc_unixsocket.h"
#include "libcamera/internal/thread.h"
#include "libcamera/internal/timer.h"
-#include "libcamera/internal/utils.h"
#include "test.h"
@@ -311,7 +311,7 @@ protected:
};
int fds[2];
- for (unsigned int i = 0; i < ARRAY_SIZE(strings); i++) {
+ for (unsigned int i = 0; i < std::size(strings); i++) {
unsigned int len = strlen(strings[i]);
fds[i] = open("/tmp", O_TMPFILE | O_RDWR,
@@ -333,7 +333,7 @@ protected:
if (ret)
return ret;
- for (unsigned int i = 0; i < ARRAY_SIZE(strings); i++) {
+ for (unsigned int i = 0; i < std::size(strings); i++) {
unsigned int len = strlen(strings[i]);
char buf[len];