aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2021-06-12 11:37:53 +0200
committerHans Verkuil <hans.verkuil@cisco.com>2021-06-12 11:43:20 +0200
commit26f9554fb9d2560ffc9a45199b5e847c3bb0ac6f (patch)
tree6dd7ef8672244bcbcd22660468b0ce80c0a6d018 /utils
parent771d9ed019c8b043d7d33db53f1ff4c5a6e52473 (diff)
cec-compliance/follower: fix type comparison warnings
This fixes the following warnings on a 32-bit system: cec-test.cpp: In function ‘int deck_ctl_deck_ctl(node*, unsigned int, unsigned int, bool)’: cec-test.cpp:742:69: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘time_t’ {aka ‘long int’} [-Wsign-compare] 742 | for (unsigned i = 0; deck_status == CEC_OP_DECK_INFO_SKIP_FWD && i < long_timeout; i++) { | ~~^~~~~~~~~~~~~~ cec-test.cpp:754:69: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘time_t’ {aka ‘long int’} [-Wsign-compare] 754 | for (unsigned i = 0; deck_status == CEC_OP_DECK_INFO_SKIP_REV && i < long_timeout; i++) { | ~~^~~~~~~~~~~~~~ cec-processing.cpp: In function ‘void testProcessing(node*, bool)’: cec-processing.cpp:1105:47: warning: comparison of integer expressions of different signedness: ‘time_t’ {aka ‘long int’} and ‘unsigned int’ [-Wsign-compare] 1105 | (time(nullptr) - last_pwr_status_toggle > node->state.toggle_power_status)) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Diffstat (limited to 'utils')
-rw-r--r--utils/cec-compliance/cec-test.cpp4
-rw-r--r--utils/cec-follower/cec-follower.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/utils/cec-compliance/cec-test.cpp b/utils/cec-compliance/cec-test.cpp
index dac188ba..283abe43 100644
--- a/utils/cec-compliance/cec-test.cpp
+++ b/utils/cec-compliance/cec-test.cpp
@@ -739,7 +739,7 @@ static int deck_ctl_deck_ctl(struct node *node, unsigned me, unsigned la, bool i
}
fail_on_test(cec_msg_status_is_abort(&msg));
/* Wait for Deck to finish Skip Forward. */
- for (unsigned i = 0; deck_status == CEC_OP_DECK_INFO_SKIP_FWD && i < long_timeout; i++) {
+ for (int i = 0; deck_status == CEC_OP_DECK_INFO_SKIP_FWD && i < long_timeout; i++) {
sleep(1);
fail_on_test(deck_status_get(node, me, la, deck_status));
}
@@ -751,7 +751,7 @@ static int deck_ctl_deck_ctl(struct node *node, unsigned me, unsigned la, bool i
fail_on_test(cec_msg_status_is_abort(&msg)); /* Assumes deck has media. */
fail_on_test(deck_status_get(node, me, la, deck_status));
/* Wait for Deck to finish Skip Reverse. */
- for (unsigned i = 0; deck_status == CEC_OP_DECK_INFO_SKIP_REV && i < long_timeout; i++) {
+ for (int i = 0; deck_status == CEC_OP_DECK_INFO_SKIP_REV && i < long_timeout; i++) {
sleep(1);
fail_on_test(deck_status_get(node, me, la, deck_status));
}
diff --git a/utils/cec-follower/cec-follower.h b/utils/cec-follower/cec-follower.h
index 68ef222a..3fa95417 100644
--- a/utils/cec-follower/cec-follower.h
+++ b/utils/cec-follower/cec-follower.h
@@ -53,7 +53,7 @@ struct state {
__u8 deck_report_changes_to;
__u8 deck_state;
__u64 deck_skip_start;
- unsigned toggle_power_status;
+ time_t toggle_power_status;
__u64 last_aud_rate_rx_ts;
};

Privacy Policy