[PATCH 2/2] clang-tidy: add a bunch of const

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Found with cppcoreguidelines-interfaces-global-init

Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>
---
 lib/libv4lconvert/processing/autogain.c              | 2 +-
 lib/libv4lconvert/processing/gamma.c                 | 2 +-
 lib/libv4lconvert/processing/libv4lprocessing-priv.h | 6 +++---
 lib/libv4lconvert/processing/libv4lprocessing.c      | 2 +-
 lib/libv4lconvert/processing/whitebalance.c          | 2 +-
 utils/cec-compliance/cec-test.cpp                    | 2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/lib/libv4lconvert/processing/autogain.c b/lib/libv4lconvert/processing/autogain.c
index 7b4f91f7c..aef06b057 100644
--- a/lib/libv4lconvert/processing/autogain.c
+++ b/lib/libv4lconvert/processing/autogain.c
@@ -213,6 +213,6 @@ static int autogain_calculate_lookup_tables(
 	return 0;
 }
 
-struct v4lprocessing_filter autogain_filter = {
+const struct v4lprocessing_filter autogain_filter = {
 	autogain_active, autogain_calculate_lookup_tables
 };
diff --git a/lib/libv4lconvert/processing/gamma.c b/lib/libv4lconvert/processing/gamma.c
index 73129637e..d65068f03 100644
--- a/lib/libv4lconvert/processing/gamma.c
+++ b/lib/libv4lconvert/processing/gamma.c
@@ -57,6 +57,6 @@ static int gamma_calculate_lookup_tables(
 	return 1;
 }
 
-struct v4lprocessing_filter gamma_filter = {
+const struct v4lprocessing_filter gamma_filter = {
 	gamma_active, gamma_calculate_lookup_tables
 };
diff --git a/lib/libv4lconvert/processing/libv4lprocessing-priv.h b/lib/libv4lconvert/processing/libv4lprocessing-priv.h
index e4a29dd92..9f0b74934 100644
--- a/lib/libv4lconvert/processing/libv4lprocessing-priv.h
+++ b/lib/libv4lconvert/processing/libv4lprocessing-priv.h
@@ -61,8 +61,8 @@ struct v4lprocessing_filter {
 			unsigned char *buf, const struct v4l2_format *fmt);
 };
 
-extern struct v4lprocessing_filter whitebalance_filter;
-extern struct v4lprocessing_filter autogain_filter;
-extern struct v4lprocessing_filter gamma_filter;
+extern const struct v4lprocessing_filter whitebalance_filter;
+extern const struct v4lprocessing_filter autogain_filter;
+extern const struct v4lprocessing_filter gamma_filter;
 
 #endif
diff --git a/lib/libv4lconvert/processing/libv4lprocessing.c b/lib/libv4lconvert/processing/libv4lprocessing.c
index b061f5041..cbe5a8393 100644
--- a/lib/libv4lconvert/processing/libv4lprocessing.c
+++ b/lib/libv4lconvert/processing/libv4lprocessing.c
@@ -27,7 +27,7 @@
 #include "libv4lprocessing-priv.h"
 #include "../libv4lconvert-priv.h" /* for PIX_FMT defines */
 
-static struct v4lprocessing_filter *filters[] = {
+static const struct v4lprocessing_filter *filters[] = {
 	&whitebalance_filter,
 	&autogain_filter,
 	&gamma_filter,
diff --git a/lib/libv4lconvert/processing/whitebalance.c b/lib/libv4lconvert/processing/whitebalance.c
index c74069ae2..367dcb7ff 100644
--- a/lib/libv4lconvert/processing/whitebalance.c
+++ b/lib/libv4lconvert/processing/whitebalance.c
@@ -205,6 +205,6 @@ static int whitebalance_calculate_lookup_tables(
 	return 0; /* Should never happen */
 }
 
-struct v4lprocessing_filter whitebalance_filter = {
+const struct v4lprocessing_filter whitebalance_filter = {
 	whitebalance_active, whitebalance_calculate_lookup_tables
 };
diff --git a/utils/cec-compliance/cec-test.cpp b/utils/cec-compliance/cec-test.cpp
index 8633171a0..8a9ea2afe 100644
--- a/utils/cec-compliance/cec-test.cpp
+++ b/utils/cec-compliance/cec-test.cpp
@@ -1414,7 +1414,7 @@ static struct remote_subtest post_test_subtests[] = {
 };
 
 
-static struct remote_test tests[] = {
+static const struct remote_test tests[] = {
 	test_case("Core",
 		  TAG_CORE,
 		  core_subtests),
-- 
2.26.2




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux