shithub: openh264

Download patch

ref: 50a74382f0208e2b42ab01eda11b47b573f06134
parent: 69cdf61f49db162ec08bd95961f77a9123e83ca9
author: Ethan Hugg <ehugg@cisco.com>
date: Thu Dec 19 04:27:22 EST 2013

Fix warning and turn on -Werror for Travis

--- a/.travis.yml
+++ b/.travis.yml
@@ -9,5 +9,5 @@
  - sudo apt-get update -qq
  - sudo apt-get install -qq g++-4.6-multilib gcc-multilib libc6-dev-i386 lib32z1-dev
 install: make gtest-bootstrap
-script: make && make test && make clean && make ENABLE64BIT=Yes && make test
+script: make WERROR=Yes && make test && make clean && make WERROR=Yes ENABLE64BIT=Yes && make test
 
--- a/Makefile
+++ b/Makefile
@@ -17,9 +17,10 @@
 USE_ASM = Yes
 endif
 else
-CFLAGS = -g
+CFLAGS += -g
 USE_ASM = No
 endif
+
 ifeq ($(ENABLE64BIT), Yes)
 CFLAGS += -m64
 LDFLAGS += -m64
@@ -27,6 +28,11 @@
 CFLAGS += -m32
 LDFLAGS += -m32
 endif
+
+ifeq ($(WERROR), Yes)
+CFLAGS += -Werror
+endif
+
 include build/platform-$(UNAME).mk
 
 ifeq ($(USE_ASM),Yes)
--- a/codec/encoder/core/src/encoder_ext.cpp
+++ b/codec/encoder/core/src/encoder_ext.cpp
@@ -2123,9 +2123,9 @@
   }
 
 #if defined(MEMORY_MONITOR)
-  WelsLog (pCtx, WELS_LOG_INFO, "WelsInitEncoderExt() exit, overall memory usage: %u bytes\n",
-           (unsigned int) (sizeof (sWelsEncCtx) /* requested size from malloc() or new operator */
-           + pCtx->pMemAlign->WelsGetMemoryUsage())	/* requested size from CMemoryAlign::WelsMalloc() */
+  WelsLog (pCtx, WELS_LOG_INFO, "WelsInitEncoderExt() exit, overall memory usage: %zu bytes\n",
+           sizeof (sWelsEncCtx) /* requested size from malloc() or new operator */
+           + pCtx->pMemAlign->WelsGetMemoryUsage()	/* requested size from CMemoryAlign::WelsMalloc() */
           );
 #endif//MEMORY_MONITOR
 
@@ -2944,7 +2944,7 @@
 #if GOM_TRACE_FLAG
     WelsLog (pCtx, WELS_LOG_ERROR,
              "[RC] paddingcal pBuffer overflow, bufferlen=%d, paddinglen=%d, iNalIdx= %d, iCountNals= %d\n",
-             (pBs->pBufEnd - pBs->pBufPtr), iLen, iNal, pCtx->pOut->iCountNals);
+             static_cast<int>(pBs->pBufEnd - pBs->pBufPtr), iLen, iNal, pCtx->pOut->iCountNals);
 #endif
     return 0;
   }
--- a/codec/encoder/core/src/utils.cpp
+++ b/codec/encoder/core/src/utils.cpp
@@ -252,7 +252,8 @@
 #endif//_MSC_VER >= 1500
 #endif//_MSC_VER
 #elif defined (__GNUC__)
-        iCurUsed = SNPRINTF (&pBuf[iBufUsed], iBufLeft, ".%3.3u]: ", (unsigned int) (tv.tv_usec / 1000));	// confirmed_safe_unsafe_usage
+        iCurUsed = SNPRINTF (&pBuf[iBufUsed], iBufLeft, ".%3.3u]: ",
+            static_cast<unsigned int>(tv.tv_usec / 1000));	// confirmed_safe_unsafe_usage
 #endif//WIN32
         if (iCurUsed >= 0) {
           iBufUsed += iCurUsed;