shithub: openh264

Download patch

ref: 96384bd5780bfd5964f3cd4f71f235f51310e169
parent: af938a640f5ec95abee07393141a4e0f32add5ea
author: Martin Storsjö <[email protected]>
date: Fri Jan 16 05:39:55 EST 2015

Add casts when converting from size_t or std::streamsize to int

--- a/test/api/decode_encode_test.cpp
+++ b/test/api/decode_encode_test.cpp
@@ -83,7 +83,7 @@
         break;
       }
     }
-    return buf_.PopFront (static_cast<uint8_t*> (ptr), len);
+    return (int) buf_.PopFront (static_cast<uint8_t*> (ptr), len);
   }
 
  protected:
--- a/test/api/encode_decode_api_test.cpp
+++ b/test/api/encode_decode_api_test.cpp
@@ -726,7 +726,7 @@
 int SimulateNALLoss (const unsigned char* pSrc,  int& iSrcLen, std::vector<SLostSim>* p_SLostSim,
                      const char* pLossChars, bool bLossPara, int& iLossIdx, bool& bVCLLoss) {
   unsigned char* pDst = new unsigned char[iSrcLen];
-  int iLossCharLen = strlen (pLossChars);
+  int iLossCharLen = (int) strlen (pLossChars);
   int iSkipedBytes = 0;
   int iDstLen = 0;
   int iBufPos = 0;
@@ -2400,10 +2400,10 @@
 
   void EncodeOneFrame (int iIdx) {
     int iFrameSize = iWidth_ * iHeight_ * 3 / 2;
-    int iSize = fread (buf_.data(), sizeof (char), iFrameSize, fYuv_);
+    int iSize = (int) fread (buf_.data(), sizeof (char), iFrameSize, fYuv_);
     if (feof (fYuv_) || iSize != iFrameSize) {
       rewind (fYuv_);
-      iSize = fread (buf_.data(), sizeof (char), iFrameSize, fYuv_);
+      iSize = (int) fread (buf_.data(), sizeof (char), iFrameSize, fYuv_);
       ASSERT_TRUE (iSize == iFrameSize);
     }
     int rv = encoder_->EncodeFrame (&EncPic, &info);
--- a/test/utils/FileInputStream.h
+++ b/test/utils/FileInputStream.h
@@ -15,7 +15,7 @@
       return -1;
     }
     file_.read (static_cast<char*> (ptr), len);
-    return file_.gcount();
+    return (int) file_.gcount();
   }
  private:
   std::ifstream file_;