aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2021-04-20 14:10:58 -0700
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2021-04-21 08:38:52 +0200
commit1d808f1cdd9719ecea219e113096a8d9b87c0d14 (patch)
tree859e556c3ea18d94e19af1940116efd7d10dfc7b
parentbafe32e7386be8ec108d55fc663c6bdcb4eec28a (diff)
clang-tidy: use using instead of typedef
Found with modernize-use-using Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/cec-ctl/cec-ctl.cpp2
-rw-r--r--utils/common/media-info.cpp4
-rw-r--r--utils/common/v4l2-info.cpp4
-rw-r--r--utils/qv4l2/qv4l2.h8
-rw-r--r--utils/rds-ctl/rds-ctl.cpp2
-rw-r--r--utils/v4l2-compliance/v4l2-compliance.h8
-rw-r--r--utils/v4l2-compliance/v4l2-test-buffers.cpp2
-rw-r--r--utils/v4l2-compliance/v4l2-test-media.cpp2
-rw-r--r--utils/v4l2-ctl/v4l2-ctl-common.cpp2
-rw-r--r--utils/v4l2-ctl/v4l2-ctl.h4
10 files changed, 19 insertions, 19 deletions
diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp
index 98c06ecf..107dcfab 100644
--- a/utils/cec-ctl/cec-ctl.cpp
+++ b/utils/cec-ctl/cec-ctl.cpp
@@ -148,7 +148,7 @@ struct node {
bool verbose;
-typedef std::vector<cec_msg> msg_vec;
+using msg_vec = std::vector<cec_msg>;
static struct option long_options[] = {
{ "device", required_argument, nullptr, OptSetDevice },
diff --git a/utils/common/media-info.cpp b/utils/common/media-info.cpp
index 6138eda4..3a5477e8 100644
--- a/utils/common/media-info.cpp
+++ b/utils/common/media-info.cpp
@@ -139,10 +139,10 @@ std::string mi_media_get_device(__u32 major, __u32 minor)
return "";
}
-typedef struct {
+struct flag_def {
unsigned flag;
const char *str;
-} flag_def;
+};
static std::string flags2s(unsigned val, const flag_def *def)
{
diff --git a/utils/common/v4l2-info.cpp b/utils/common/v4l2-info.cpp
index fe4defd9..cb3cb91f 100644
--- a/utils/common/v4l2-info.cpp
+++ b/utils/common/v4l2-info.cpp
@@ -16,10 +16,10 @@ static std::string num2s(unsigned num, bool is_hex = true)
return buf;
}
-typedef struct {
+struct flag_def {
unsigned flag;
const char *str;
-} flag_def;
+};
static std::string flags2s(unsigned val, const flag_def *def)
{
diff --git a/utils/qv4l2/qv4l2.h b/utils/qv4l2/qv4l2.h
index a585ac35..aaba74d0 100644
--- a/utils/qv4l2/qv4l2.h
+++ b/utils/qv4l2/qv4l2.h
@@ -51,10 +51,10 @@ class VbiTab;
class QCloseEvent;
class CaptureWin;
-typedef std::vector<unsigned> ClassIDVec;
-typedef std::map<unsigned, ClassIDVec> ClassMap;
-typedef std::map<unsigned, struct v4l2_query_ext_ctrl> CtrlMap;
-typedef std::map<unsigned, QWidget *> WidgetMap;
+using ClassIDVec = std::vector<unsigned>;
+using ClassMap = std::map<unsigned, ClassIDVec>;
+using CtrlMap = std::map<unsigned, v4l2_query_ext_ctrl>;
+using WidgetMap = std::map<unsigned, QWidget *>;
enum {
CTRL_UPDATE_ON_CHANGE = 0x10,
diff --git a/utils/rds-ctl/rds-ctl.cpp b/utils/rds-ctl/rds-ctl.cpp
index 994fc9c4..e2718282 100644
--- a/utils/rds-ctl/rds-ctl.cpp
+++ b/utils/rds-ctl/rds-ctl.cpp
@@ -29,7 +29,7 @@
#define ARRAY_SIZE(arr) ((int)(sizeof(arr) / sizeof((arr)[0])))
-typedef std::vector<std::string> dev_vec;
+using dev_vec = std::vector<std::string>;
using dev_map = std::map<std::string, std::string>;
/* Short option list
diff --git a/utils/v4l2-compliance/v4l2-compliance.h b/utils/v4l2-compliance/v4l2-compliance.h
index 4d5c3a5c..d13dd2e2 100644
--- a/utils/v4l2-compliance/v4l2-compliance.h
+++ b/utils/v4l2-compliance/v4l2-compliance.h
@@ -78,10 +78,10 @@ struct test_query_ext_ctrl: v4l2_query_ext_ctrl {
__u64 menu_mask;
};
-typedef std::map<__u32, struct test_query_ext_ctrl> qctrl_map;
-typedef std::map<__u32, __u32> pixfmt_map;
-typedef std::set<__u64> frmsizes_set;
-typedef std::map<__u32, unsigned> frmsizes_count_map;
+using qctrl_map = std::map<__u32, test_query_ext_ctrl>;
+using pixfmt_map = std::map<__u32, __u32>;
+using frmsizes_set = std::set<__u64>;
+using frmsizes_count_map = std::map<__u32, unsigned>;
struct base_node;
diff --git a/utils/v4l2-compliance/v4l2-test-buffers.cpp b/utils/v4l2-compliance/v4l2-test-buffers.cpp
index 131fedc6..bc5958c2 100644
--- a/utils/v4l2-compliance/v4l2-test-buffers.cpp
+++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp
@@ -93,7 +93,7 @@ enum QueryBufMode {
Dequeued
};
-typedef std::map<struct timeval, struct v4l2_buffer> buf_info_map;
+using buf_info_map = std::map<struct timeval, struct v4l2_buffer>;
static buf_info_map buffer_info;
#define FILE_HDR_ID v4l2_fourcc('V', 'h', 'd', 'r')
diff --git a/utils/v4l2-compliance/v4l2-test-media.cpp b/utils/v4l2-compliance/v4l2-test-media.cpp
index d7a83b0c..ef2982c0 100644
--- a/utils/v4l2-compliance/v4l2-test-media.cpp
+++ b/utils/v4l2-compliance/v4l2-test-media.cpp
@@ -73,7 +73,7 @@ static int checkDevice(__u32 major, __u32 minor, bool iface, __u32 id)
return 0;
}
-typedef std::set<__u32> id_set;
+using id_set = std::set<__u32>;
static media_v2_topology topology;
static media_v2_entity *v2_ents;
diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp
index 15b68b5e..17ad488d 100644
--- a/utils/v4l2-ctl/v4l2-ctl-common.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp
@@ -22,7 +22,7 @@ struct ctrl_subset {
unsigned size[V4L2_CTRL_MAX_DIMS];
};
-typedef std::map<unsigned, std::vector<struct v4l2_ext_control> > class2ctrls_map;
+using class2ctrls_map = std::map<unsigned int, std::vector<struct v4l2_ext_control> >;
using ctrl_qmap = std::map<std::string, struct v4l2_query_ext_ctrl>;
static ctrl_qmap ctrl_str2q;
diff --git a/utils/v4l2-ctl/v4l2-ctl.h b/utils/v4l2-ctl/v4l2-ctl.h
index f9bad45c..7518ac6f 100644
--- a/utils/v4l2-ctl/v4l2-ctl.h
+++ b/utils/v4l2-ctl/v4l2-ctl.h
@@ -277,10 +277,10 @@ extern __u32 vidcap_buftype;
extern __u32 vidout_buftype;
extern int verbose;
-typedef struct {
+struct flag_def {
unsigned flag;
const char *str;
-} flag_def;
+};
/* fmts specified */
#define FmtWidth (1L<<0)

Privacy Policy