@@ -2309,7 +2309,7 @@ int main(int argc, char **argv)
return 1;
}
- if (msgs.size())
+ if (!msgs.empty())
warn_if_unconfigured = true;
if (store_pin && analyze_pin) {
@@ -992,7 +992,7 @@ int main(int argc, char **argv)
if (!params.options[OptSetDevice]) {
/* check the system for RDS capable devices */
dev_vec devices = list_devices();
- if (devices.size() == 0) {
+ if (devices.empty()) {
fprintf(stderr, "No RDS-capable device found\n");
exit(1);
}
@@ -1007,7 +1007,7 @@ void common_set(cv4l_fd &_fd)
}
continue;
}
- if (iter->second.size()) {
+ if (!iter->second.empty()) {
ctrls.which = iter->first;
ctrls.count = iter->second.size();
ctrls.controls = &iter->second[0];
@@ -1133,7 +1133,7 @@ void common_get(cv4l_fd &_fd)
}
continue;
}
- if (iter->second.size()) {
+ if (!iter->second.empty()) {
ctrls.which = iter->first;
ctrls.count = iter->second.size();
ctrls.controls = &iter->second[0];
@@ -395,9 +395,9 @@ static void do_try_set_overlay(struct v4l2_format &fmt, int fd)
if (((set_overlay_fmt & FmtWidth) && win.w.width != overlay_fmt.fmt.win.w.width) ||
((set_overlay_fmt & FmtHeight) && win.w.height != overlay_fmt.fmt.win.w.height))
keep_old_bitmap = keep_old_clip = false;
- if (options[OptClearBitmap] || bitmap_rects.size())
+ if (options[OptClearBitmap] || !bitmap_rects.empty())
keep_old_bitmap = false;
- if (options[OptClearClips] || clips.size())
+ if (options[OptClearClips] || !clips.empty())
keep_old_clip = false;
win.bitmap = NULL;
@@ -428,11 +428,11 @@ static void do_try_set_overlay(struct v4l2_format &fmt, int fd)
win.w.height = overlay_fmt.fmt.win.w.height;
if (set_overlay_fmt & FmtField)
win.field = overlay_fmt.fmt.win.field;
- if (clips.size()) {
+ if (!clips.empty()) {
win.clipcount = clips.size();
win.clips = &clips[0];
}
- if (bitmap_rects.size()) {
+ if (!bitmap_rects.empty()) {
free(bitmap);
stride = (win.w.width + 7) / 8;
bitmap = (unsigned char *)calloc(1, stride * win.w.height);
@@ -471,7 +471,7 @@ void overlay_set(cv4l_fd &_fd)
if ((options[OptSetOverlayFormat] || options[OptTryOverlayFormat]) &&
(set_overlay_fmt || options[OptClearClips] || options[OptClearBitmap] ||
- bitmap_rects.size() || clips.size())) {
+ !bitmap_rects.empty() || !clips.empty())) {
struct v4l2_format fmt;
memset(&fmt, 0, sizeof(fmt));
Found with clang-tidy's readability-container-size-empty Signed-off-by: Rosen Penev <rosenp@gmail.com> --- utils/cec-ctl/cec-ctl.cpp | 2 +- utils/rds-ctl/rds-ctl.cpp | 2 +- utils/v4l2-ctl/v4l2-ctl-common.cpp | 4 ++-- utils/v4l2-ctl/v4l2-ctl-overlay.cpp | 10 +++++----- 4 files changed, 9 insertions(+), 9 deletions(-)