From 057969303b1687a12b2d8edfd4a738c3facc191a Mon Sep 17 00:00:00 2001 From: Dylan Reid Date: Fri, 17 Apr 2020 21:49:33 +0000 Subject: CRAS: a2dp - fix some warnings with newer clang signed/unsigned comparisons and unused variables in the unit tests. Change-Id: I0e04a55c5c45faec43eb981a7a9795d9b487bac6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/adhd/+/2155147 Reviewed-by: Hsinyu Chao Tested-by: Dylan Reid Commit-Queue: Dylan Reid --- cras/src/server/cras_a2dp_iodev.c | 8 ++++---- cras/src/tests/a2dp_iodev_unittest.cc | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'cras') diff --git a/cras/src/server/cras_a2dp_iodev.c b/cras/src/server/cras_a2dp_iodev.c index 5169e07c..f2285f88 100644 --- a/cras/src/server/cras_a2dp_iodev.c +++ b/cras/src/server/cras_a2dp_iodev.c @@ -97,7 +97,7 @@ static int update_supported_formats(struct cras_iodev *iodev) return 0; } -static int bt_local_queued_frames(const struct cras_iodev *iodev) +static unsigned int bt_local_queued_frames(const struct cras_iodev *iodev) { struct a2dp_io *a2dpio = (struct a2dp_io *)iodev; return a2dp_queued_frames(&a2dpio->a2dp) + @@ -120,7 +120,7 @@ static int frames_queued(const struct cras_iodev *iodev, */ static int fill_zeros_to_min_buffer_level(struct cras_iodev *iodev) { - int local_queued_frames = bt_local_queued_frames(iodev); + unsigned int local_queued_frames = bt_local_queued_frames(iodev); if (local_queued_frames < iodev->min_buffer_level) return cras_iodev_fill_odev_zeros( @@ -137,7 +137,7 @@ static int fill_zeros_to_min_buffer_level(struct cras_iodev *iodev) */ static int output_underrun(struct cras_iodev *iodev) { - int local_queued_frames = bt_local_queued_frames(iodev); + unsigned int local_queued_frames = bt_local_queued_frames(iodev); /* * Examples to help understand the check: @@ -378,7 +378,7 @@ static int encode_and_flush(const struct cras_iodev *iodev) int err; size_t format_bytes; int written = 0; - int queued_frames; + unsigned int queued_frames; struct a2dp_io *a2dpio; struct cras_bt_device *device; struct timespec now; diff --git a/cras/src/tests/a2dp_iodev_unittest.cc b/cras/src/tests/a2dp_iodev_unittest.cc index 7f2968c2..ba75c33a 100644 --- a/cras/src/tests/a2dp_iodev_unittest.cc +++ b/cras/src/tests/a2dp_iodev_unittest.cc @@ -426,10 +426,8 @@ TEST_F(A2dpIodev, FlushAtLowBufferLevel) { struct cras_audio_area* area; struct timespec tstamp; unsigned frames; - struct a2dp_io* a2dpio; iodev = a2dp_iodev_create(fake_transport); - a2dpio = (struct a2dp_io*)iodev; iodev_set_format(iodev, &format); iodev->configure_dev(iodev); -- cgit v1.2.3