Bug 1073003 - Fix -Wsign-conversion warnings. r=ehsan
authorBotond Ballo <botond@mozilla.com>
Tue, 23 Dec 2014 03:26:40 -0500
changeset 248393 7a10ad29050eb40110df345e7a865c1320dc02f3
parent 248392 6550cdd34f6fce661f2fb72da4974013449ae701
child 248394 35801c7c975cd7d8161e71281b54e23fe4a410b2
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1073003
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1073003 - Fix -Wsign-conversion warnings. r=ehsan
dom/media/omx/OMXCodecWrapper.cpp
dom/media/omx/mediaresourcemanager/MediaResourceManagerService.cpp
--- a/dom/media/omx/OMXCodecWrapper.cpp
+++ b/dom/media/omx/OMXCodecWrapper.cpp
@@ -282,21 +282,21 @@ ConvertPlanarYCbCrToNV12(const PlanarYCb
              ySize.height % uvSize.height == 0);
   size_t uvWidth = ySize.width / 2;
   size_t uvHeight = ySize.height / 2;
   size_t horiSubsample = uvSize.width / uvWidth;
   size_t uPixStride = horiSubsample * (1 + aSource->mCbSkip);
   size_t vPixStride = horiSubsample * (1 + aSource->mCrSkip);
   size_t lineStride = uvSize.height / uvHeight * aSource->mCbCrStride;
 
-  for (int i = 0; i < uvHeight; i++) {
+  for (size_t i = 0; i < uvHeight; i++) {
     // 1st pixel per line.
     uint8_t* uSrc = u;
     uint8_t* vSrc = v;
-    for (int j = 0; j < uvWidth; j++) {
+    for (size_t j = 0; j < uvWidth; j++) {
       *aDestination++ = *uSrc;
       *aDestination++ = *vSrc;
       // Pick next source pixel.
       uSrc += uPixStride;
       vSrc += vPixStride;
     }
     // Pick next source line.
     u += lineStride;
--- a/dom/media/omx/mediaresourcemanager/MediaResourceManagerService.cpp
+++ b/dom/media/omx/mediaresourcemanager/MediaResourceManagerService.cpp
@@ -328,17 +328,17 @@ status_t MediaResourceManagerService::Re
   Fifo& queue = mMap.editValueAt(found).mRequestQueue;
   queue.erase(queue.begin());
   return OK;
 }
 
 status_t MediaResourceManagerService::ResourceTable::forgetClient(const sp<IBinder>& client)
 {
   // Traverse all resources.
-  for (int i = 0; i < mMap.size(); i++) {
+  for (size_t i = 0; i < mMap.size(); i++) {
     forgetClient(client, mMap.keyAt(i));
   }
   return OK;
 }
 
 status_t MediaResourceManagerService::ResourceTable::forgetClient(const sp<IBinder>& client, ResourceType type)
 {
   MOZ_ASSERT(supportsType(type));
@@ -353,17 +353,17 @@ status_t MediaResourceManagerService::Re
       queue.erase(it);
       break;
     }
     it++;
   }
 
   // Revoke ownership for given client.
   Slots& slots = resources.mSlots;
-  for (int i = 0; i < slots.size(); i++) {
+  for (size_t i = 0; i < slots.size(); i++) {
     ResourceSlot& slot = slots.editItemAt(i);
     if (client.get() == slot.mClient.get()) {
       slot.mClient = nullptr;
     }
   }
 
   return OK;
 }