New issue
Advanced search Search tips

Issue 592843 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug

Blocking:
issue 579202
issue 427616



Sign in to add a comment

Comparing HRESULT to system error code - not meaningful

Project Member Reported by brucedaw...@chromium.org, Mar 8 2016

Issue description

The /analyze builder complains thusly:

device\bluetooth\bluetooth_remote_gatt_characteristic_win.cc(333) : warning C6221: Implicit cast between semantically different integer types:  comparing HRESULT to an integer.  Consider using SUCCEEDED or FAILED macros instead.

This is because ERROR_INVALID_USER_BUFFER is a system error code and comparing it to an HRESULT (through a switch statement) is not meaningful. The code that does this was introduced in:

https://codereview.chromium.org/1739383002/diff/340001/device/bluetooth/bluetooth_remote_gatt_characteristic_win.cc

 
HRESULT_FROM_WIN32 needs to be used to convert ERROR_INVALID_USER_BUFFER to an HRESULT before comparing.
When fixing please tag with this bug number and with 427616 (the master /analyze bug) - thanks.
Blocking: 427616 579202
Components: IO>Bluetooth
Project Member

Comment 5 by bugdroid1@chromium.org, Apr 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/08539daf0b416e5cebf3109119f4c9e6beb09d54

commit 08539daf0b416e5cebf3109119f4c9e6beb09d54
Author: gogerald <gogerald@chromium.org>
Date: Fri Apr 08 18:51:49 2016

Implement BluetoothRemoteGattCharacteristicWin::StartNotifySession and related unit tests.

This CL implements BluetoothRemoteGattCharacteristicWin::StartNotifySession and related unit tests.

It also fixes implicit cast between semantically different integer types issue.

In addition, it moves gatt_notify_characteristic_attempts_, gatt_write_characteristic_attempts_,
and gatt_read_characteristic_attempts_ check immediately after an operation in bluetooth_gatt_characteristic_unittest.cc
to after simulate operation since the operation is asynchronous down to the OS on Windows.

BUG=579202, 592843 , 427616 , 597888 

Review URL: https://codereview.chromium.org/1749403002

Cr-Commit-Position: refs/heads/master@{#386150}

[modify] https://crrev.com/08539daf0b416e5cebf3109119f4c9e6beb09d54/device/bluetooth/BUILD.gn
[modify] https://crrev.com/08539daf0b416e5cebf3109119f4c9e6beb09d54/device/bluetooth/bluetooth.gyp
[modify] https://crrev.com/08539daf0b416e5cebf3109119f4c9e6beb09d54/device/bluetooth/bluetooth_device_win.cc
[modify] https://crrev.com/08539daf0b416e5cebf3109119f4c9e6beb09d54/device/bluetooth/bluetooth_gatt_characteristic_unittest.cc
[add] https://crrev.com/08539daf0b416e5cebf3109119f4c9e6beb09d54/device/bluetooth/bluetooth_gatt_notify_session_win.cc
[add] https://crrev.com/08539daf0b416e5cebf3109119f4c9e6beb09d54/device/bluetooth/bluetooth_gatt_notify_session_win.h
[modify] https://crrev.com/08539daf0b416e5cebf3109119f4c9e6beb09d54/device/bluetooth/bluetooth_low_energy_win.cc
[modify] https://crrev.com/08539daf0b416e5cebf3109119f4c9e6beb09d54/device/bluetooth/bluetooth_low_energy_win.h
[modify] https://crrev.com/08539daf0b416e5cebf3109119f4c9e6beb09d54/device/bluetooth/bluetooth_low_energy_win_fake.cc
[modify] https://crrev.com/08539daf0b416e5cebf3109119f4c9e6beb09d54/device/bluetooth/bluetooth_low_energy_win_fake.h
[modify] https://crrev.com/08539daf0b416e5cebf3109119f4c9e6beb09d54/device/bluetooth/bluetooth_remote_gatt_characteristic_win.cc
[modify] https://crrev.com/08539daf0b416e5cebf3109119f4c9e6beb09d54/device/bluetooth/bluetooth_remote_gatt_characteristic_win.h
[modify] https://crrev.com/08539daf0b416e5cebf3109119f4c9e6beb09d54/device/bluetooth/bluetooth_remote_gatt_descriptor_win.h
[modify] https://crrev.com/08539daf0b416e5cebf3109119f4c9e6beb09d54/device/bluetooth/bluetooth_remote_gatt_service_win.cc
[modify] https://crrev.com/08539daf0b416e5cebf3109119f4c9e6beb09d54/device/bluetooth/bluetooth_task_manager_win.cc
[modify] https://crrev.com/08539daf0b416e5cebf3109119f4c9e6beb09d54/device/bluetooth/bluetooth_task_manager_win.h
[modify] https://crrev.com/08539daf0b416e5cebf3109119f4c9e6beb09d54/device/bluetooth/test/bluetooth_test_win.cc
[modify] https://crrev.com/08539daf0b416e5cebf3109119f4c9e6beb09d54/device/bluetooth/test/bluetooth_test_win.h

Status: Fixed (was: Assigned)

Sign in to add a comment