From patchwork Mon Jul 27 03:14:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 11686287 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D0347912 for ; Mon, 27 Jul 2020 03:15:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AC19520773 for ; Mon, 27 Jul 2020 03:15:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Lj6/TKns" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727997AbgG0DPB (ORCPT ); Sun, 26 Jul 2020 23:15:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727985AbgG0DO7 (ORCPT ); Sun, 26 Jul 2020 23:14:59 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DCFDC0619D4 for ; Sun, 26 Jul 2020 20:14:59 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id j20so8267037pfe.5 for ; Sun, 26 Jul 2020 20:14:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=5OX4XYSjGf4BSZrMxSFN5I6MJZK8anAdKIFRJQASvGY=; b=Lj6/TKnsGR0gY3bIHW+VyqaoH/vTQQbdN9un/9QRaHH823kY8cW40XnfgTgWZRdWrc ZwTvQsLJf97l+bf29NVZ3OdECRU4KaOSadb1lQYPv4Xd+YD9OYKlXIJhqt6ZAphdmGif OVfFyPpjsf1vYAw0bUl/MnRqRy15hL0jS9vb8QXscvsugx2l+co+x8iUb0w6wNvjk7/T Xsq9+3KrS6Tm3c8Nok6kYRVtn1JL2R4Q8WetNrIPqUciutfuL0+2eH0wZ9hOwK+wGJP8 YVXoie1I6lTNvVxPUk18wfb0PIKShYzjocRGUeuInybnYhAU1mI0Cx/k8fiKWqwaUdxM jLlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5OX4XYSjGf4BSZrMxSFN5I6MJZK8anAdKIFRJQASvGY=; b=NwRpKaordtEgKzpD6/DLnUL3WkGUheAsBodbgZcMxH+ZuwwQo2CjiWR/3JcNBb4wAF b+6le35nWVpRCf8k/8hecHC1/TOO9Uc7h0gOZTlTYpDKXj9qc3l6gCSr2QxDevlg6V/I lKoWJR6MKA9HI2EetXffyGIOZ10GlgOjrysO7CKi7R2Qw4XwRrzM4qyr9+74RHc2BC0q AwjIGCU77PkSjEY2b0YfOfxqBcAmvnbIXc5kTSD2MM5uk1RQmbo6xtg5/CwGrOMGHM/7 Sb1wuzCtpBiPlbIkqG2b7UIQqDAqTSYg+2q1o3ECFCkJTYaVf/bRkP45tycNCT0QO5MQ hyIQ== X-Gm-Message-State: AOAM5308LD1lYMaQXMLTpesubD4mvD16wBYoLhd9lqILzWYuBw2xQffr GT6A1YO7muBkCCb/avcvDW9tnYFbFaM= X-Google-Smtp-Source: ABdhPJxu4wBhZO7X2SgcJVDoOQJjiTUopoL1YBqck6rMIfwqt53VbUL1GkzJTpWeY3XKBQOmfMB4kA== X-Received: by 2002:a62:fb07:: with SMTP id x7mr19450916pfm.252.1595819698767; Sun, 26 Jul 2020 20:14:58 -0700 (PDT) Received: from mangix-trapnet.lan ([2001:470:1f05:79e::a89]) by smtp.gmail.com with ESMTPSA id t126sm13259345pfd.214.2020.07.26.20.14.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Jul 2020 20:14:58 -0700 (PDT) From: Rosen Penev To: linux-media@vger.kernel.org Subject: [PATCH 1/8] fix GCC enum warning Date: Sun, 26 Jul 2020 20:14:49 -0700 Message-Id: <20200727031456.232955-2-rosenp@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200727031456.232955-1-rosenp@gmail.com> References: <20200727031456.232955-1-rosenp@gmail.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Found with -Wenum-compare Signed-off-by: Rosen Penev --- utils/common/v4l-helpers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/common/v4l-helpers.h b/utils/common/v4l-helpers.h index e093e717..edd21c16 100644 --- a/utils/common/v4l-helpers.h +++ b/utils/common/v4l-helpers.h @@ -877,7 +877,7 @@ v4l_format_g_hsv_enc(const struct v4l2_format *fmt) { unsigned hsv_enc = v4l_format_g_ycbcr_enc(fmt); - return hsv_enc < V4L2_HSV_ENC_180 ? V4L2_HSV_ENC_180 : hsv_enc; + return hsv_enc < V4L2_HSV_ENC_180 ? unsigned(V4L2_HSV_ENC_180) : hsv_enc; } static inline void v4l_format_s_quantization(struct v4l2_format *fmt, From patchwork Mon Jul 27 03:14:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 11686291 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E9493722 for ; Mon, 27 Jul 2020 03:15:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C023120773 for ; Mon, 27 Jul 2020 03:15:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZuW5bZkZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728010AbgG0DPD (ORCPT ); Sun, 26 Jul 2020 23:15:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727990AbgG0DPB (ORCPT ); Sun, 26 Jul 2020 23:15:01 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1ECAFC0619D2 for ; Sun, 26 Jul 2020 20:15:01 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id lw1so620626pjb.1 for ; Sun, 26 Jul 2020 20:15:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=KujugZSclNu7zCqwMMloR8+u687o8G2Gv9VuEx8lS94=; b=ZuW5bZkZqE5ijieBA8zPVZzUcOcfxNKYl9U8Y3EQLrEWSp/txcLFZ1hmvI4wq9b7Rm ohMjr5Nud2zEw2JCsko598OFtChLCn64qAFeFsxqHqMPR/ncNj9CQ5BssBP2j4sK7ksD aMs3xMLb/anjpeK8pHVqrcObkhP92KFM1/RLMHJ0zVRdIVXtXUgadxlfP519VUUYL/RI KOtaxM79aO72IBvuG7QoSdXQrMK/XpmKNNP17V39OTWY+tfp+lGZoJ+Q833t/M5SKn3m GGArgTNwr58atJtErx8CeKX5KYXF62jqpf0d5kyTefVpeBqBGT5Dse+5lqKYs7VyjQQK dYYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KujugZSclNu7zCqwMMloR8+u687o8G2Gv9VuEx8lS94=; b=elkmeWt2Nd+lDw+kkXsIWlxQCae/hMIny+mamHN0QFxqysnJw2X79DCkI1HGk/c8Iu dIsHguPty7y3nIiLwny08rn41Bn0kiBzxlhA/TBvRWDvNa/Mqvk8bMK1JQxIboqfX7aV 8eQevSk6JfDS/STb14YRibGIT9sLURhMDRk8vvtAkUU/WGrIh8hu045F7ltfykPQCXp0 igFKHao923/DckUnZDbHorBn/kyWoc+1ra1eZIP8VgHg+K2Q+cTzSbV+UDDcJavHrX+K jmt2dxrSxz5aAQcVZ5ek9QrESNOYkrKiaN0VDmLPg2jVT86NL38j90w7L4uI29CdEDs4 l6cQ== X-Gm-Message-State: AOAM530MuVui4HoTPJekixRzxARdCl97LvwZl7C48RQXK7py6xkCLD3i eJv4RWB3zoyvYixE8naWsamx6wxlZUQ= X-Google-Smtp-Source: ABdhPJwB8eHdmMQ6rJkBJTeKEbYs4z6LuhpOk/otwzWPSDBxgfMrMBCP0jYvhkEgE2Pb6q/Hva1NGQ== X-Received: by 2002:a17:902:9009:: with SMTP id a9mr16112970plp.252.1595819699784; Sun, 26 Jul 2020 20:14:59 -0700 (PDT) Received: from mangix-trapnet.lan ([2001:470:1f05:79e::a89]) by smtp.gmail.com with ESMTPSA id t126sm13259345pfd.214.2020.07.26.20.14.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Jul 2020 20:14:59 -0700 (PDT) From: Rosen Penev To: linux-media@vger.kernel.org Subject: [PATCH 2/8] [clang-tidy] convert to range based loops Date: Sun, 26 Jul 2020 20:14:50 -0700 Message-Id: <20200727031456.232955-3-rosenp@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200727031456.232955-1-rosenp@gmail.com> References: <20200727031456.232955-1-rosenp@gmail.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Found with modernize-loop-convert Signed-off-by: Rosen Penev --- utils/cec-compliance/cec-test.cpp | 57 ++++++------ utils/cec-ctl/cec-ctl.cpp | 28 +++--- utils/cec-follower/cec-follower.cpp | 4 +- utils/cec-follower/cec-processing.cpp | 12 +-- utils/libcecutil/cec-info.cpp | 24 +++-- utils/libmedia_dev/get_media_devices.c | 6 +- utils/rds-ctl/rds-ctl.cpp | 12 ++- utils/v4l2-compliance/v4l2-compliance.cpp | 4 +- utils/v4l2-compliance/v4l2-test-buffers.cpp | 7 +- utils/v4l2-compliance/v4l2-test-formats.cpp | 14 +-- utils/v4l2-compliance/v4l2-test-media.cpp | 5 +- utils/v4l2-ctl/v4l2-ctl-common.cpp | 97 ++++++++++----------- utils/v4l2-ctl/v4l2-ctl-overlay.cpp | 4 +- utils/v4l2-ctl/v4l2-ctl-streaming.cpp | 8 +- utils/v4l2-dbg/v4l2-dbg.cpp | 5 +- 15 files changed, 132 insertions(+), 155 deletions(-) diff --git a/utils/cec-compliance/cec-test.cpp b/utils/cec-compliance/cec-test.cpp index c24c6aa2..2b5265a3 100644 --- a/utils/cec-compliance/cec-test.cpp +++ b/utils/cec-compliance/cec-test.cpp @@ -922,15 +922,14 @@ static int tuner_ctl_test(struct node *node, unsigned me, unsigned la, bool inte printf("\t Finished Channel Scan\n"); printf("\t Start Channel Test\n"); - for (std::vector::iterator iter = info_vec.begin(); - iter != info_vec.end(); iter++) { + for (const auto &iter : info_vec) { cec_msg_init(&msg, me, la); - log_tuner_service(*iter, "Select "); - if (iter->is_analog) - cec_msg_select_analogue_service(&msg, iter->analog.ana_bcast_type, - iter->analog.ana_freq, iter->analog.bcast_system); + log_tuner_service(iter, "Select "); + if (iter.is_analog) + cec_msg_select_analogue_service(&msg, iter.analog.ana_bcast_type, + iter.analog.ana_freq, iter.analog.bcast_system); else - cec_msg_select_digital_service(&msg, &iter->digital); + cec_msg_select_digital_service(&msg, &iter.digital); fail_on_test(!transmit(node, &msg)); fail_on_test(cec_msg_status_is_abort(&msg)); cec_msg_init(&msg, me, la); @@ -939,11 +938,11 @@ static int tuner_ctl_test(struct node *node, unsigned me, unsigned la, bool inte fail_on_test(timed_out_or_abort(&msg)); memset(&info, 0, sizeof(info)); cec_ops_tuner_device_status(&msg, &info); - if (memcmp(&info, &(*iter), sizeof(info))) { + if (memcmp(&info, &iter, sizeof(info))) { log_tuner_service(info); - log_tuner_service(*iter); + log_tuner_service(iter); } - fail_on_test(memcmp(&info, &(*iter), sizeof(info))); + fail_on_test(memcmp(&info, &iter, sizeof(info))); } printf("\t Finished Channel Test\n"); @@ -1500,15 +1499,15 @@ void collectTests() { std::map mapTestFuncs; - for (unsigned i = 0; i < num_tests; i++) { - for (unsigned j = 0; j < tests[i].num_subtests; j++) { - std::string name = safename(tests[i].subtests[j].name); - __u64 func = (__u64)tests[i].subtests[j].test_fn; + for (const auto &test : tests) { + for (unsigned j = 0; j < test.num_subtests; j++) { + std::string name = safename(test.subtests[j].name); + __u64 func = (__u64)test.subtests[j].test_fn; if (mapTestFuncs.find(name) != mapTestFuncs.end() && mapTestFuncs[name] != func) { fprintf(stderr, "Duplicate subtest name, but different tests: %s\n", - tests[i].subtests[j].name); + test.subtests[j].name); std::exit(EXIT_FAILURE); } mapTestFuncs[name] = func; @@ -1520,10 +1519,10 @@ void collectTests() void listTests() { - for (unsigned i = 0; i < num_tests; i++) { - printf("%s:\n", tests[i].name); - for (unsigned j = 0; j < tests[i].num_subtests; j++) { - std::string name = safename(tests[i].subtests[j].name); + for (const auto &test : tests) { + printf("%s:\n", test.name); + for (unsigned j = 0; j < test.num_subtests; j++) { + std::string name = safename(test.subtests[j].name); printf("\t%s\n", name.c_str()); } @@ -1564,32 +1563,32 @@ void testRemote(struct node *node, unsigned me, unsigned la, unsigned test_tags, int ret = 0; - for (unsigned i = 0; i < num_tests; i++) { - if ((tests[i].tags & test_tags) != tests[i].tags) + for (const auto &test : tests) { + if ((test.tags & test_tags) != test.tags) continue; - printf("\t%s:\n", tests[i].name); - for (unsigned j = 0; j < tests[i].num_subtests; j++) { - const char *name = tests[i].subtests[j].name; + printf("\t%s:\n", test.name); + for (unsigned j = 0; j < test.num_subtests; j++) { + const char *name = test.subtests[j].name; - if (tests[i].subtests[j].for_cec20 && + if (test.subtests[j].for_cec20 && (node->remote[la].cec_version < CEC_OP_CEC_VERSION_2_0 || !node->has_cec20)) continue; - if (tests[i].subtests[j].in_standby) { + if (test.subtests[j].in_standby) { struct cec_log_addrs laddrs = { }; doioctl(node, CEC_ADAP_G_LOG_ADDRS, &laddrs); if (!laddrs.log_addr_mask) continue; } - node->in_standby = tests[i].subtests[j].in_standby; + node->in_standby = test.subtests[j].in_standby; mode_set_initiator(node); unsigned old_warnings = warnings; - ret = tests[i].subtests[j].test_fn(node, me, la, interactive); + ret = test.subtests[j].test_fn(node, me, la, interactive); bool has_warnings = old_warnings < warnings; - if (!(tests[i].subtests[j].la_mask & (1 << la)) && !ret) + if (!(test.subtests[j].la_mask & (1 << la)) && !ret) ret = OK_UNEXPECTED; if (mapTests[safename(name)] != DONT_CARE) { diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp index 47867f87..1fa7ba15 100644 --- a/utils/cec-ctl/cec-ctl.cpp +++ b/utils/cec-ctl/cec-ctl.cpp @@ -706,9 +706,9 @@ static int showTopology(struct node *node) return 0; printf("\n\tTopology:\n\n"); - for (unsigned i = 0; i < 16; i++) { - __u16 pa = pas[i] >> 8; - __u8 la = pas[i] & 0xf; + for (unsigned int i : pas) { + __u16 pa = i >> 8; + __u8 la = i & 0xf; if (pa == 0xffff) break; @@ -1804,9 +1804,8 @@ static void list_devices() std::sort(files.begin(), files.end(), sort_on_device_name); - for (dev_vec::iterator iter = files.begin(); - iter != files.end(); ++iter) { - int fd = open(iter->c_str(), O_RDWR); + for (const auto &file : files) { + int fd = open(file.c_str(), O_RDWR); std::string cec_info; if (fd < 0) @@ -1818,14 +1817,13 @@ static void list_devices() cec_info = std::string(caps.driver) + " (" + caps.name + ")"; if (cards[cec_info].empty()) cards[cec_info] += cec_info + ":\n"; - cards[cec_info] += "\t" + (*iter); - if (!(links[*iter].empty())) - cards[cec_info] += " <- " + links[*iter]; + cards[cec_info] += "\t" + file; + if (!(links[file].empty())) + cards[cec_info] += " <- " + links[file]; cards[cec_info] += "\n"; } - for (dev_map::iterator iter = cards.begin(); - iter != cards.end(); ++iter) { - printf("%s\n", iter->second.c_str()); + for (const auto &card : cards) { + printf("%s\n", card.second.c_str()); } } @@ -2619,10 +2617,8 @@ int main(int argc, char **argv) if (options[OptNonBlocking]) fcntl(node.fd, F_SETFL, fcntl(node.fd, F_GETFL) | O_NONBLOCK); - for (msg_vec::iterator iter = msgs.begin(); iter != msgs.end(); ++iter) { - struct cec_msg msg = *iter; - - fflush(stdout); + for (auto &msg : msgs) { + fflush(stdout); if (!cec_msg_is_broadcast(&msg) && !options[OptTo]) { fprintf(stderr, "attempting to send message without --to\n"); std::exit(EXIT_FAILURE); diff --git a/utils/cec-follower/cec-follower.cpp b/utils/cec-follower/cec-follower.cpp index b31b51d3..9acdb305 100644 --- a/utils/cec-follower/cec-follower.cpp +++ b/utils/cec-follower/cec-follower.cpp @@ -500,9 +500,7 @@ int main(int argc, char **argv) if (laddrs.cec_version >= CEC_OP_CEC_VERSION_2_0) { bool is_dev_feat = false; - for (unsigned idx = 0; idx < sizeof(laddrs.features[0]); idx++) { - __u8 byte = laddrs.features[0][idx]; - + for (__u8 byte : laddrs.features[0]) { if (is_dev_feat) { node.source_has_arc_rx = (byte & CEC_OP_FEAT_DEV_SOURCE_HAS_ARC_RX) != 0; node.sink_has_arc_tx = (byte & CEC_OP_FEAT_DEV_SINK_HAS_ARC_TX) != 0; diff --git a/utils/cec-follower/cec-processing.cpp b/utils/cec-follower/cec-processing.cpp index bc8c9c09..b3316753 100644 --- a/utils/cec-follower/cec-processing.cpp +++ b/utils/cec-follower/cec-processing.cpp @@ -763,14 +763,14 @@ static void processMsg(struct node *node, struct cec_msg &msg, unsigned me) format_list.erase(format_list.end() - 1); dev_info("Requested descriptors: %s\n", format_list.c_str()); for (unsigned i = 0; i < num_descriptors; i++) { - for (unsigned j = 0; j < ARRAY_SIZE(supported_formats); j++) { + for (const auto &supported_format : supported_formats) { if (found_descs >= 4) break; if ((audio_format_id[i] == 0 && - audio_format_code[i] == supported_formats[j].format_code) || + audio_format_code[i] == supported_format.format_code) || (audio_format_id[i] == 1 && - audio_format_code[i] == supported_formats[j].extension_type_code)) - sad_encode(&supported_formats[j], &descriptors[found_descs++]); + audio_format_code[i] == supported_format.extension_type_code)) + sad_encode(&supported_format, &descriptors[found_descs++]); } } @@ -844,8 +844,8 @@ static void processMsg(struct node *node, struct cec_msg &msg, unsigned me) static void poll_remote_devs(struct node *node, unsigned me) { node->remote_la_mask = 0; - for (unsigned i = 0; i < 15; i++) - node->remote_phys_addr[i] = CEC_PHYS_ADDR_INVALID; + for (unsigned short & i : node->remote_phys_addr) + i = CEC_PHYS_ADDR_INVALID; if (!(node->caps & CEC_CAP_TRANSMIT)) return; diff --git a/utils/libcecutil/cec-info.cpp b/utils/libcecutil/cec-info.cpp index f6e60918..9a12e6a1 100644 --- a/utils/libcecutil/cec-info.cpp +++ b/utils/libcecutil/cec-info.cpp @@ -18,25 +18,25 @@ const char *cec_opcode2s(unsigned opcode) { - for (unsigned i = 0; i < sizeof(msgtable) / sizeof(msgtable[0]); i++) - if (msgtable[i].opcode == opcode) - return msgtable[i].name; + for (auto i : msgtable) + if (i.opcode == opcode) + return i.name; return NULL; } const char *cec_cdc_opcode2s(unsigned cdc_opcode) { - for (unsigned i = 0; i < sizeof(cdcmsgtable) / sizeof(cdcmsgtable[0]); i++) - if (cdcmsgtable[i].opcode == cdc_opcode) - return cdcmsgtable[i].name; + for (auto i : cdcmsgtable) + if (i.opcode == cdc_opcode) + return i.name; return NULL; } const char *cec_htng_opcode2s(unsigned htng_opcode) { - for (unsigned i = 0; i < sizeof(htngmsgtable) / sizeof(htngmsgtable[0]); i++) - if (htngmsgtable[i].opcode == htng_opcode) - return htngmsgtable[i].name; + for (auto i : htngmsgtable) + if (i.opcode == htng_opcode) + return i.name; return NULL; } @@ -443,10 +443,8 @@ void cec_driver_info(const struct cec_caps &caps, cec_all_dev_types2s(laddrs.all_device_types[i]).c_str()); bool is_dev_feat = false; - for (unsigned idx = 0; idx < sizeof(laddrs.features[0]); idx++) { - __u8 byte = laddrs.features[i][idx]; - - if (!is_dev_feat) { + for (__u8 byte : laddrs.features[i]) { + if (!is_dev_feat) { if (byte & 0x40) { printf("\t RC Source Profile :\n%s", cec_rc_src_prof2s(byte, "").c_str()); diff --git a/utils/libmedia_dev/get_media_devices.c b/utils/libmedia_dev/get_media_devices.c index 491a94da..21920867 100644 --- a/utils/libmedia_dev/get_media_devices.c +++ b/utils/libmedia_dev/get_media_devices.c @@ -230,7 +230,7 @@ static int add_v4l_class(struct media_device_entry *md) md->type = MEDIA_V4L_SUBDEV; return 0; -}; +} static int add_snd_class(struct media_device_entry *md) { @@ -274,7 +274,7 @@ static int add_snd_class(struct media_device_entry *md) md->node = strdup(node); return 0; -}; +} static int add_dvb_class(struct media_device_entry *md) { @@ -298,7 +298,7 @@ static int add_dvb_class(struct media_device_entry *md) md->type = MEDIA_DVB_OSD; return 0; -}; +} static int sort_media_device_entry(const void *a, const void *b) { diff --git a/utils/rds-ctl/rds-ctl.cpp b/utils/rds-ctl/rds-ctl.cpp index 73fc7e3c..e69a498d 100644 --- a/utils/rds-ctl/rds-ctl.cpp +++ b/utils/rds-ctl/rds-ctl.cpp @@ -306,9 +306,8 @@ static void print_devices(dev_vec files) std::string bus_info; struct v4l2_capability vcap; - for (dev_vec::iterator iter = files.begin(); - iter != files.end(); ++iter) { - fd = open(iter->c_str(), O_RDWR); + for (const auto &file : files) { + fd = open(file.c_str(), O_RDWR); memset(&vcap, 0, sizeof(vcap)); if (fd < 0) continue; @@ -318,12 +317,11 @@ static void print_devices(dev_vec files) if (cards[bus_info].empty()) cards[bus_info] += std::string(reinterpret_cast(vcap.card)) + " (" + bus_info + "):\n"; - cards[bus_info] += "\t" + (*iter); + cards[bus_info] += "\t" + file; cards[bus_info] += "\n"; } - for (dev_map::iterator iter = cards.begin(); - iter != cards.end(); ++iter) { - printf("%s\n", iter->second.c_str()); + for (const auto &card : cards) { + printf("%s\n", card.second.c_str()); } } static dev_vec list_devices() diff --git a/utils/v4l2-compliance/v4l2-compliance.cpp b/utils/v4l2-compliance/v4l2-compliance.cpp index 92b4e995..5f9996fb 100644 --- a/utils/v4l2-compliance/v4l2-compliance.cpp +++ b/utils/v4l2-compliance/v4l2-compliance.cpp @@ -1270,8 +1270,8 @@ void testNode(struct node &node, struct node &node_m2m_cap, struct node &expbuf_ node.valid_buftypes = 0; node.valid_memorytype = 0; node.buf_caps = 0; - for (unsigned idx = 0; idx < V4L2_BUF_TYPE_LAST + 1; idx++) - node.buftype_pixfmts[idx].clear(); + for (auto &buftype_pixfmt : node.buftype_pixfmts) + buftype_pixfmt.clear(); if (max_io) { sprintf(suffix, " (%s %u)", diff --git a/utils/v4l2-compliance/v4l2-test-buffers.cpp b/utils/v4l2-compliance/v4l2-test-buffers.cpp index cdfbbd34..d4b1eb8b 100644 --- a/utils/v4l2-compliance/v4l2-test-buffers.cpp +++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -2708,10 +2709,8 @@ static selTest createSelTest(struct node *node) static bool haveSelTest(const selTest &test) { - for (unsigned i = 0; i < selTests.size(); i++) - if (!memcmp(&selTests[i], &test, sizeof(test))) - return true; - return false; + return std::any_of(selTests.begin(), selTests.end(), [&](const selTest &selfTest) + { return &selfTest != &test; }); } static void streamFmtRun(struct node *node, cv4l_fmt &fmt, unsigned frame_count, diff --git a/utils/v4l2-compliance/v4l2-test-formats.cpp b/utils/v4l2-compliance/v4l2-test-formats.cpp index 73719cc3..b865e596 100644 --- a/utils/v4l2-compliance/v4l2-test-formats.cpp +++ b/utils/v4l2-compliance/v4l2-test-formats.cpp @@ -529,11 +529,11 @@ static int testFormatsType(struct node *node, int ret, unsigned type, struct v4 if (ret) return fail("sliced.reserved not zeroed\n"); fail_on_test(sliced.service_lines[0][0] || sliced.service_lines[1][0]); - for (int f = 0; f < 2; f++) { - for (int i = 0; i < 24; i++) { - if (sliced.service_lines[f][i]) + for (const auto &service_line : sliced.service_lines) { + for (unsigned short i : service_line) { + if (i) cnt++; - service_set |= sliced.service_lines[f][i]; + service_set |= i; } } fail_on_test(sliced.io_size < sizeof(struct v4l2_sliced_vbi_data) * cnt); @@ -1243,9 +1243,9 @@ static int testSlicedVBICapType(struct node *node, unsigned type) fail_on_test(cap.type != type); fail_on_test(!sliced_type || !(node->g_caps() & buftype2cap[type])); - for (int f = 0; f < 2; f++) - for (int i = 0; i < 24; i++) - service_set |= cap.service_lines[f][i]; + for (const auto &service_line : cap.service_lines) + for (unsigned short i : service_line) + service_set |= i; fail_on_test(cap.service_set != service_set); fail_on_test(cap.service_lines[0][0] || cap.service_lines[1][0]); return 0; diff --git a/utils/v4l2-compliance/v4l2-test-media.cpp b/utils/v4l2-compliance/v4l2-test-media.cpp index bcd8a725..f5101e33 100644 --- a/utils/v4l2-compliance/v4l2-test-media.cpp +++ b/utils/v4l2-compliance/v4l2-test-media.cpp @@ -393,9 +393,8 @@ int testMediaEnum(struct node *node) } fail_on_test(num_data_links != num_links); - for (entity_map::iterator iter = ent_map.begin(); - iter != ent_map.end(); ++iter) { - media_entity_desc &ent = iter->second; + for (auto & iter : ent_map) { + media_entity_desc &ent = iter.second; memset(&links, 0, sizeof(links)); memset(&links.reserved, 0xff, sizeof(links.reserved)); diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp index 9b785cbf..ea026fd5 100644 --- a/utils/v4l2-ctl/v4l2-ctl-common.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp @@ -291,9 +291,8 @@ static void list_devices() std::sort(files.begin(), files.end(), sort_on_device_name); - for (dev_vec::iterator iter = files.begin(); - iter != files.end(); ++iter) { - int fd = open(iter->c_str(), O_RDWR); + for (const auto &file : files) { + int fd = open(file.c_str(), O_RDWR); std::string bus_info; std::string card; @@ -323,14 +322,13 @@ static void list_devices() continue; if (cards[bus_info].empty()) cards[bus_info] += card + " (" + bus_info + "):\n"; - cards[bus_info] += "\t" + (*iter); - if (!(links[*iter].empty())) - cards[bus_info] += " <- " + links[*iter]; + cards[bus_info] += "\t" + file; + if (!(links[file].empty())) + cards[bus_info] += " <- " + links[file]; cards[bus_info] += "\n"; } - for (dev_map::iterator iter = cards.begin(); - iter != cards.end(); ++iter) { - printf("%s\n", iter->second.c_str()); + for (const auto &card : cards) { + printf("%s\n", card.second.c_str()); } } @@ -693,15 +691,15 @@ void common_process_controls(cv4l_fd &fd) have_query_ext_ctrl = rc == 0; find_controls(fd); - for (ctrl_get_list::iterator iter = get_ctrls.begin(); iter != get_ctrls.end(); ++iter) { - if (ctrl_str2q.find(*iter) == ctrl_str2q.end()) { - fprintf(stderr, "unknown control '%s'\n", iter->c_str()); + for (const auto &get_ctrl : get_ctrls) { + if (ctrl_str2q.find(get_ctrl) == ctrl_str2q.end()) { + fprintf(stderr, "unknown control '%s'\n", get_ctrl.c_str()); std::exit(EXIT_FAILURE); } } - for (ctrl_set_map::iterator iter = set_ctrls.begin(); iter != set_ctrls.end(); ++iter) { - if (ctrl_str2q.find(iter->first) == ctrl_str2q.end()) { - fprintf(stderr, "unknown control '%s'\n", iter->first.c_str()); + for (const auto &set_ctrl : set_ctrls) { + if (ctrl_str2q.find(set_ctrl.first) == ctrl_str2q.end()) { + fprintf(stderr, "unknown control '%s'\n", set_ctrl.first.c_str()); std::exit(EXIT_FAILURE); } } @@ -914,10 +912,9 @@ void common_set(cv4l_fd &_fd) bool use_ext_ctrls = false; memset(&ctrls, 0, sizeof(ctrls)); - for (ctrl_set_map::iterator iter = set_ctrls.begin(); - iter != set_ctrls.end(); ++iter) { + for (const auto &set_ctrl : set_ctrls) { struct v4l2_ext_control ctrl; - struct v4l2_query_ext_ctrl &qc = ctrl_str2q[iter->first]; + struct v4l2_query_ext_ctrl &qc = ctrl_str2q[set_ctrl.first]; memset(&ctrl, 0, sizeof(ctrl)); ctrl.id = qc.id; @@ -953,29 +950,29 @@ void common_set(cv4l_fd &_fd) switch (qc.type) { case V4L2_CTRL_TYPE_U8: - v = strtoul(iter->second.c_str(), NULL, 0); + v = strtoul(set_ctrl.second.c_str(), NULL, 0); for (i = 0; i < qc.elems; i++) if (idx_in_subset(qc, subset, divide, i)) ctrl.p_u8[i] = v; break; case V4L2_CTRL_TYPE_U16: - v = strtoul(iter->second.c_str(), NULL, 0); + v = strtoul(set_ctrl.second.c_str(), NULL, 0); for (i = 0; i < qc.elems; i++) if (idx_in_subset(qc, subset, divide, i)) ctrl.p_u16[i] = v; break; case V4L2_CTRL_TYPE_U32: - v = strtoul(iter->second.c_str(), NULL, 0); + v = strtoul(set_ctrl.second.c_str(), NULL, 0); for (i = 0; i < qc.elems; i++) if (idx_in_subset(qc, subset, divide, i)) ctrl.p_u32[i] = v; break; case V4L2_CTRL_TYPE_STRING: - strncpy(ctrl.string, iter->second.c_str(), qc.maximum); + strncpy(ctrl.string, set_ctrl.second.c_str(), qc.maximum); ctrl.string[qc.maximum] = 0; break; case V4L2_CTRL_TYPE_AREA: - sscanf(iter->second.c_str(), "%ux%u", + sscanf(set_ctrl.second.c_str(), "%ux%u", &ctrl.p_area->width, &ctrl.p_area->height); break; default: @@ -986,20 +983,19 @@ void common_set(cv4l_fd &_fd) } else { if (V4L2_CTRL_DRIVER_PRIV(ctrl.id)) use_ext_ctrls = true; - ctrl.value = strtol(iter->second.c_str(), NULL, 0); + ctrl.value = strtol(set_ctrl.second.c_str(), NULL, 0); } class2ctrls[V4L2_CTRL_ID2WHICH(ctrl.id)].push_back(ctrl); } - for (class2ctrls_map::iterator iter = class2ctrls.begin(); - iter != class2ctrls.end(); ++iter) { + for (auto &class2ctrl : class2ctrls) { if (!use_ext_ctrls && - (iter->first == V4L2_CTRL_CLASS_USER || - iter->first == V4L2_CID_PRIVATE_BASE)) { - for (unsigned i = 0; i < iter->second.size(); i++) { + (class2ctrl.first == V4L2_CTRL_CLASS_USER || + class2ctrl.first == V4L2_CID_PRIVATE_BASE)) { + for (const auto &i : class2ctrl.second) { struct v4l2_control ctrl; - ctrl.id = iter->second[i].id; - ctrl.value = iter->second[i].value; + ctrl.id = i.id; + ctrl.value = i.value; if (doioctl(fd, VIDIOC_S_CTRL, &ctrl)) { fprintf(stderr, "%s: %s\n", ctrl_id2str[ctrl.id].c_str(), @@ -1008,10 +1004,10 @@ void common_set(cv4l_fd &_fd) } continue; } - if (!iter->second.empty()) { - ctrls.which = iter->first; - ctrls.count = iter->second.size(); - ctrls.controls = &iter->second[0]; + if (!class2ctrl.second.empty()) { + ctrls.which = class2ctrl.first; + ctrls.count = class2ctrl.second.size(); + ctrls.controls = &class2ctrl.second[0]; if (doioctl(fd, VIDIOC_S_EXT_CTRLS, &ctrls)) { if (ctrls.error_idx >= ctrls.count) { fprintf(stderr, "Error setting controls: %s\n", @@ -1019,7 +1015,7 @@ void common_set(cv4l_fd &_fd) } else { fprintf(stderr, "%s: %s\n", - ctrl_id2str[iter->second[ctrls.error_idx].id].c_str(), + ctrl_id2str[class2ctrl.second[ctrls.error_idx].id].c_str(), strerror(errno)); } } @@ -1101,10 +1097,9 @@ void common_get(cv4l_fd &_fd) bool use_ext_ctrls = false; memset(&ctrls, 0, sizeof(ctrls)); - for (ctrl_get_list::iterator iter = get_ctrls.begin(); - iter != get_ctrls.end(); ++iter) { + for (const auto &get_ctrl : get_ctrls) { struct v4l2_ext_control ctrl; - struct v4l2_query_ext_ctrl &qc = ctrl_str2q[*iter]; + struct v4l2_query_ext_ctrl &qc = ctrl_str2q[get_ctrl]; memset(&ctrl, 0, sizeof(ctrl)); ctrl.id = qc.id; @@ -1120,28 +1115,26 @@ void common_get(cv4l_fd &_fd) use_ext_ctrls = true; class2ctrls[V4L2_CTRL_ID2WHICH(ctrl.id)].push_back(ctrl); } - for (class2ctrls_map::iterator iter = class2ctrls.begin(); - iter != class2ctrls.end(); ++iter) { + for (auto &class2ctrl : class2ctrls) { if (!use_ext_ctrls && - (iter->first == V4L2_CTRL_CLASS_USER || - iter->first == V4L2_CID_PRIVATE_BASE)) { - for (unsigned i = 0; i < iter->second.size(); i++) { + (class2ctrl.first == V4L2_CTRL_CLASS_USER || + class2ctrl.first == V4L2_CID_PRIVATE_BASE)) { + for (const auto &i : class2ctrl.second) { struct v4l2_control ctrl; - ctrl.id = iter->second[i].id; + ctrl.id = i.id; doioctl(fd, VIDIOC_G_CTRL, &ctrl); printf("%s: %d\n", ctrl_id2str[ctrl.id].c_str(), ctrl.value); } continue; } - if (!iter->second.empty()) { - ctrls.which = iter->first; - ctrls.count = iter->second.size(); - ctrls.controls = &iter->second[0]; + if (!class2ctrl.second.empty()) { + ctrls.which = class2ctrl.first; + ctrls.count = class2ctrl.second.size(); + ctrls.controls = &class2ctrl.second[0]; doioctl(fd, VIDIOC_G_EXT_CTRLS, &ctrls); - for (unsigned i = 0; i < iter->second.size(); i++) { - struct v4l2_ext_control ctrl = iter->second[i]; - std::string &name = ctrl_id2str[ctrl.id]; + for (auto ctrl : class2ctrl.second) { + std::string &name = ctrl_id2str[ctrl.id]; struct v4l2_query_ext_ctrl &qc = ctrl_str2q[name]; if (qc.flags & V4L2_CTRL_FLAG_HAS_PAYLOAD) { diff --git a/utils/v4l2-ctl/v4l2-ctl-overlay.cpp b/utils/v4l2-ctl/v4l2-ctl-overlay.cpp index 16344a15..7809a6db 100644 --- a/utils/v4l2-ctl/v4l2-ctl-overlay.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-overlay.cpp @@ -437,9 +437,7 @@ static void do_try_set_overlay(struct v4l2_format &fmt, int fd) stride = (win.w.width + 7) / 8; bitmap = static_cast(calloc(1, stride * win.w.height)); win.bitmap = bitmap; - for (unsigned i = 0; i < bitmap_rects.size(); i++) { - const v4l2_rect &r = bitmap_rects[i]; - + for (const auto &r : bitmap_rects) { if (r.left + r.width > win.w.width || r.top + r.height > win.w.height) { fprintf(stderr, "rectangle is out of range\n"); diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp index 71714ec7..d986c7b6 100644 --- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp @@ -879,10 +879,10 @@ static bool set_fwht_req_by_fd(const struct fwht_cframe_hdr *hdr, set_fwht_stateless_params(fwht_params, hdr, last_bf_ts); - for (int idx = 0; idx < VIDEO_MAX_FRAME; idx++) { - if (fwht_reqs[idx].fd == req_fd) { - fwht_reqs[idx].ts = ts; - fwht_reqs[idx].params = fwht_params; + for (auto &fwht_req : fwht_reqs) { + if (fwht_req.fd == req_fd) { + fwht_req.ts = ts; + fwht_req.params = fwht_params; return true; } } diff --git a/utils/v4l2-dbg/v4l2-dbg.cpp b/utils/v4l2-dbg/v4l2-dbg.cpp index 214fb9de..8b23752a 100644 --- a/utils/v4l2-dbg/v4l2-dbg.cpp +++ b/utils/v4l2-dbg/v4l2-dbg.cpp @@ -650,9 +650,8 @@ int main(int argc, char **argv) get_reg.match = match; printf("ioctl: VIDIOC_DBG_G_REGISTER\n"); - for (std::vector::iterator iter = get_regs.begin(); - iter != get_regs.end(); ++iter) { - get_reg.reg = parse_reg(curr_bd, *iter); + for (const auto ® : get_regs) { + get_reg.reg = parse_reg(curr_bd, reg); if (ioctl(fd, VIDIOC_DBG_G_REGISTER, &get_reg) < 0) fprintf(stderr, "ioctl: VIDIOC_DBG_G_REGISTER " "failed for 0x%llx\n", get_reg.reg); From patchwork Mon Jul 27 03:14:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 11686289 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 83FE86C1 for ; Mon, 27 Jul 2020 03:15:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6485A20773 for ; Mon, 27 Jul 2020 03:15:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mdbQh28Y" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728008AbgG0DPC (ORCPT ); Sun, 26 Jul 2020 23:15:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728001AbgG0DPB (ORCPT ); Sun, 26 Jul 2020 23:15:01 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6800EC0619D4 for ; Sun, 26 Jul 2020 20:15:01 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id k4so7266815pld.12 for ; Sun, 26 Jul 2020 20:15:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=eOg0ShaItpaguOUpLStj6CyaCXaW+3MJYdP1vjzgfCI=; b=mdbQh28YqHq+Hg9I9xmR4P6lWr0v7HnDSwv7Royfl0N+vbOjZ2/zAQVL6x8QdYlgYu VS5ZMbg6AJ0qD+1TeveIMM7dUPQ5IYJQos1nu2vAwdGdFTf/cR3GAMqgoV4S1Wxyb0p6 bw1BFePhARWd6YR2ko3ap67xMdSu4AWgcYQ0nnFEnumhuy75Jn3GiDXcb1iqwySgxo3z 8HCfNM6Uma270uTSeTAi0RNMzEnHvc7pOJt1OJCF0xKGma+bh6jL2rxWGic0/57RroUn 8B7CWDsgZw4j2dxW/ZybaGApujkIejAZ/WYRv6FTuVPsWGn3wDQDzw1nJtvFoGdBoEyz A0Mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eOg0ShaItpaguOUpLStj6CyaCXaW+3MJYdP1vjzgfCI=; b=B6l5vKq/nQYA6UGqms7LwsGYQGVJzLUrE8KTbD4X+JucsZSAAZnl8k47w3syMOzWCl lJhrz7LY/+pbpgkKzNhJAsMLI9og46zSDdpzYJeJNzJ07K0nEIxyTwG9OjO6/FRlEkBP hEMAYqUDLu8I7Kc7Pfxch9gJOJDi8iO5yjAC1dmxHQs2J7rc4SISVECoPZgXblsoGj1r dBSsQU2wQNZ4k7f+tIsuQdBvo+PXug5zjiwwvHsd39PyXfXCumxmHs1o/mQaoDgbCcto NVMhOomD9Uj9G9C5wEF1AFSrfAvt1FnCUZZu/s2IkBCzJ0wE8TlutY/wafiTNBhkQVNS 0lhg== X-Gm-Message-State: AOAM531MN5692sLEAE4FLqogikDiEMxQ8RF6CX4uMO/ZdrMRD4b6O5wQ bcoRhcIaH1QJ3phHiratFPNgiMj8c64= X-Google-Smtp-Source: ABdhPJxu5ykJn3q6oxgZv8cPxfQTlnKEbf7LvUhzYbW6lJNp/yzonBBG367hREM4E36Wg8GYr+cr8w== X-Received: by 2002:a17:902:9a0a:: with SMTP id v10mr17197341plp.134.1595819700567; Sun, 26 Jul 2020 20:15:00 -0700 (PDT) Received: from mangix-trapnet.lan ([2001:470:1f05:79e::a89]) by smtp.gmail.com with ESMTPSA id t126sm13259345pfd.214.2020.07.26.20.14.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Jul 2020 20:15:00 -0700 (PDT) From: Rosen Penev To: linux-media@vger.kernel.org Subject: [PATCH 3/8] [clang-tidy] use auto Date: Sun, 26 Jul 2020 20:14:51 -0700 Message-Id: <20200727031456.232955-4-rosenp@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200727031456.232955-1-rosenp@gmail.com> References: <20200727031456.232955-1-rosenp@gmail.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Found with modernize-use-auto Signed-off-by: Rosen Penev --- utils/cec-compliance/cec-compliance.cpp | 2 +- utils/cec-compliance/cec-test.cpp | 2 +- utils/cec-ctl/cec-ctl.cpp | 2 +- utils/cec-follower/cec-follower.cpp | 2 +- utils/rds-ctl/rds-ctl.cpp | 2 +- utils/v4l2-compliance/v4l2-compliance.cpp | 6 +++--- utils/v4l2-compliance/v4l2-test-buffers.cpp | 6 +++--- utils/v4l2-ctl/v4l2-ctl-common.cpp | 4 ++-- utils/v4l2-ctl/v4l2-ctl-streaming.cpp | 1 + utils/v4l2-ctl/v4l2-ctl-vidcap.cpp | 4 ++-- utils/v4l2-ctl/v4l2-ctl.cpp | 8 ++++---- 11 files changed, 20 insertions(+), 19 deletions(-) diff --git a/utils/cec-compliance/cec-compliance.cpp b/utils/cec-compliance/cec-compliance.cpp index 796d0b3c..06a8e23f 100644 --- a/utils/cec-compliance/cec-compliance.cpp +++ b/utils/cec-compliance/cec-compliance.cpp @@ -655,7 +655,7 @@ int cec_named_ioctl(struct node *node, const char *name, { int retval; int e; - struct cec_msg *msg = static_cast(parm); + auto msg = static_cast(parm); __u8 opcode = 0; std::string opname; diff --git a/utils/cec-compliance/cec-test.cpp b/utils/cec-compliance/cec-test.cpp index 2b5265a3..986d134f 100644 --- a/utils/cec-compliance/cec-test.cpp +++ b/utils/cec-compliance/cec-test.cpp @@ -1502,7 +1502,7 @@ void collectTests() for (const auto &test : tests) { for (unsigned j = 0; j < test.num_subtests; j++) { std::string name = safename(test.subtests[j].name); - __u64 func = (__u64)test.subtests[j].test_fn; + auto func = (__u64)test.subtests[j].test_fn; if (mapTestFuncs.find(name) != mapTestFuncs.end() && mapTestFuncs[name] != func) { diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp index 1fa7ba15..8ae800bb 100644 --- a/utils/cec-ctl/cec-ctl.cpp +++ b/utils/cec-ctl/cec-ctl.cpp @@ -1772,7 +1772,7 @@ static void list_devices() closedir(dp); /* Find device nodes which are links to other device nodes */ - for (dev_vec::iterator iter = files.begin(); + for (auto iter = files.begin(); iter != files.end(); ) { char link[64+1]; int link_len; diff --git a/utils/cec-follower/cec-follower.cpp b/utils/cec-follower/cec-follower.cpp index 9acdb305..673c6e31 100644 --- a/utils/cec-follower/cec-follower.cpp +++ b/utils/cec-follower/cec-follower.cpp @@ -277,7 +277,7 @@ int cec_named_ioctl(int fd, const char *name, name, retval, strerror(e)); if (!retval) { - const struct cec_msg *msg = static_cast(parm); + const auto msg = static_cast(parm); /* Update the timestamp whenever we successfully transmit to an LA, or whenever we receive something from the LA */ diff --git a/utils/rds-ctl/rds-ctl.cpp b/utils/rds-ctl/rds-ctl.cpp index e69a498d..12ec8bae 100644 --- a/utils/rds-ctl/rds-ctl.cpp +++ b/utils/rds-ctl/rds-ctl.cpp @@ -346,7 +346,7 @@ static dev_vec list_devices() /* Iterate through all devices, and remove all non-accessible devices * and all devices that don't offer the RDS_BLOCK_IO capability */ - for (dev_vec::iterator iter = files.begin(); + for (auto iter = files.begin(); iter != files.end();) { int fd = open(iter->c_str(), O_RDONLY | O_NONBLOCK); std::string bus_info; diff --git a/utils/v4l2-compliance/v4l2-compliance.cpp b/utils/v4l2-compliance/v4l2-compliance.cpp index 5f9996fb..fa941a14 100644 --- a/utils/v4l2-compliance/v4l2-compliance.cpp +++ b/utils/v4l2-compliance/v4l2-compliance.cpp @@ -900,11 +900,11 @@ static std::string make_devname(const char *device, const char *devname, return device; } - media_v2_entity *ents = new media_v2_entity[topology.num_entities]; + auto ents = new media_v2_entity[topology.num_entities]; topology.ptr_entities = (uintptr_t)ents; - media_v2_link *links = new media_v2_link[topology.num_links]; + auto links = new media_v2_link[topology.num_links]; topology.ptr_links = (uintptr_t)links; - media_v2_interface *ifaces = new media_v2_interface[topology.num_interfaces]; + auto ifaces = new media_v2_interface[topology.num_interfaces]; topology.ptr_interfaces = (uintptr_t)ifaces; unsigned i, ent_id, iface_id = 0; diff --git a/utils/v4l2-compliance/v4l2-test-buffers.cpp b/utils/v4l2-compliance/v4l2-test-buffers.cpp index d4b1eb8b..436de288 100644 --- a/utils/v4l2-compliance/v4l2-test-buffers.cpp +++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp @@ -1681,7 +1681,7 @@ int testUserPtr(struct node *node, struct node *node_m2m_cap, unsigned frame_cou for (unsigned p = 0; p < q.g_num_planes(); p++) { /* ensure that len is a multiple of 4 */ __u32 len = ((q.g_length(p) + 3) & ~0x3) + 4 * 4096; - __u32 *m = static_cast<__u32 *>(malloc(len)); + auto m = static_cast<__u32 *>(malloc(len)); fail_on_test(!m); fail_on_test((uintptr_t)m & 0x7); @@ -1740,7 +1740,7 @@ int testUserPtr(struct node *node, struct node *node_m2m_cap, unsigned frame_cou __u32 buflen = (q.g_length(p) + 3U) & ~3U; __u32 memlen = buflen + 4 * 4096; __u32 *m = buffers[i][p]; - __u32 *u = static_cast<__u32 *>(q.g_userptr(i, p)); + auto u = static_cast<__u32 *>(q.g_userptr(i, p)); for (__u32 *x = m; x < u; x++) if (*x != filler) @@ -2372,7 +2372,7 @@ public: private: static void *startRoutine(void *arg) { - BlockingThread *self = static_cast(arg); + auto self = static_cast(arg); pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp index ea026fd5..c8705a04 100644 --- a/utils/v4l2-ctl/v4l2-ctl-common.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp @@ -225,7 +225,7 @@ static void list_media_devices(const std::string &media_bus_info) return; } - media_v2_interface *ifaces = new media_v2_interface[topology.num_interfaces]; + auto ifaces = new media_v2_interface[topology.num_interfaces]; topology.ptr_interfaces = (uintptr_t)ifaces; if (!ioctl(media_fd, MEDIA_IOC_G_TOPOLOGY, &topology)) @@ -259,7 +259,7 @@ static void list_devices() closedir(dp); /* Find device nodes which are links to other device nodes */ - for (dev_vec::iterator iter = files.begin(); + for (auto iter = files.begin(); iter != files.end(); ) { char link[64+1]; int link_len; diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp index d986c7b6..0c384fe9 100644 --- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp @@ -1,3 +1,4 @@ +#include #include #include diff --git a/utils/v4l2-ctl/v4l2-ctl-vidcap.cpp b/utils/v4l2-ctl/v4l2-ctl-vidcap.cpp index 80312b51..5abab5e7 100644 --- a/utils/v4l2-ctl/v4l2-ctl-vidcap.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-vidcap.cpp @@ -366,7 +366,7 @@ void print_touch_buffer(FILE *f, cv4l_buffer &buf, cv4l_fmt &fmt, cv4l_queue &q) '.', ',', ':', ';', '!', '|', 'i', 'c', 'n', 'o', 'm', 'I', 'C', 'N', 'O', 'M', }; - __s16 *vbuf = static_cast<__s16 *>(q.g_dataptr(buf.g_index(), 0)); + auto vbuf = static_cast<__s16 *>(q.g_dataptr(buf.g_index(), 0)); __u32 x, y; switch (fmt.g_pixelformat()) { @@ -375,7 +375,7 @@ void print_touch_buffer(FILE *f, cv4l_buffer &buf, cv4l_fmt &fmt, cv4l_queue &q) fprintf(f, "TD16: "); for (x = 0; x < fmt.g_width(); x++, vbuf++) { - __s16 v = static_cast<__s16>(le16toh(*vbuf)); + auto v = static_cast<__s16>(le16toh(*vbuf)); if (!options[OptConcise]) fprintf(f, "% 4d", v); diff --git a/utils/v4l2-ctl/v4l2-ctl.cpp b/utils/v4l2-ctl/v4l2-ctl.cpp index 321d2d1c..a31b29f8 100644 --- a/utils/v4l2-ctl/v4l2-ctl.cpp +++ b/utils/v4l2-ctl/v4l2-ctl.cpp @@ -484,7 +484,7 @@ void printfmt(int fd, const struct v4l2_format &vfmt) } printf("\tClip Bitmap : %s", vfmt.fmt.win.bitmap ? "Yes, " : "No\n"); if (vfmt.fmt.win.bitmap) { - unsigned char *bitmap = static_cast(vfmt.fmt.win.bitmap); + auto bitmap = static_cast(vfmt.fmt.win.bitmap); unsigned stride = (vfmt.fmt.win.w.width + 7) / 8; unsigned cnt = 0; @@ -1056,11 +1056,11 @@ static const char *make_devname(const char *device, const char *devname, return device; } - media_v2_entity *ents = new media_v2_entity[topology.num_entities]; + auto ents = new media_v2_entity[topology.num_entities]; topology.ptr_entities = (uintptr_t)ents; - media_v2_link *links = new media_v2_link[topology.num_links]; + auto links = new media_v2_link[topology.num_links]; topology.ptr_links = (uintptr_t)links; - media_v2_interface *ifaces = new media_v2_interface[topology.num_interfaces]; + auto ifaces = new media_v2_interface[topology.num_interfaces]; topology.ptr_interfaces = (uintptr_t)ifaces; unsigned i, ent_id, iface_id = 0; From patchwork Mon Jul 27 03:14:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 11686293 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 444B4912 for ; Mon, 27 Jul 2020 03:15:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 29C802080C for ; Mon, 27 Jul 2020 03:15:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="e/ekYuEh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728017AbgG0DPD (ORCPT ); Sun, 26 Jul 2020 23:15:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728005AbgG0DPC (ORCPT ); Sun, 26 Jul 2020 23:15:02 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72957C0619D2 for ; Sun, 26 Jul 2020 20:15:02 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id x9so7282435plr.2 for ; Sun, 26 Jul 2020 20:15:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=62pANw/ml//RnU8vL+cJAWOPfu/VyBCsRu2W1LT4GIw=; b=e/ekYuEhEmBU7PxAie9b8+jpw6vqMbi7kn8+F1xLZlLUbZr9EUjwHhd+HUdYIWAYIa kPImGwBqBkY/0vuPkM01HZGqkz4MmcZn8E5AIIp8DgrVCjLWzoR6s+5VHSMaSkjG30Zx K+h72l4ntWVbeRurarnqFGnSjJh5flv5yMe/tWXr5Vwppopym5boLQIs8uc+BuDnzykL leuIhob1sI0MrU4cMZ0rjZ0uOp3q+JiQCLid25lWG5CSwrPRasgSHOfQHbqp3oUpQ3xK Emjol+xa9NQeUR8astK6hUMxw62MC6W1onwje0J18dNZA0sDoYw7B14PV7Vo8aRppOoQ QfFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=62pANw/ml//RnU8vL+cJAWOPfu/VyBCsRu2W1LT4GIw=; b=oDxHGlbTuq4XNu3zzPAZnLD3QTsHlVQ4BT1Msjvq8h/3KXbOEPK/Qax6W9N4Q6DnEg KFUlt2ixM8r4hRFsmhmgIGTsgGK5aLM0JYaZVq2zgWJE0CCdeP9YN+fpKorU+1Y1nl4H SN0Adqb92LlaXuD+DrMAWbYozUzUZBbP1tKiZh0bRhb8Ut4l3ouOfBagyrqNvHdvxt3H pqjjSfERP6yNEffBYxqGmiXiwpTkT8su7tamUDY1st32jLyPDH9z0mwyDY5rUISgbfua lZ0U80uY3m73L+9dtPF9CS6hvnb0fvh1QRGGvyOZAnfpC7TTnF6uwJEBpoglhnTR8f9p 3NyA== X-Gm-Message-State: AOAM532WfWKcpFmaN0A1p4KlOLgG9WPw3OHozMWviryNKdfnebig6fWb GnM86f7EVVhqrenrIehyiQDDOryC74c= X-Google-Smtp-Source: ABdhPJwhq0QZ2gre0xKg+7UPGb7iS6lmmlLbpt1dykQQQjceMG5s+DGefJ1DIEoHDxsappfqbsn6oQ== X-Received: by 2002:a17:902:ed14:: with SMTP id b20mr18253970pld.25.1595819701764; Sun, 26 Jul 2020 20:15:01 -0700 (PDT) Received: from mangix-trapnet.lan ([2001:470:1f05:79e::a89]) by smtp.gmail.com with ESMTPSA id t126sm13259345pfd.214.2020.07.26.20.15.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Jul 2020 20:15:00 -0700 (PDT) From: Rosen Penev To: linux-media@vger.kernel.org Subject: [PATCH 4/8] [clang-tidy] use using instead of typedef Date: Sun, 26 Jul 2020 20:14:52 -0700 Message-Id: <20200727031456.232955-5-rosenp@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200727031456.232955-1-rosenp@gmail.com> References: <20200727031456.232955-1-rosenp@gmail.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Found with modernize-use-using Signed-off-by: Rosen Penev --- utils/cec-ctl/cec-ctl.cpp | 4 ++-- utils/rds-ctl/rds-ctl.cpp | 2 +- utils/v4l2-compliance/v4l2-test-media.cpp | 2 +- utils/v4l2-ctl/v4l2-ctl-common.cpp | 14 +++++++------- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp index 8ae800bb..0cdab383 100644 --- a/utils/cec-ctl/cec-ctl.cpp +++ b/utils/cec-ctl/cec-ctl.cpp @@ -1749,8 +1749,8 @@ static __u16 parse_phys_addr_from_edid(const char *edid_path) return pa; } -typedef std::vector dev_vec; -typedef std::map dev_map; +using dev_vec = std::vector; +using dev_map = std::map; static void list_devices() { diff --git a/utils/rds-ctl/rds-ctl.cpp b/utils/rds-ctl/rds-ctl.cpp index 12ec8bae..f58c1fa2 100644 --- a/utils/rds-ctl/rds-ctl.cpp +++ b/utils/rds-ctl/rds-ctl.cpp @@ -39,7 +39,7 @@ #define ARRAY_SIZE(arr) ((int)(sizeof(arr) / sizeof((arr)[0]))) typedef std::vector dev_vec; -typedef std::map dev_map; +using dev_map = std::map; /* Short option list diff --git a/utils/v4l2-compliance/v4l2-test-media.cpp b/utils/v4l2-compliance/v4l2-test-media.cpp index f5101e33..acbee331 100644 --- a/utils/v4l2-compliance/v4l2-test-media.cpp +++ b/utils/v4l2-compliance/v4l2-test-media.cpp @@ -322,7 +322,7 @@ static media_link_desc link_disabled; int testMediaEnum(struct node *node) { - typedef std::map<__u32, media_entity_desc> entity_map; + using entity_map = std::map<__u32, media_entity_desc>; entity_map ent_map; id_set has_default_set; struct media_entity_desc ent; diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp index c8705a04..8ecfa972 100644 --- a/utils/v4l2-ctl/v4l2-ctl-common.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp @@ -34,22 +34,22 @@ struct ctrl_subset { typedef std::map > class2ctrls_map; -typedef std::map ctrl_qmap; +using ctrl_qmap = std::map; static ctrl_qmap ctrl_str2q; -typedef std::map ctrl_idmap; +using ctrl_idmap = std::map; static ctrl_idmap ctrl_id2str; -typedef std::map ctrl_subset_map; +using ctrl_subset_map = std::map; static ctrl_subset_map ctrl_subsets; -typedef std::list ctrl_get_list; +using ctrl_get_list = std::list; static ctrl_get_list get_ctrls; -typedef std::map ctrl_set_map; +using ctrl_set_map = std::map; static ctrl_set_map set_ctrls; -typedef std::vector dev_vec; -typedef std::map dev_map; +using dev_vec = std::vector; +using dev_map = std::map; static enum v4l2_priority prio = V4L2_PRIORITY_UNSET; From patchwork Mon Jul 27 03:14:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 11686295 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0FC616C1 for ; Mon, 27 Jul 2020 03:15:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DEE7320773 for ; Mon, 27 Jul 2020 03:15:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FE0W1qL5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728019AbgG0DPE (ORCPT ); Sun, 26 Jul 2020 23:15:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728005AbgG0DPD (ORCPT ); Sun, 26 Jul 2020 23:15:03 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D6E3C0619D2 for ; Sun, 26 Jul 2020 20:15:03 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id t15so8413727pjq.5 for ; Sun, 26 Jul 2020 20:15:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=WrFO6Uvp2AEddcqN+SoPz7E90iI+QyQjIXS0T8c3T14=; b=FE0W1qL5iuxA4zJEJ4px098YLqKPGzcRbkACPxMn5EWkFEbXD/jer52Yt9LZfwmNfY JWb1y8pQgTw0jE54p3INtIJNx+Li8pn++pcZmMXrJYJx29zMkL05lWMJAocZtQ3Tlwb/ PhGkOAUER3RaHhNWgvkUHdIaDiq3B9R5+Rl3lWaS7OFR2gYBSZCsIR8QgbBxbFl7Pyem 4kuzqPTrdMvg0OVQT9NxLydoOMfFb7ZWupET7JMW8KQXJfWQsJSLyXYT2pWEYyoF35NK hSUro8mTz5fBanrk/IFtqqYGRp7BdM7XNkKhHJ96/16lppJz09+RzTn314pzR+i2/Q1o xi9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WrFO6Uvp2AEddcqN+SoPz7E90iI+QyQjIXS0T8c3T14=; b=hXBeKveWi1sT4eN01SLhgYMdEfatnXUQzkIWX3JR2ILnK6U/r8isFBrPj//W3cVoaV 0xp5zjsyJYTaF7VESzDMMebt14t8eYcIblagsMG57EHM8H57xI66t46mzFmRbW7FWieZ B/7FtHnMvJCexfGKnhTwe/ipnqr1j6GGp3kImW+5YEalOSteWb2R/MB5CapuB+IWIPiZ O1oc3Af0UHndWQJZ+jtP6WQ9XIks9eqvItQbGfUe+vUfHGyjK5PFcMqcSqnYAB9cmbWg y0evr1D+rdwxGppZVtobnqo8KRYYx6vIiac2QUkKs1Bp5EKmc+aD/iMTRl5qeLKJOwGH hYaA== X-Gm-Message-State: AOAM532rlWfOTtH/hznEcUtbVsHmcFAPBafT5fzUxv+DiDWr9vdh+xdp JNuwHjD/Ft5rHqPHC2pO06MG2p8PhzE= X-Google-Smtp-Source: ABdhPJweYPFQ8jyaOuUHD4sTddHimksko44jUH8T8lor+mabqC9/mRoINRusV66eJD37D8jETxD0oQ== X-Received: by 2002:a17:902:d352:: with SMTP id l18mr18175758plk.56.1595819702757; Sun, 26 Jul 2020 20:15:02 -0700 (PDT) Received: from mangix-trapnet.lan ([2001:470:1f05:79e::a89]) by smtp.gmail.com with ESMTPSA id t126sm13259345pfd.214.2020.07.26.20.15.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Jul 2020 20:15:02 -0700 (PDT) From: Rosen Penev To: linux-media@vger.kernel.org Subject: [PATCH 5/8] [clang-tidy] use emplace_back Date: Sun, 26 Jul 2020 20:14:53 -0700 Message-Id: <20200727031456.232955-6-rosenp@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200727031456.232955-1-rosenp@gmail.com> References: <20200727031456.232955-1-rosenp@gmail.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Found with modernize-use-emplace Signed-off-by: Rosen Penev --- utils/v4l2-dbg/v4l2-dbg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/v4l2-dbg/v4l2-dbg.cpp b/utils/v4l2-dbg/v4l2-dbg.cpp index 8b23752a..c4a7b942 100644 --- a/utils/v4l2-dbg/v4l2-dbg.cpp +++ b/utils/v4l2-dbg/v4l2-dbg.cpp @@ -499,7 +499,7 @@ int main(int argc, char **argv) break; case OptGetRegister: - get_regs.push_back(optarg); + get_regs.emplace_back(optarg); break; case OptSetStride: From patchwork Mon Jul 27 03:14:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 11686297 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B8CA6722 for ; Mon, 27 Jul 2020 03:15:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9DC922076C for ; Mon, 27 Jul 2020 03:15:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SrS/rUrq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728020AbgG0DPF (ORCPT ); Sun, 26 Jul 2020 23:15:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728005AbgG0DPE (ORCPT ); Sun, 26 Jul 2020 23:15:04 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81901C0619D2 for ; Sun, 26 Jul 2020 20:15:04 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id gc9so8329847pjb.2 for ; Sun, 26 Jul 2020 20:15:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=uE6CSq3nUAPMkn1pPgsyKkDXvAyvil/3IWYm1Cfdltg=; b=SrS/rUrqFkIY7Xcpyscl9CFFXDMFpPfBy4RIA598zw5+MavANWbeUUKVBjZJ+yakLq LsWUOxoXjE50WIOyiJnHhpuQBSsOb3hlZtv5DOzZZFpNotCLczpmN0aWU8StP9YXFK7z UW8Il4+UmZ2neMGcFS4fsDLHxBFLE4dSnu3Zx6AKFWg9bDKWQ58qoCMlKkq3fBWDLiV+ 7b/DYmI4koZ4oMrrDhcIhfVp3l+maZ1y3GioHNWI1gWBHVu82JyzZ/PUkjOD5orOcL8s mHOW1JyMJsy/cxMEj5RUz6tOh1PYH/P3b2R1ovWyAczdY8G7+nBacLf2TPaJ9AOQ0cLg znjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uE6CSq3nUAPMkn1pPgsyKkDXvAyvil/3IWYm1Cfdltg=; b=PJVE0X8qFQ92hdXZHGha52wLay9VwfH0Z3fGFVr786z3gY9846MaJWcMQxkOtgkp2f oEPzktpOgZ+S0Ci9U2pJf9GZ2KMqgsgJ5w8quGx4TxL32219cyACMUQSMn100y1qBqFE fx2E3iUM5th/wbr9qQSaT1/yAWM0Hhm7erLs+TbE4kUjxZh0qBYAsxZAD+JaRSRQ9JBp LfK2nzIxwhmATkrtySC0p7HSCWI2/Y0X0CtuWsfCvElN1n3+t/GEhXwg/5rJhPDEn7o2 8139ky8iMK4HHwslt9Zuhtv0uTUFyyf1qk2Hz1RHfh/OnzSkvk442LuztY3dQd6Pl0tA WoHA== X-Gm-Message-State: AOAM531Z5NLbIa6DO5GixFvyaGVUy3nNAP4YUutrZ6mgG4akVtU4pnBR 5dEU3Fw2fZE2KApuLit+NZqzzjBAFoM= X-Google-Smtp-Source: ABdhPJwGrNybzyTYXGV8hdLSOhAlAXz2YDrGIVkOoOUih3+3+nDeKXvtM+DoBuwNiqC7gWjZH1nqbg== X-Received: by 2002:a17:902:9a47:: with SMTP id x7mr17043896plv.90.1595819703799; Sun, 26 Jul 2020 20:15:03 -0700 (PDT) Received: from mangix-trapnet.lan ([2001:470:1f05:79e::a89]) by smtp.gmail.com with ESMTPSA id t126sm13259345pfd.214.2020.07.26.20.15.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Jul 2020 20:15:03 -0700 (PDT) From: Rosen Penev To: linux-media@vger.kernel.org Subject: [PATCH 6/8] [clang-tidy] convert files to reference Date: Sun, 26 Jul 2020 20:14:54 -0700 Message-Id: <20200727031456.232955-7-rosenp@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200727031456.232955-1-rosenp@gmail.com> References: <20200727031456.232955-1-rosenp@gmail.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Found with performance-unnecessary-value-param Signed-off-by: Rosen Penev --- utils/rds-ctl/rds-ctl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/rds-ctl/rds-ctl.cpp b/utils/rds-ctl/rds-ctl.cpp index f58c1fa2..cabfa538 100644 --- a/utils/rds-ctl/rds-ctl.cpp +++ b/utils/rds-ctl/rds-ctl.cpp @@ -299,7 +299,7 @@ static bool is_radio_dev(const char *name) return !memcmp(name, "radio", 5); } -static void print_devices(dev_vec files) +static void print_devices(const dev_vec& files) { dev_map cards; int fd = -1; From patchwork Mon Jul 27 03:14:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 11686299 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 41534722 for ; Mon, 27 Jul 2020 03:15:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1891D2076C for ; Mon, 27 Jul 2020 03:15:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JPxmzxXb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728022AbgG0DPH (ORCPT ); Sun, 26 Jul 2020 23:15:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728005AbgG0DPG (ORCPT ); Sun, 26 Jul 2020 23:15:06 -0400 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EB2DC0619D2 for ; Sun, 26 Jul 2020 20:15:06 -0700 (PDT) Received: by mail-pf1-x432.google.com with SMTP id s26so8268034pfm.4 for ; Sun, 26 Jul 2020 20:15:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=9EMgT8/aP3c2ODsEnmnVzmUBZxFmZkvvzlesS9fKDh0=; b=JPxmzxXbJ2gB/LjwiV2RIk//7Ov5MMRJGilhoE/eAfJkDgLB2ut/27L/w6Fr/Bx9/V Xw8TMKJPCi7TTXbs7z2JZxtoWN+EUJQi9OCGkij+tJ3j7q1o/HuYNtL2EsIhqherV8wo mRf8/mPkLStjU5J4EF3eRjelFS/O+i0rAlr/8yA6jpnX21Nf6BDCJxcM7evObjnAgrFM cgX7rY3vgLr1UBMO7oB9amsZusbMvdTMib4ZRjYj2bRachS2+PSMqWt/FkPvYDLw/73H b2B2d0iggLDl8OmYobN6r1oQIf9US2xdPps0Kov6ykA91LRTwsiBhVZ5Rfdhgi2LULRr zNgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9EMgT8/aP3c2ODsEnmnVzmUBZxFmZkvvzlesS9fKDh0=; b=OGyxWRsl9BxKRiQvBlCMqFYRGZ7ngLeqq2wJTBtguUvcRnpfaj0nv+Xvamw4qjyRTs uFOo6DmlGZg3zsKIg/lphm46MDbPL1U0YmnYwpfDr4wboqtwrCcLSUzSJ37P9FANTomy ESYD226dz4pRAk3qJmxMfsfrGTHY8D/DkOfwPPA80yAtwsgyBsgA1Wsq0kKaxJ9CYwfm jxu7/FEX8ttkAgq2VQ6dKoPVPAddJto5rfTkOjplsrqSdqEfvpw/7p4yRY3F3mKUbKZP hJlBZ9Gn/LQUB6A3uWNB+Q0c9DIQymkBWaqP7Fhm6VyDiq2VbhZ9Qm7YmTYQuRNfmbKD k1zA== X-Gm-Message-State: AOAM532iMNuLBWehlZoaF6gGpDQrQzcXpuSqRdjDXlp4oMlL7npMEatn 6yrv84PWUWnW4R/EgLHkQG7ji/5u+pU= X-Google-Smtp-Source: ABdhPJycZc8xeFVCMD2WCeNGCIdrMesJsTFRh1NmPSJBwjydG0HeaYm0WR95VLdx+4GzTjao64LXJw== X-Received: by 2002:a63:fa15:: with SMTP id y21mr17855798pgh.339.1595819704923; Sun, 26 Jul 2020 20:15:04 -0700 (PDT) Received: from mangix-trapnet.lan ([2001:470:1f05:79e::a89]) by smtp.gmail.com with ESMTPSA id t126sm13259345pfd.214.2020.07.26.20.15.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Jul 2020 20:15:04 -0700 (PDT) From: Rosen Penev To: linux-media@vger.kernel.org Subject: [PATCH 7/8] [clang-tidy] fix mismatching declarations Date: Sun, 26 Jul 2020 20:14:55 -0700 Message-Id: <20200727031456.232955-8-rosenp@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200727031456.232955-1-rosenp@gmail.com> References: <20200727031456.232955-1-rosenp@gmail.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Found with readability-inconsistent-declaration-parameter-name Signed-off-by: Rosen Penev --- lib/include/libdvbv5/atsc_eit.h | 4 +- lib/include/libdvbv5/cat.h | 4 +- lib/include/libdvbv5/descriptors.h | 2 +- lib/include/libdvbv5/dvb-demux.h | 2 +- lib/include/libdvbv5/dvb-dev.h | 2 +- lib/include/libdvbv5/dvb-fe.h | 2 +- lib/include/libdvbv5/dvb-file.h | 4 +- lib/include/libdvbv5/dvb-scan.h | 16 +++---- lib/include/libdvbv5/eit.h | 4 +- lib/include/libdvbv5/header.h | 4 +- lib/include/libdvbv5/mgt.h | 4 +- lib/include/libdvbv5/mpeg_pes.h | 2 +- lib/include/libdvbv5/nit.h | 6 +-- lib/include/libdvbv5/pat.h | 4 +- lib/include/libdvbv5/pmt.h | 4 +- lib/include/libdvbv5/sdt.h | 4 +- lib/include/libdvbv5/vct.h | 4 +- lib/include/libv4l2.h | 2 +- lib/libdvbv5/parse_string.h | 2 +- lib/libv4lconvert/libv4lconvert-priv.h | 48 +++++++++---------- .../processing/libv4lprocessing.h | 2 +- lib/libv4lconvert/tinyjpeg.h | 2 +- utils/common/v4l-stream.h | 4 +- utils/keytable/bpf.h | 6 +-- utils/libcecutil/cec-log.cpp | 12 ++--- 25 files changed, 75 insertions(+), 75 deletions(-) diff --git a/lib/include/libdvbv5/atsc_eit.h b/lib/include/libdvbv5/atsc_eit.h index 5e52087c..18ae599d 100644 --- a/lib/include/libdvbv5/atsc_eit.h +++ b/lib/include/libdvbv5/atsc_eit.h @@ -192,7 +192,7 @@ ssize_t atsc_table_eit_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf, * * @param table pointer to struct atsc_table_eit to be freed */ -void atsc_table_eit_free(struct atsc_table_eit *table); +void atsc_table_eit_free(struct atsc_table_eit *eit); /** * @brief Prints the content of the ATSC EIT table @@ -202,7 +202,7 @@ void atsc_table_eit_free(struct atsc_table_eit *table); * @param table pointer to struct atsc_table_eit */ void atsc_table_eit_print(struct dvb_v5_fe_parms *parms, - struct atsc_table_eit *table); + struct atsc_table_eit *eit); /** * @brief Converts an ATSC EIT formatted timestamp into struct tm diff --git a/lib/include/libdvbv5/cat.h b/lib/include/libdvbv5/cat.h index 612c2c35..2e767ddc 100644 --- a/lib/include/libdvbv5/cat.h +++ b/lib/include/libdvbv5/cat.h @@ -88,7 +88,7 @@ ssize_t dvb_table_cat_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf, * * @param table pointer to struct dvb_table_cat to be freed */ -void dvb_table_cat_free(struct dvb_table_cat *table); +void dvb_table_cat_free(struct dvb_table_cat *cat); /** * @brief Prints the content of the CAT table @@ -97,7 +97,7 @@ void dvb_table_cat_free(struct dvb_table_cat *table); * @param table pointer to struct dvb_table_cat */ void dvb_table_cat_print(struct dvb_v5_fe_parms *parms, - struct dvb_table_cat *table); + struct dvb_table_cat *cat); #ifdef __cplusplus } diff --git a/lib/include/libdvbv5/descriptors.h b/lib/include/libdvbv5/descriptors.h index cb21470c..8f3900f2 100644 --- a/lib/include/libdvbv5/descriptors.h +++ b/lib/include/libdvbv5/descriptors.h @@ -157,7 +157,7 @@ uint32_t dvb_bcd(uint32_t bcd); * @param len Number of bytes to show */ void dvb_hexdump(struct dvb_v5_fe_parms *parms, const char *prefix, - const unsigned char *buf, int len); + const unsigned char *data, int len); /** * @brief parse MPEG-TS descriptors diff --git a/lib/include/libdvbv5/dvb-demux.h b/lib/include/libdvbv5/dvb-demux.h index 971c27f6..d3bc02a9 100644 --- a/lib/include/libdvbv5/dvb-demux.h +++ b/lib/include/libdvbv5/dvb-demux.h @@ -148,7 +148,7 @@ int dvb_set_section_filter(int dmxfd, int pid, unsigned filtsize, * * @warning This function currently assumes that the PAT fits into one session. */ -int dvb_get_pmt_pid(int dmxfd, int sid); +int dvb_get_pmt_pid(int patfd, int sid); #ifdef __cplusplus } diff --git a/lib/include/libdvbv5/dvb-dev.h b/lib/include/libdvbv5/dvb-dev.h index 2eeae516..5a9cc1a2 100644 --- a/lib/include/libdvbv5/dvb-dev.h +++ b/lib/include/libdvbv5/dvb-dev.h @@ -398,7 +398,7 @@ int dvb_dev_set_bufsize(struct dvb_open_descriptor *open_dev, */ int dvb_dev_dmx_set_pesfilter(struct dvb_open_descriptor *open_dev, int pid, dmx_pes_type_t type, - dmx_output_t output, int buffersize); + dmx_output_t output, int bufsize); /** * @brief Sets a MPEG-TS section filter diff --git a/lib/include/libdvbv5/dvb-fe.h b/lib/include/libdvbv5/dvb-fe.h index 96657013..4bd94108 100644 --- a/lib/include/libdvbv5/dvb-fe.h +++ b/lib/include/libdvbv5/dvb-fe.h @@ -732,7 +732,7 @@ int dvb_fe_is_satellite(uint32_t delivery_system); * "COUNTRY" property in dvb_fe_set_parm() overrides the setting. */ int dvb_fe_set_default_country(struct dvb_v5_fe_parms *parms, - const char *country); + const char *cc); #ifdef __cplusplus } diff --git a/lib/include/libdvbv5/dvb-file.h b/lib/include/libdvbv5/dvb-file.h index 1f1a6386..9c8c54d9 100644 --- a/lib/include/libdvbv5/dvb-file.h +++ b/lib/include/libdvbv5/dvb-file.h @@ -423,8 +423,8 @@ int dvb_retrieve_entry_prop(struct dvb_entry *entry, * @return Returns 0 if success, or, -1 if error. */ int dvb_store_channel(struct dvb_file **dvb_file, - struct dvb_v5_fe_parms *parms, - struct dvb_v5_descriptors *dvb_desc, + struct dvb_v5_fe_parms *__p, + struct dvb_v5_descriptors *dvb_scan_handler, int get_detected, int get_nit); /** diff --git a/lib/include/libdvbv5/dvb-scan.h b/lib/include/libdvbv5/dvb-scan.h index 2666d906..50846b98 100644 --- a/lib/include/libdvbv5/dvb-scan.h +++ b/lib/include/libdvbv5/dvb-scan.h @@ -222,7 +222,7 @@ int dvb_read_section(struct dvb_v5_fe_parms *parms, int dmx_fd, * This is a variant of dvb_read_section() that uses a struct dvb_table_filter * to specify the filter to use. */ -int dvb_read_sections(struct dvb_v5_fe_parms *parms, int dmx_fd, +int dvb_read_sections(struct dvb_v5_fe_parms *__p, int dmx_fd, struct dvb_table_filter *sect, unsigned timeout); @@ -265,7 +265,7 @@ void dvb_scan_free_handler_table(struct dvb_v5_descriptors *dvb_scan_handler); * On sucess, it returns a pointer to a struct dvb_v5_descriptors, that can * either be used to tune into a service or to be stored inside a file. */ -struct dvb_v5_descriptors *dvb_get_ts_tables(struct dvb_v5_fe_parms *parms, int dmx_fd, +struct dvb_v5_descriptors *dvb_get_ts_tables(struct dvb_v5_fe_parms *__p, int dmx_fd, uint32_t delivery_system, unsigned other_nit, unsigned timeout_multiply); @@ -337,7 +337,7 @@ typedef int (check_frontend_t)(void *args, struct dvb_v5_fe_parms *parms); * } * @endcode */ -struct dvb_v5_descriptors *dvb_scan_transponder(struct dvb_v5_fe_parms *parms, +struct dvb_v5_descriptors *dvb_scan_transponder(struct dvb_v5_fe_parms *__p, struct dvb_entry *entry, int dmx_fd, check_frontend_t *check_frontend, @@ -388,7 +388,7 @@ struct dvb_v5_descriptors *dvb_scan_transponder(struct dvb_v5_fe_parms *parms, * } * @endcode */ -void dvb_add_scaned_transponders(struct dvb_v5_fe_parms *parms, +void dvb_add_scaned_transponders(struct dvb_v5_fe_parms *__p, struct dvb_v5_descriptors *dvb_scan_handler, struct dvb_entry *first_entry, struct dvb_entry *entry); @@ -398,12 +398,12 @@ void dvb_add_scaned_transponders(struct dvb_v5_fe_parms *parms, * Some ancillary functions used internally inside the library, used to * identify duplicated transport streams and add new found transponder entries */ -int dvb_estimate_freq_shift(struct dvb_v5_fe_parms *parms); +int dvb_estimate_freq_shift(struct dvb_v5_fe_parms *__p); int dvb_new_freq_is_needed(struct dvb_entry *entry, struct dvb_entry *last_entry, uint32_t freq, enum dvb_sat_polarization pol, int shift); -struct dvb_entry *dvb_scan_add_entry(struct dvb_v5_fe_parms *parms, +struct dvb_entry *dvb_scan_add_entry(struct dvb_v5_fe_parms *__p, struct dvb_entry *first_entry, struct dvb_entry *entry, uint32_t freq, uint32_t shift, @@ -414,14 +414,14 @@ int dvb_new_entry_is_needed(struct dvb_entry *entry, uint32_t freq, int shift, enum dvb_sat_polarization pol, uint32_t stream_id); -struct dvb_entry *dvb_scan_add_entry_ex(struct dvb_v5_fe_parms *parms, +struct dvb_entry *dvb_scan_add_entry_ex(struct dvb_v5_fe_parms *__p, struct dvb_entry *first_entry, struct dvb_entry *entry, uint32_t freq, uint32_t shift, enum dvb_sat_polarization pol, uint32_t stream_id); -void dvb_update_transponders(struct dvb_v5_fe_parms *parms, +void dvb_update_transponders(struct dvb_v5_fe_parms *__p, struct dvb_v5_descriptors *dvb_scan_handler, struct dvb_entry *first_entry, struct dvb_entry *entry); diff --git a/lib/include/libdvbv5/eit.h b/lib/include/libdvbv5/eit.h index 9129861e..5510707b 100644 --- a/lib/include/libdvbv5/eit.h +++ b/lib/include/libdvbv5/eit.h @@ -197,7 +197,7 @@ ssize_t dvb_table_eit_init (struct dvb_v5_fe_parms *parms, const uint8_t *buf, * * @param table pointer to struct dvb_table_eit to be freed */ -void dvb_table_eit_free(struct dvb_table_eit *table); +void dvb_table_eit_free(struct dvb_table_eit *eit); /** * @brief Prints the content of the DVB EIT table @@ -207,7 +207,7 @@ void dvb_table_eit_free(struct dvb_table_eit *table); * @param table pointer to struct dvb_table_eit */ void dvb_table_eit_print(struct dvb_v5_fe_parms *parms, - struct dvb_table_eit *table); + struct dvb_table_eit *eit); /** * @brief Converts a DVB EIT formatted timestamp into struct tm diff --git a/lib/include/libdvbv5/header.h b/lib/include/libdvbv5/header.h index 2a459f9d..ccf67422 100644 --- a/lib/include/libdvbv5/header.h +++ b/lib/include/libdvbv5/header.h @@ -132,7 +132,7 @@ extern "C" { * * @param header pointer to struct dvb_table_header to be parsed */ -void dvb_table_header_init (struct dvb_table_header *header); +void dvb_table_header_init (struct dvb_table_header *t); /** * @brief Prints the content of the MPEG-TS table header * @ingroup dvb_table @@ -141,7 +141,7 @@ void dvb_table_header_init (struct dvb_table_header *header); * @param header pointer to struct dvb_table_header to be printed */ void dvb_table_header_print(struct dvb_v5_fe_parms *parms, - const struct dvb_table_header *header); + const struct dvb_table_header *t); #ifdef __cplusplus } diff --git a/lib/include/libdvbv5/mgt.h b/lib/include/libdvbv5/mgt.h index 7aa92d6c..62b5a7ab 100644 --- a/lib/include/libdvbv5/mgt.h +++ b/lib/include/libdvbv5/mgt.h @@ -168,7 +168,7 @@ ssize_t atsc_table_mgt_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf, * * @param table pointer to struct atsc_table_mgt to be freed */ -void atsc_table_mgt_free(struct atsc_table_mgt *table); +void atsc_table_mgt_free(struct atsc_table_mgt *mgt); /** * @brief Prints the content of the MGT table @@ -178,7 +178,7 @@ void atsc_table_mgt_free(struct atsc_table_mgt *table); * @param table pointer to struct atsc_table_mgt */ void atsc_table_mgt_print(struct dvb_v5_fe_parms *parms, - struct atsc_table_mgt *table); + struct atsc_table_mgt *mgt); #ifdef __cplusplus } diff --git a/lib/include/libdvbv5/mpeg_pes.h b/lib/include/libdvbv5/mpeg_pes.h index 9f214b26..b2b13584 100644 --- a/lib/include/libdvbv5/mpeg_pes.h +++ b/lib/include/libdvbv5/mpeg_pes.h @@ -228,7 +228,7 @@ ssize_t dvb_mpeg_pes_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf, ssi * If the pointer pes was allocated dynamically, this function * can be used to free the memory. */ -void dvb_mpeg_pes_free(struct dvb_mpeg_pes *pes); +void dvb_mpeg_pes_free(struct dvb_mpeg_pes *ts); /** * @brief Print details of struct dvb_mpeg_pes diff --git a/lib/include/libdvbv5/nit.h b/lib/include/libdvbv5/nit.h index f8e0e730..ef0f1bc1 100644 --- a/lib/include/libdvbv5/nit.h +++ b/lib/include/libdvbv5/nit.h @@ -221,7 +221,7 @@ ssize_t dvb_table_nit_init (struct dvb_v5_fe_parms *parms, const uint8_t *buf, * * @param table pointer to struct dvb_table_nit to be freed */ -void dvb_table_nit_free(struct dvb_table_nit *table); +void dvb_table_nit_free(struct dvb_table_nit *nit); /** * @brief Prints the content of the NIT table @@ -230,7 +230,7 @@ void dvb_table_nit_free(struct dvb_table_nit *table); * @param parms struct dvb_v5_fe_parms pointer to the opened device * @param table pointer to struct dvb_table_nit */ -void dvb_table_nit_print(struct dvb_v5_fe_parms *parms, struct dvb_table_nit *table); +void dvb_table_nit_print(struct dvb_v5_fe_parms *parms, struct dvb_table_nit *nit); /** * @brief For each entry at NIT and NIT transport tables, call a callback @@ -263,7 +263,7 @@ void dvb_table_nit_print(struct dvb_v5_fe_parms *parms, struct dvb_table_nit *ta */ void dvb_table_nit_descriptor_handler( struct dvb_v5_fe_parms *parms, - struct dvb_table_nit *table, + struct dvb_table_nit *nit, enum descriptors descriptor, nit_handler_callback_t *call_nit, nit_tran_handler_callback_t *call_tran, diff --git a/lib/include/libdvbv5/pat.h b/lib/include/libdvbv5/pat.h index bdf31ab5..9b1303a1 100644 --- a/lib/include/libdvbv5/pat.h +++ b/lib/include/libdvbv5/pat.h @@ -153,7 +153,7 @@ ssize_t dvb_table_pat_init (struct dvb_v5_fe_parms *parms, const uint8_t *buf, * * @param table pointer to struct dvb_table_pat to be freed */ -void dvb_table_pat_free(struct dvb_table_pat *table); +void dvb_table_pat_free(struct dvb_table_pat *pat); /** * @brief Prints the content of the PAT table @@ -163,7 +163,7 @@ void dvb_table_pat_free(struct dvb_table_pat *table); * @param table pointer to struct dvb_table_pat */ void dvb_table_pat_print(struct dvb_v5_fe_parms *parms, - struct dvb_table_pat *table); + struct dvb_table_pat *pat); #ifdef __cplusplus } diff --git a/lib/include/libdvbv5/pmt.h b/lib/include/libdvbv5/pmt.h index 5876c594..45ce88b0 100644 --- a/lib/include/libdvbv5/pmt.h +++ b/lib/include/libdvbv5/pmt.h @@ -281,7 +281,7 @@ ssize_t dvb_table_pmt_init (struct dvb_v5_fe_parms *parms, const uint8_t *buf, * * @param table pointer to struct dvb_table_pmt to be freed */ -void dvb_table_pmt_free(struct dvb_table_pmt *table); +void dvb_table_pmt_free(struct dvb_table_pmt *pmt); /** * @brief Prints the content of the PAT table @@ -291,7 +291,7 @@ void dvb_table_pmt_free(struct dvb_table_pmt *table); * @param table pointer to struct dvb_table_pmt */ void dvb_table_pmt_print(struct dvb_v5_fe_parms *parms, - const struct dvb_table_pmt *table); + const struct dvb_table_pmt *pmt); #ifdef __cplusplus } diff --git a/lib/include/libdvbv5/sdt.h b/lib/include/libdvbv5/sdt.h index 52fdf07f..1292f82d 100644 --- a/lib/include/libdvbv5/sdt.h +++ b/lib/include/libdvbv5/sdt.h @@ -169,7 +169,7 @@ ssize_t dvb_table_sdt_init (struct dvb_v5_fe_parms *parms, const uint8_t *buf, * * @param table pointer to struct dvb_table_sdt to be freed */ -void dvb_table_sdt_free(struct dvb_table_sdt *table); +void dvb_table_sdt_free(struct dvb_table_sdt *sdt); /** * @brief Prints the content of the SDT table @@ -178,7 +178,7 @@ void dvb_table_sdt_free(struct dvb_table_sdt *table); * @param parms struct dvb_v5_fe_parms pointer to the opened device * @param table pointer to struct dvb_table_sdt */ -void dvb_table_sdt_print(struct dvb_v5_fe_parms *parms, struct dvb_table_sdt *table); +void dvb_table_sdt_print(struct dvb_v5_fe_parms *parms, struct dvb_table_sdt *sdt); #ifdef __cplusplus } diff --git a/lib/include/libdvbv5/vct.h b/lib/include/libdvbv5/vct.h index 374c73a8..86c4728a 100644 --- a/lib/include/libdvbv5/vct.h +++ b/lib/include/libdvbv5/vct.h @@ -233,7 +233,7 @@ ssize_t atsc_table_vct_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf, * * @param table pointer to struct atsc_table_vct to be freed */ -void atsc_table_vct_free(struct atsc_table_vct *table); +void atsc_table_vct_free(struct atsc_table_vct *vct); /** * @brief Prints the content of the VCT table * @ingroup dvb_table @@ -242,7 +242,7 @@ void atsc_table_vct_free(struct atsc_table_vct *table); * @param table pointer to struct atsc_table_vct */ void atsc_table_vct_print(struct dvb_v5_fe_parms *parms, - struct atsc_table_vct *table); + struct atsc_table_vct *vct); #ifdef __cplusplus } diff --git a/lib/include/libv4l2.h b/lib/include/libv4l2.h index ea1870db..5c093067 100644 --- a/lib/include/libv4l2.h +++ b/lib/include/libv4l2.h @@ -64,7 +64,7 @@ LIBV4L_PUBLIC int v4l2_open(const char *file, int oflag, ...); LIBV4L_PUBLIC int v4l2_close(int fd); LIBV4L_PUBLIC int v4l2_dup(int fd); LIBV4L_PUBLIC int v4l2_ioctl(int fd, unsigned long int request, ...); -LIBV4L_PUBLIC ssize_t v4l2_read(int fd, void *buffer, size_t n); +LIBV4L_PUBLIC ssize_t v4l2_read(int fd, void *dest, size_t n); LIBV4L_PUBLIC ssize_t v4l2_write(int fd, const void *buffer, size_t n); LIBV4L_PUBLIC void *v4l2_mmap(void *start, size_t length, int prot, int flags, int fd, int64_t offset); diff --git a/lib/libdvbv5/parse_string.h b/lib/libdvbv5/parse_string.h index b0884bfb..86604bde 100644 --- a/lib/libdvbv5/parse_string.h +++ b/lib/libdvbv5/parse_string.h @@ -27,7 +27,7 @@ void dvb_iconv_to_charset(struct dvb_v5_fe_parms *parms, size_t destlen, const unsigned char *src, size_t len, - char *type, char *output_charset); + char *input_charset, char *output_charset); void dvb_parse_string(struct dvb_v5_fe_parms *parms, char **dest, char **emph, const unsigned char *src, size_t len); diff --git a/lib/libv4lconvert/libv4lconvert-priv.h b/lib/libv4lconvert/libv4lconvert-priv.h index ce5970c9..dd168424 100644 --- a/lib/libv4lconvert/libv4lconvert-priv.h +++ b/lib/libv4lconvert/libv4lconvert-priv.h @@ -117,43 +117,43 @@ int v4lconvert_oom_error(struct v4lconvert_data *data); void v4lconvert_rgb24_to_yuv420(const unsigned char *src, unsigned char *dest, const struct v4l2_format *src_fmt, int bgr, int yvu, int bpp); -void v4lconvert_yuv420_to_rgb24(const unsigned char *src, unsigned char *dst, +void v4lconvert_yuv420_to_rgb24(const unsigned char *src, unsigned char *dest, int width, int height, int yvu); -void v4lconvert_yuv420_to_bgr24(const unsigned char *src, unsigned char *dst, +void v4lconvert_yuv420_to_bgr24(const unsigned char *src, unsigned char *dest, int width, int height, int yvu); -void v4lconvert_yuyv_to_rgb24(const unsigned char *src, unsigned char *dst, +void v4lconvert_yuyv_to_rgb24(const unsigned char *src, unsigned char *dest, int width, int height, int stride); -void v4lconvert_yuyv_to_bgr24(const unsigned char *src, unsigned char *dst, +void v4lconvert_yuyv_to_bgr24(const unsigned char *src, unsigned char *dest, int width, int height, int stride); -void v4lconvert_yuyv_to_yuv420(const unsigned char *src, unsigned char *dst, +void v4lconvert_yuyv_to_yuv420(const unsigned char *src, unsigned char *dest, int width, int height, int stride, int yvu); void v4lconvert_nv16_to_yuyv(const unsigned char *src, unsigned char *dest, int width, int height); -void v4lconvert_yvyu_to_rgb24(const unsigned char *src, unsigned char *dst, +void v4lconvert_yvyu_to_rgb24(const unsigned char *src, unsigned char *dest, int width, int height, int stride); -void v4lconvert_yvyu_to_bgr24(const unsigned char *src, unsigned char *dst, +void v4lconvert_yvyu_to_bgr24(const unsigned char *src, unsigned char *dest, int width, int height, int stride); -void v4lconvert_uyvy_to_rgb24(const unsigned char *src, unsigned char *dst, +void v4lconvert_uyvy_to_rgb24(const unsigned char *src, unsigned char *dest, int width, int height, int stride); -void v4lconvert_uyvy_to_bgr24(const unsigned char *src, unsigned char *dst, +void v4lconvert_uyvy_to_bgr24(const unsigned char *src, unsigned char *dest, int width, int height, int stride); -void v4lconvert_uyvy_to_yuv420(const unsigned char *src, unsigned char *dst, +void v4lconvert_uyvy_to_yuv420(const unsigned char *src, unsigned char *dest, int width, int height, int stride, int yvu); void v4lconvert_swap_rgb(const unsigned char *src, unsigned char *dst, int width, int height); -void v4lconvert_swap_uv(const unsigned char *src, unsigned char *dst, +void v4lconvert_swap_uv(const unsigned char *src, unsigned char *dest, const struct v4l2_format *src_fmt); void v4lconvert_grey_to_rgb24(const unsigned char *src, unsigned char *dest, @@ -209,9 +209,9 @@ void v4lconvert_m420_to_yuv420(const unsigned char *src, int v4lconvert_cpia1_to_yuv420(struct v4lconvert_data *data, const unsigned char *src, int src_size, - unsigned char *dst, int width, int height, int yvu); + unsigned char *dest, int width, int height, int yvu); -void v4lconvert_sn9c20x_to_yuv420(const unsigned char *src, unsigned char *dst, +void v4lconvert_sn9c20x_to_yuv420(const unsigned char *raw, unsigned char *i420, int width, int height, int yvu); int v4lconvert_se401_to_rgb24(struct v4lconvert_data *data, @@ -226,13 +226,13 @@ int v4lconvert_decode_jpeg_libjpeg(struct v4lconvert_data *data, unsigned char *src, int src_size, unsigned char *dest, struct v4l2_format *fmt, unsigned int dest_pix_fmt); -int v4lconvert_decode_jpgl(const unsigned char *src, int src_size, - unsigned int dest_pix_fmt, unsigned char *dest, int width, int height); +int v4lconvert_decode_jpgl(const unsigned char *inp, int src_size, + unsigned int dest_pix_fmt, unsigned char *fb, int width, int height); -void v4lconvert_decode_spca561(const unsigned char *src, unsigned char *dst, +void v4lconvert_decode_spca561(const unsigned char *inbuf, unsigned char *outbuf, int width, int height); -void v4lconvert_decode_sn9c10x(const unsigned char *src, unsigned char *dst, +void v4lconvert_decode_sn9c10x(const unsigned char *inp, unsigned char *outp, int width, int height); int v4lconvert_decode_pac207(struct v4lconvert_data *data, @@ -240,7 +240,7 @@ int v4lconvert_decode_pac207(struct v4lconvert_data *data, int width, int height); int v4lconvert_decode_mr97310a(struct v4lconvert_data *data, - const unsigned char *src, int src_size, unsigned char *dst, + const unsigned char *inp, int src_size, unsigned char *outp, int width, int height); int v4lconvert_decode_jl2005bcd(struct v4lconvert_data *data, @@ -257,10 +257,10 @@ void v4lconvert_decode_stv0680(const unsigned char *src, unsigned char *dst, int width, int height); void v4lconvert_bayer_to_rgb24(const unsigned char *bayer, - unsigned char *rgb, int width, int height, const unsigned int stride, unsigned int pixfmt); + unsigned char *bgr, int width, int height, const unsigned int stride, unsigned int pixfmt); void v4lconvert_bayer_to_bgr24(const unsigned char *bayer, - unsigned char *rgb, int width, int height, const unsigned int stride, unsigned int pixfmt); + unsigned char *bgr, int width, int height, const unsigned int stride, unsigned int pixfmt); void v4lconvert_bayer_to_yuv420(const unsigned char *bayer, unsigned char *yuv, int width, int height, const unsigned int stride, unsigned int src_pixfmt, int yvu); @@ -275,13 +275,13 @@ void v4lconvert_bayer16_to_bayer8(unsigned char *bayer16, unsigned char *bayer8, int width, int height); void v4lconvert_hm12_to_rgb24(const unsigned char *src, - unsigned char *dst, int width, int height); + unsigned char *dest, int width, int height); void v4lconvert_hm12_to_bgr24(const unsigned char *src, - unsigned char *dst, int width, int height); + unsigned char *dest, int width, int height); void v4lconvert_hm12_to_yuv420(const unsigned char *src, - unsigned char *dst, int width, int height, int yvu); + unsigned char *dest, int width, int height, int yvu); void v4lconvert_hsv_to_rgb24(const unsigned char *src, unsigned char *dest, int width, int height, int bgr, int Xin, unsigned char hsv_enc); @@ -303,7 +303,7 @@ void v4lconvert_crop(unsigned char *src, unsigned char *dest, int v4lconvert_helper_decompress(struct v4lconvert_data *data, const char *helper, const unsigned char *src, int src_size, - unsigned char *dest, int dest_size, int width, int height, int command); + unsigned char *dest, int dest_size, int width, int height, int flags); void v4lconvert_helper_cleanup(struct v4lconvert_data *data); diff --git a/lib/libv4lconvert/processing/libv4lprocessing.h b/lib/libv4lconvert/processing/libv4lprocessing.h index d135a9d6..52184a7c 100644 --- a/lib/libv4lconvert/processing/libv4lprocessing.h +++ b/lib/libv4lconvert/processing/libv4lprocessing.h @@ -31,7 +31,7 @@ struct v4lprocessing_data; struct v4lcontrol_data; -struct v4lprocessing_data *v4lprocessing_create(int fd, struct v4lcontrol_data *data); +struct v4lprocessing_data *v4lprocessing_create(int fd, struct v4lcontrol_data *control); void v4lprocessing_destroy(struct v4lprocessing_data *data); /* Prepare to process 1 frame, returns 1 if processing is necesary, diff --git a/lib/libv4lconvert/tinyjpeg.h b/lib/libv4lconvert/tinyjpeg.h index ee61d234..857f833d 100644 --- a/lib/libv4lconvert/tinyjpeg.h +++ b/lib/libv4lconvert/tinyjpeg.h @@ -58,7 +58,7 @@ struct jdec_private *tinyjpeg_init(void); void tinyjpeg_free(struct jdec_private *priv); int tinyjpeg_parse_header(struct jdec_private *priv, const unsigned char *buf, unsigned int size); -int tinyjpeg_decode(struct jdec_private *priv, int pixel_format); +int tinyjpeg_decode(struct jdec_private *priv, int pixfmt); const char *tinyjpeg_get_errorstring(struct jdec_private *priv); void tinyjpeg_get_size(struct jdec_private *priv, unsigned int *width, unsigned int *height); int tinyjpeg_get_components(struct jdec_private *priv, unsigned char **components); diff --git a/utils/common/v4l-stream.h b/utils/common/v4l-stream.h index fe5dfe90..e6b6c27d 100644 --- a/utils/common/v4l-stream.h +++ b/utils/common/v4l-stream.h @@ -144,8 +144,8 @@ struct codec_ctx { u32 comp_max_size; }; -unsigned rle_compress(__u8 *buf, unsigned size, unsigned bytesperline); -void rle_decompress(__u8 *buf, unsigned size, unsigned rle_size, unsigned bytesperline); +unsigned rle_compress(__u8 *buf, unsigned size, unsigned bpl); +void rle_decompress(__u8 *buf, unsigned size, unsigned rle_size, unsigned bpl); struct codec_ctx *fwht_alloc(unsigned pixfmt, unsigned visible_width, unsigned visible_height, unsigned coded_width, unsigned coded_height, unsigned field, unsigned colorspace, unsigned xfer_func, unsigned ycbcr_enc, diff --git a/utils/keytable/bpf.h b/utils/keytable/bpf.h index fb3896c9..f09232cf 100644 --- a/utils/keytable/bpf.h +++ b/utils/keytable/bpf.h @@ -89,10 +89,10 @@ int bpf_map_delete_elem(int fd, const void *key); int bpf_map_get_next_key(int fd, const void *key, void *next_key); int bpf_obj_pin(int fd, const char *pathname); int bpf_obj_get(const char *pathname); -int bpf_prog_attach(int prog_fd, int attachable_fd, enum bpf_attach_type type, +int bpf_prog_attach(int prog_fd, int target_fd, enum bpf_attach_type type, unsigned int flags); -int bpf_prog_detach(int attachable_fd, enum bpf_attach_type type); -int bpf_prog_detach2(int prog_fd, int attachable_fd, enum bpf_attach_type type); +int bpf_prog_detach(int target_fd, enum bpf_attach_type type); +int bpf_prog_detach2(int prog_fd, int target_fd, enum bpf_attach_type type); int bpf_prog_test_run(int prog_fd, int repeat, void *data, __u32 size, void *data_out, __u32 *size_out, __u32 *retval, __u32 *duration); diff --git a/utils/libcecutil/cec-log.cpp b/utils/libcecutil/cec-log.cpp index 9410c071..56676431 100644 --- a/utils/libcecutil/cec-log.cpp +++ b/utils/libcecutil/cec-log.cpp @@ -102,12 +102,12 @@ static const struct cec_arg arg_rec_src_type = { }; static void log_digital(const char *arg_name, const struct cec_op_digital_service_id *digital); -static void log_rec_src(const char *arg_name, const struct cec_op_record_src *rec_src); -static void log_tuner_dev_info(const char *arg_name, const struct cec_op_tuner_device_info *tuner_dev_info); -static void log_features(const struct cec_arg *arg, const char *arg_name, const __u8 *p); -static void log_ui_command(const char *arg_name, const struct cec_op_ui_command *ui_cmd); -static void log_descriptors(const char *arg_name, unsigned num, const __u32 *descriptors); -static void log_u8_array(const char *arg_name, unsigned num, const __u8 *vals); +static void log_rec_src(const char *arg_string, const struct cec_op_record_src *rec_src); +static void log_tuner_dev_info(const char *arg_string, const struct cec_op_tuner_device_info *tuner_dev_info); +static void log_features(const struct cec_arg *arg, const char *arg_string, const __u8 *p); +static void log_ui_command(const char *arg_string, const struct cec_op_ui_command *ui_cmd); +static void log_descriptors(const char *arg_string, unsigned num, const __u32 *descriptors); +static void log_u8_array(const char *arg_string, unsigned num, const __u8 *vals); static void log_unknown_msg(const struct cec_msg *msg); static void log_htng_unknown_msg(const struct cec_msg *msg); From patchwork Mon Jul 27 03:14:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 11686301 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B2F526C1 for ; Mon, 27 Jul 2020 03:15:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 99F8720825 for ; Mon, 27 Jul 2020 03:15:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fflgwXAX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728028AbgG0DPH (ORCPT ); Sun, 26 Jul 2020 23:15:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728023AbgG0DPG (ORCPT ); Sun, 26 Jul 2020 23:15:06 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBDAEC0619D2 for ; Sun, 26 Jul 2020 20:15:06 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id d4so8589533pgk.4 for ; Sun, 26 Jul 2020 20:15:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=058a05WSROmXWJ/AwMplhMnH3n9F8IfxZ10fUqkg9F0=; b=fflgwXAXZdGNZSIiMEjeVoWABML3dVH5aLIrF/6zyrbAIzEP3PnJIdD34v8yUctIMc pqoc2SIH/QCBMJYbLgYmiTN/VxFiOkV7Id0kN0UEBefjOfsyA2RXhovp5NGpQ6Kw1ElY 7iQNzQX8Nogm+zKmyoZbuuM0li5sUSfQtkzAHHuBWHLHjk0jvpotoos68EFw/ESxqJyq hDFmWYtGbcR2H2EogjBZM0xWTs5M72dh7vwOulSFxb4vcjwWIu8bYgkRmhVFaWn5kPoN b+/3xx1Pfde08KuOtbDVe0+SB8egdlipSMBtyQmRERcFKDM/+Oe8nUiYDj0e1ZYoFGYu 8O5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=058a05WSROmXWJ/AwMplhMnH3n9F8IfxZ10fUqkg9F0=; b=fMwl3eR/J+aAINPjUUCKA0RJ1pJz2NEcVlNBGiapWZy5QY9yNm1/bbdlDHNTmneHi2 XR33FeCttfh5R9cy4yOypjy+KsrJYmG2Z5ER2mxxyw4EOx0aPEpR8scgbgIzDkkF4xR8 cR67LGrEXSTX84Q+JLeIvB48fGnKG8vzsxD5No03wioX6Y9e7cJmDaitiIQ1hy2YWxHR KyNfkPCmvoEAwtiowYQ4uQSzK13S4EE3zohAmJgHUEX/rxpKP/D8IKYwCPWtE1mNmDfG m1pp0z3cIUXYD2mbQc7r5sFsOwdbkJ0e4tgBpOsUqlgZ0iTief/FUlIhTGk/gl3WGyNh 0s7A== X-Gm-Message-State: AOAM532fkvDdQoBiGI3YsCRZkUkhKt8h+lRVYsAfOauqwJpVST/aUCDg 3weqlQrUAH5QLIek2H3UwsJkQU3hYMU= X-Google-Smtp-Source: ABdhPJx3RZU6cJTBbtnRPkSbGFHNMQbNAlFWy7ZS0/gE69jzZPs+1aeOB86hFWfLVqTm7cfdlQvDbA== X-Received: by 2002:a63:e24d:: with SMTP id y13mr18301093pgj.248.1595819705900; Sun, 26 Jul 2020 20:15:05 -0700 (PDT) Received: from mangix-trapnet.lan ([2001:470:1f05:79e::a89]) by smtp.gmail.com with ESMTPSA id t126sm13259345pfd.214.2020.07.26.20.15.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Jul 2020 20:15:05 -0700 (PDT) From: Rosen Penev To: linux-media@vger.kernel.org Subject: [PATCH 8/8] [clang-tidy] use explicit for single argument constructors Date: Sun, 26 Jul 2020 20:14:56 -0700 Message-Id: <20200727031456.232955-9-rosenp@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200727031456.232955-1-rosenp@gmail.com> References: <20200727031456.232955-1-rosenp@gmail.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Found with google-explicit-constructor Signed-off-by: Rosen Penev --- utils/v4l2-compliance/v4l2-test-buffers.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/v4l2-compliance/v4l2-test-buffers.cpp b/utils/v4l2-compliance/v4l2-test-buffers.cpp index 436de288..5df71b80 100644 --- a/utils/v4l2-compliance/v4l2-test-buffers.cpp +++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp @@ -218,11 +218,11 @@ static bool fill_output_buffer(const cv4l_queue &q, cv4l_buffer &buf, bool first class buffer : public cv4l_buffer { public: - buffer(unsigned type = 0, unsigned memory = 0, unsigned index = 0) : + explicit buffer(unsigned type = 0, unsigned memory = 0, unsigned index = 0) : cv4l_buffer(type, memory, index) {} - buffer(const cv4l_queue &q, unsigned index = 0) : + explicit buffer(const cv4l_queue &q, unsigned index = 0) : cv4l_buffer(q, index) {} - buffer(const cv4l_buffer &b) : cv4l_buffer(b) {} + explicit buffer(const cv4l_buffer &b) : cv4l_buffer(b) {} int querybuf(node *node, unsigned index) {