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

Unified Diff: media/base/audio_hash.cc

Issue 1534273002: Switch to standard integer types in media/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more Created 5 years 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: media/base/audio_hash.cc
diff --git a/media/base/audio_hash.cc b/media/base/audio_hash.cc
index 7d705820c2da5300f4427cd118ebe4d0e4d7a880..bc752889c31b180a11934137911a09f7b65ace82 100644
--- a/media/base/audio_hash.cc
+++ b/media/base/audio_hash.cc
@@ -21,12 +21,13 @@ AudioHash::AudioHash()
AudioHash::~AudioHash() {}
void AudioHash::Update(const AudioBus* audio_bus, int frames) {
- // Use uint32 to ensure overflow is a defined operation.
- for (uint32 ch = 0; ch < static_cast<uint32>(audio_bus->channels()); ++ch) {
+ // Use uint32_t to ensure overflow is a defined operation.
+ for (uint32_t ch = 0; ch < static_cast<uint32_t>(audio_bus->channels());
+ ++ch) {
const float* channel = audio_bus->channel(ch);
- for (uint32 i = 0; i < static_cast<uint32>(frames); ++i) {
- const uint32 kSampleIndex = sample_count_ + i;
- const uint32 kHashIndex =
+ for (uint32_t i = 0; i < static_cast<uint32_t>(frames); ++i) {
+ const uint32_t kSampleIndex = sample_count_ + i;
+ const uint32_t kHashIndex =
(kSampleIndex * (ch + 1)) % arraysize(audio_hash_);
// Mix in a sine wave with the result so we ensure that sequences of empty
@@ -40,7 +41,7 @@ void AudioHash::Update(const AudioBus* audio_bus, int frames) {
}
}
- sample_count_ += static_cast<uint32>(frames);
+ sample_count_ += static_cast<uint32_t>(frames);
}
std::string AudioHash::ToString() const {

Powered by Google App Engine
This is Rietveld 408576698