diff options
author | Rosen Penev <rosenp@gmail.com> | 2020-09-19 19:49:57 -0700 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2020-10-03 12:47:47 +0200 |
commit | eaf47d3d5446545eac9b4c62025a19e7cef717ae (patch) | |
tree | 9583c48dead54be80ee4ecf97ededbae8739df9c | |
parent | 4736edbed8fb012951bf3f5f7ef4d9135fbf7622 (diff) |
cppcheck: turn several references to const
Found with constParameter
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil: fix qvidcap changes]
-rw-r--r-- | utils/cec-ctl/cec-ctl.cpp | 18 | ||||
-rw-r--r-- | utils/qvidcap/capture.cpp | 4 | ||||
-rw-r--r-- | utils/qvidcap/capture.h | 4 | ||||
-rw-r--r-- | utils/v4l2-compliance/v4l2-test-controls.cpp | 4 | ||||
-rw-r--r-- | utils/v4l2-ctl/v4l2-ctl-selection.cpp | 4 | ||||
-rw-r--r-- | utils/v4l2-ctl/v4l2-ctl-streaming.cpp | 4 |
6 files changed, 19 insertions, 19 deletions
diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp index 8fe1c528..2ee88ec9 100644 --- a/utils/cec-ctl/cec-ctl.cpp +++ b/utils/cec-ctl/cec-ctl.cpp @@ -791,7 +791,7 @@ static void show_msg(const cec_msg &msg) status.c_str()); } -static void wait_for_msgs(struct node &node, __u32 monitor_time) +static void wait_for_msgs(const struct node &node, __u32 monitor_time) { fd_set rd_fds; fd_set ex_fds; @@ -836,7 +836,7 @@ static void wait_for_msgs(struct node &node, __u32 monitor_time) #define MONITOR_FL_DROPPED_EVENTS (1 << 16) -static void monitor(struct node &node, __u32 monitor_time, const char *store_pin) +static void monitor(const struct node &node, __u32 monitor_time, const char *store_pin) { __u32 monitor = CEC_MODE_MONITOR; fd_set rd_fds; @@ -1057,7 +1057,7 @@ err: std::exit(EXIT_FAILURE); } -static bool wait_for_pwr_state(struct node &node, unsigned from, +static bool wait_for_pwr_state(const struct node &node, unsigned from, unsigned &hpd_is_low_cnt, bool on) { struct cec_msg msg; @@ -1116,18 +1116,18 @@ static bool wait_for_pwr_state(struct node &node, unsigned from, return pwr == (on ? CEC_OP_POWER_STATUS_ON : CEC_OP_POWER_STATUS_STANDBY); } -static bool wait_for_power_on(struct node &node, unsigned from) +static bool wait_for_power_on(const struct node &node, unsigned from) { unsigned hpd_is_low_cnt = 0; return wait_for_pwr_state(node, from, hpd_is_low_cnt, true); } -static bool wait_for_power_off(struct node &node, unsigned from, unsigned &hpd_is_low_cnt) +static bool wait_for_power_off(const struct node &node, unsigned from, unsigned &hpd_is_low_cnt) { return wait_for_pwr_state(node, from, hpd_is_low_cnt, false); } -static int transmit_msg_retry(struct node &node, struct cec_msg &msg) +static int transmit_msg_retry(const struct node &node, struct cec_msg &msg) { bool from_unreg = cec_msg_initiator(&msg) == CEC_LOG_ADDR_UNREGISTERED; unsigned cnt = 0; @@ -1144,7 +1144,7 @@ static int transmit_msg_retry(struct node &node, struct cec_msg &msg) return ret; } -static int init_power_cycle_test(struct node &node, unsigned repeats, unsigned max_tries) +static int init_power_cycle_test(const struct node &node, unsigned repeats, unsigned max_tries) { struct cec_msg msg; unsigned from; @@ -1261,7 +1261,7 @@ static int init_power_cycle_test(struct node &node, unsigned repeats, unsigned m return from; } -static void test_power_cycle(struct node &node, unsigned int max_tries, +static void test_power_cycle(const struct node &node, unsigned int max_tries, unsigned int retry_sleep) { struct cec_log_addrs laddrs = { }; @@ -1476,7 +1476,7 @@ static void test_power_cycle(struct node &node, unsigned int max_tries, printf("Test had %u failure%s\n", failures, failures == 1 ? "" : "s"); } -static void stress_test_power_cycle(struct node &node, unsigned cnt, +static void stress_test_power_cycle(const struct node &node, unsigned cnt, unsigned min_sleep, unsigned max_sleep, unsigned max_tries, bool has_seed, unsigned seed, unsigned repeats, double sleep_before_on, double sleep_before_off) diff --git a/utils/qvidcap/capture.cpp b/utils/qvidcap/capture.cpp index 556e35e4..cfcbb896 100644 --- a/utils/qvidcap/capture.cpp +++ b/utils/qvidcap/capture.cpp @@ -543,7 +543,7 @@ void CaptureWin::mouseDoubleClickEvent(QMouseEvent * e) toggleFullScreen(); } -void CaptureWin::cycleMenu(__u32 &overrideVal, __u32 &origVal, +void CaptureWin::cycleMenu(__u32 &overrideVal, __u32 origVal, const __u32 values[], bool hasShift, bool hasCtrl) { unsigned i; @@ -1106,7 +1106,7 @@ bool CaptureWin::setV4LFormat(cv4l_fmt &fmt) return true; } -void CaptureWin::setPixelAspect(v4l2_fract &pixelaspect) +void CaptureWin::setPixelAspect(const v4l2_fract &pixelaspect) { m_pixelaspect = pixelaspect; } diff --git a/utils/qvidcap/capture.h b/utils/qvidcap/capture.h index a6debb47..37f5bfc5 100644 --- a/utils/qvidcap/capture.h +++ b/utils/qvidcap/capture.h @@ -78,7 +78,7 @@ public: void setModeTest(unsigned cnt); void setQueue(cv4l_queue *q); bool setV4LFormat(cv4l_fmt &fmt); - void setPixelAspect(v4l2_fract &pixelaspect); + void setPixelAspect(const v4l2_fract &pixelaspect); bool updateV4LFormat(const cv4l_fmt &fmt); void setOverrideWidth(__u32 w); void setOverrideHeight(__u32 h); @@ -130,7 +130,7 @@ private: void listenForNewConnection(); int read_u32(__u32 &v); void showCurrentOverrides(); - void cycleMenu(__u32 &overrideVal, __u32 &origVal, + void cycleMenu(__u32 &overrideVal, __u32 origVal, const __u32 values[], bool hasShift, bool hasCtrl); bool supportedFmt(__u32 fmt); diff --git a/utils/v4l2-compliance/v4l2-test-controls.cpp b/utils/v4l2-compliance/v4l2-test-controls.cpp index fcc42cdf..4faa538f 100644 --- a/utils/v4l2-compliance/v4l2-test-controls.cpp +++ b/utils/v4l2-compliance/v4l2-test-controls.cpp @@ -345,7 +345,7 @@ int testQueryControls(struct node *node) return 0; } -static int checkSimpleCtrl(struct v4l2_control &ctrl, struct test_query_ext_ctrl &qctrl) +static int checkSimpleCtrl(const struct v4l2_control &ctrl, const struct test_query_ext_ctrl &qctrl) { if (ctrl.id != qctrl.id) return fail("control id mismatch\n"); @@ -524,7 +524,7 @@ int testSimpleControls(struct node *node) return 0; } -static int checkExtendedCtrl(struct v4l2_ext_control &ctrl, struct test_query_ext_ctrl &qctrl) +static int checkExtendedCtrl(const struct v4l2_ext_control &ctrl, const struct test_query_ext_ctrl &qctrl) { int len; diff --git a/utils/v4l2-ctl/v4l2-ctl-selection.cpp b/utils/v4l2-ctl/v4l2-ctl-selection.cpp index 1665607e..c4ede272 100644 --- a/utils/v4l2-ctl/v4l2-ctl-selection.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-selection.cpp @@ -69,7 +69,7 @@ void selection_usage() ); } -static void do_crop(int fd, unsigned int set_crop, struct v4l2_rect &vcrop, v4l2_buf_type type) +static void do_crop(int fd, unsigned int set_crop, const struct v4l2_rect &vcrop, v4l2_buf_type type) { struct v4l2_crop in_crop; @@ -125,7 +125,7 @@ static void parse_crop(char *optarg, unsigned int &set_crop, v4l2_rect &vcrop) } } -static void do_selection(int fd, unsigned int set_selection, struct v4l2_selection &vsel, +static void do_selection(int fd, unsigned int set_selection, const struct v4l2_selection &vsel, v4l2_buf_type type) { struct v4l2_selection in_selection; diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp index 04af717e..0f34b3e6 100644 --- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp @@ -2211,7 +2211,7 @@ static int capture_setup(cv4l_fd &fd, cv4l_queue &in, cv4l_fd *exp_fd, cv4l_fmt static void stateful_m2m(cv4l_fd &fd, cv4l_queue &in, cv4l_queue &out, FILE *fin, FILE *fout, cv4l_fmt &fmt_in, - cv4l_fmt &fmt_out, cv4l_fd *exp_fd_p) + const cv4l_fmt &fmt_out, cv4l_fd *exp_fd_p) { int fd_flags = fcntl(fd.g_fd(), F_GETFL); fps_timestamps fps_ts[2]; @@ -2411,7 +2411,7 @@ static void stateful_m2m(cv4l_fd &fd, cv4l_queue &in, cv4l_queue &out, static void stateless_m2m(cv4l_fd &fd, cv4l_queue &in, cv4l_queue &out, FILE *fin, FILE *fout, cv4l_fmt &fmt_in, - cv4l_fmt &fmt_out, cv4l_fd *exp_fd_p) + const cv4l_fmt &fmt_out, cv4l_fd *exp_fd_p) { fps_timestamps fps_ts[2]; unsigned count[2] = { 0, 0 }; |