Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(667)

Unified Diff: components/storage_monitor/test_volume_mount_watcher_win.cc

Issue 656363002: Type conversion fixes, components/ edition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/storage_monitor/test_volume_mount_watcher_win.cc
diff --git a/components/storage_monitor/test_volume_mount_watcher_win.cc b/components/storage_monitor/test_volume_mount_watcher_win.cc
index 746af6c41e16075be07128444aed12a22a7c3e82..77ea57b282f8557a411400a89fcd90d1ec74314b 100644
--- a/components/storage_monitor/test_volume_mount_watcher_win.cc
+++ b/components/storage_monitor/test_volume_mount_watcher_win.cc
@@ -62,7 +62,8 @@ bool GetMassStorageDeviceDetails(const base::FilePath& device_path,
base::FilePath path(device_path);
if (device_path.value().length() > 3)
path = base::FilePath(device_path.value().substr(0, 3));
- if (path.value()[0] < L'A' || path.value()[0] > L'Z')
+ base::FilePath::CharType drive_letter = path.value()[0];
+ if (drive_letter < L'A' || drive_letter > L'Z')
return false;
StorageInfo::Type type = StorageInfo::FIXED_MASS_STORAGE;
@@ -73,7 +74,7 @@ bool GetMassStorageDeviceDetails(const base::FilePath& device_path,
}
std::string unique_id =
"\\\\?\\Volume{00000000-0000-0000-0000-000000000000}\\";
- unique_id[11] = device_path.value()[0];
+ unique_id[11] = static_cast<char>(drive_letter);
std::string device_id = StorageInfo::MakeDeviceId(type, unique_id);
base::string16 storage_label = path.Append(L" Drive").LossyDisplayName();
*info = StorageInfo(device_id, path.value(), storage_label, base::string16(),

Powered by Google App Engine
This is Rietveld 408576698