summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2022-09-02 16:12:58 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-09-06 16:54:34 +0000
commitb33b5ce85b0da2c14fbb281ff16253944e6ca19d (patch)
treeafcbe6f62159d0c02cfa02736d08c5ba73daffaf
parent061374491d40a654a3f2ddf903840b903430838e (diff)
downloadchrome-ec-b33b5ce85b0da2c14fbb281ff16253944e6ca19d.tar.gz
fpsensor: Remove nested designators for C++ compatibility
When compiling these files as C++, a warning is emitted: nested designators are a C99 extension [-Werror,-Wc99-designator] .deadline.val = 0, ^~~~~~~~~~~~~ BRANCH=none BUG=b:234181908 TEST=./util/compare_build.sh -b fp => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I68945ee33290d4416cf1b948cdb6e5e90c7da34b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3872808 Reviewed-by: Bobby Casey <bobbycasey@google.com>
-rw-r--r--common/fpsensor/fpsensor_state.c11
-rw-r--r--test/fpsensor_crypto.c22
2 files changed, 18 insertions, 15 deletions
diff --git a/common/fpsensor/fpsensor_state.c b/common/fpsensor/fpsensor_state.c
index 0686fb2fa9..0b9bf7e5a8 100644
--- a/common/fpsensor/fpsensor_state.c
+++ b/common/fpsensor/fpsensor_state.c
@@ -32,11 +32,12 @@ uint8_t fp_enc_buffer[FP_ALGORITHM_ENCRYPTED_TEMPLATE_SIZE] FP_TEMPLATE_SECTION;
uint8_t fp_positive_match_salt[FP_MAX_FINGER_COUNT]
[FP_POSITIVE_MATCH_SALT_BYTES];
-struct positive_match_secret_state positive_match_secret_state = {
- .template_matched = FP_NO_SUCH_TEMPLATE,
- .readable = false,
- .deadline.val = 0,
-};
+struct positive_match_secret_state
+ positive_match_secret_state = { .template_matched = FP_NO_SUCH_TEMPLATE,
+ .readable = false,
+ .deadline = {
+ .val = 0,
+ } };
/* Index of the last enrolled but not retrieved template. */
int8_t template_newly_enrolled = FP_NO_SUCH_TEMPLATE;
diff --git a/test/fpsensor_crypto.c b/test/fpsensor_crypto.c
index b912acd7d1..df1806e108 100644
--- a/test/fpsensor_crypto.c
+++ b/test/fpsensor_crypto.c
@@ -582,11 +582,12 @@ static int test_enable_positive_match_secret_once(
test_static int test_enable_positive_match_secret(void)
{
- struct positive_match_secret_state dumb_state = {
- .template_matched = FP_NO_SUCH_TEMPLATE,
- .readable = false,
- .deadline.val = 0,
- };
+ struct positive_match_secret_state
+ dumb_state = { .template_matched = FP_NO_SUCH_TEMPLATE,
+ .readable = false,
+ .deadline = {
+ .val = 0,
+ } };
TEST_ASSERT(test_enable_positive_match_secret_once(&dumb_state) ==
EC_SUCCESS);
@@ -603,11 +604,12 @@ test_static int test_enable_positive_match_secret(void)
test_static int test_disable_positive_match_secret(void)
{
- struct positive_match_secret_state dumb_state = {
- .template_matched = FP_NO_SUCH_TEMPLATE,
- .readable = false,
- .deadline.val = 0,
- };
+ struct positive_match_secret_state
+ dumb_state = { .template_matched = FP_NO_SUCH_TEMPLATE,
+ .readable = false,
+ .deadline = {
+ .val = 0,
+ } };
TEST_ASSERT(test_enable_positive_match_secret_once(&dumb_state) ==
EC_SUCCESS);