Commit 4a56c3a4 authored by Ken MacKay's avatar Ken MacKay Committed by Commit Bot

[Chromecast] Enable warnings for shadowed variables

Merge-With: eureka-internal/348962
Merge-With: libassistant-internal/120360
Merge-With: libassistant-internal/120361
Merge-With: nest-camera-internal/52300
Change-Id: I43485824a1ca0d42bcc1e681c83555786d55645c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1986427
Commit-Queue: Kenneth MacKay <kmackay@chromium.org>
Reviewed-by: default avatarYuchen Liu <yucliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#728370}
parent e837872a
......@@ -53,6 +53,7 @@ group("all") {
# This is a config which is applied on all cast_* targets (which should be all
# code under chromecast/).
config("cast_config") {
cflags = [ "-Wshadow" ]
}
config("iot_service") {
......
......@@ -89,8 +89,7 @@ TEST_F(CastSessionIdMapTest, CanHoldMultiple) {
std::string saved_session_id = "";
base::UnguessableToken group_id = web_contents_1->GetAudioGroupId();
if (group_id) {
std::string saved_session_id =
CastSessionIdMap::GetSessionId(group_id.ToString());
saved_session_id = CastSessionIdMap::GetSessionId(group_id.ToString());
EXPECT_EQ(saved_session_id, test_session_id_1);
}
......
......@@ -273,7 +273,8 @@ TEST_F(GattClientManagerTest, RemoteDeviceConnect) {
// First connect request fails right away.
EXPECT_CALL(*gatt_client_, Connect(kTestAddr1)).WillOnce(Return(false));
EXPECT_CALL(*gatt_client_, ClearPendingConnect(kTestAddr1)).WillOnce(Return(true));
EXPECT_CALL(*gatt_client_, ClearPendingConnect(kTestAddr1))
.WillOnce(Return(true));
EXPECT_CALL(cb_, Run(false));
device->Connect(cb_.Get());
EXPECT_FALSE(device->IsConnected());
......@@ -483,7 +484,8 @@ TEST_F(GattClientManagerTest, ConnectTimeout) {
// Let Connect request timeout
// We should expect to receive Connect failure message
EXPECT_CALL(*gatt_client_, ClearPendingConnect(kTestAddr1)).WillOnce(Return(true));
EXPECT_CALL(*gatt_client_, ClearPendingConnect(kTestAddr1))
.WillOnce(Return(true));
EXPECT_CALL(cb_, Run(false));
task_environment_.FastForwardBy(GattClientManagerImpl::kConnectTimeout);
EXPECT_FALSE(device->IsConnected());
......@@ -610,7 +612,8 @@ TEST_F(GattClientManagerTest, DisconnectAllTimeout) {
gatt_client_manager_->DisconnectAll(cb.Get());
// Let the fist Disconnect request timeout
EXPECT_CALL(*gatt_client_, ClearPendingDisconnect(kTestAddr1)).WillOnce(Return(true));;
EXPECT_CALL(*gatt_client_, ClearPendingDisconnect(kTestAddr1))
.WillOnce(Return(true));
// We should expect to receive DisconnectAll failure message
EXPECT_CALL(cb, Run(false));
......@@ -1092,12 +1095,13 @@ TEST_F(GattClientManagerTest, WriteType) {
const std::vector<uint8_t> kTestData1 = {0x1, 0x2, 0x3};
bluetooth_v2_shlib::Gatt::Service service;
bluetooth_v2_shlib::Gatt::Characteristic characteristic;
service.uuid = {{0x1}};
service.handle = 0x1;
service.primary = true;
{
bluetooth_v2_shlib::Gatt::Characteristic characteristic;
characteristic.uuid = {{0x1, 0x1}};
characteristic.handle = 0x2;
characteristic.permissions = bluetooth_v2_shlib::Gatt::PERMISSION_WRITE;
......@@ -1116,6 +1120,7 @@ TEST_F(GattClientManagerTest, WriteType) {
characteristic.permissions = bluetooth_v2_shlib::Gatt::PERMISSION_WRITE;
characteristic.properties = bluetooth_v2_shlib::Gatt::PROPERTY_SIGNED_WRITE;
service.characteristics.push_back(characteristic);
}
Connect(kTestAddr1);
bluetooth_v2_shlib::Gatt::Client::Delegate* delegate =
......
......@@ -73,8 +73,8 @@ SkPath MakePath(const AccessibilityFocusRing& input_ring,
}
SkPath path;
gfx::Point p0 = ring.points[0] - offset;
path.moveTo(SkIntToScalar(p0.x()), SkIntToScalar(p0.y()));
gfx::Point start = ring.points[0] - offset;
path.moveTo(SkIntToScalar(start.x()), SkIntToScalar(start.y()));
for (int i = 0; i < 12; i++) {
int index0 = ((3 * i) + 1) % 36;
int index1 = ((3 * i) + 2) % 36;
......
......@@ -19,19 +19,19 @@
#define RETURN_FALSE_ON_ERROR(snd_func, ...) \
do { \
int err = alsa_->snd_func(__VA_ARGS__); \
if (err < 0) { \
LOG(ERROR) << #snd_func " error: " << alsa_->StrError(err); \
int a_err = alsa_->snd_func(__VA_ARGS__); \
if (a_err < 0) { \
LOG(ERROR) << #snd_func " error: " << alsa_->StrError(a_err); \
return false; \
} \
} while (0)
#define RETURN_ERROR_CODE(snd_func, ...) \
do { \
int err = alsa_->snd_func(__VA_ARGS__); \
if (err < 0) { \
LOG(ERROR) << #snd_func " error: " << alsa_->StrError(err); \
return err; \
int a_err = alsa_->snd_func(__VA_ARGS__); \
if (a_err < 0) { \
LOG(ERROR) << #snd_func " error: " << alsa_->StrError(a_err); \
return a_err; \
} \
} while (0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment