shithub: openh264

Download patch

ref: ca1a681b55008549804dd7211218c6f54ed1e9c1
parent: 5d616714c4cdd30287e2c6a8aa485c2fc6c68b84
parent: 630085ce6e5b3c49a8cb2010b3bf4033b0f34e47
author: ekr <[email protected]>
date: Thu Dec 19 11:49:40 EST 2013

Merge pull request #59 from ethanhugg/cosmetic

Fixed warnings found by clang.  Removed some trailing whitespace.

--- a/build/platform-linux.mk
+++ b/build/platform-linux.mk
@@ -1,5 +1,5 @@
 ASM = nasm
-CFLAGS += -fPIC -DLINUX -D__NO_CTYPE
+CFLAGS += -Werror -fPIC -DLINUX -D__NO_CTYPE
 LDFLAGS += -lpthread
 ASMFLAGS += -f elf
 
--- a/codec/encoder/core/src/encoder_ext.cpp
+++ b/codec/encoder/core/src/encoder_ext.cpp
@@ -1772,7 +1772,7 @@
 
 #if defined(MEMORY_MONITOR)
     assert (pMa->WelsGetMemoryUsage() == 0);	// ensure all memory free well
-#endif//MEMORY_MONITOR		
+#endif//MEMORY_MONITOR
 
     if ((*ppCtx)->pMemAlign != NULL) {
       WelsLog (NULL, WELS_LOG_INFO, "FreeMemorySvc(), verify memory usage (%d bytes) after free..\n",
@@ -2030,7 +2030,7 @@
 
   uiCpuCores	= pCodingParam->iMultipleThreadIdc;	// assigned uiCpuCores from iMultipleThreadIdc from SGE testing
 
-#endif//WELS_TESTBED	
+#endif//WELS_TESTBED
 
   uiCpuCores	= WELS_CLIP3 (uiCpuCores, 1, MAX_THREADS_NUM);
 
@@ -2123,9 +2123,9 @@
   }
 
 #if defined(MEMORY_MONITOR)
-  WelsLog (pCtx, WELS_LOG_INFO, "WelsInitEncoderExt() exit, overall memory usage: %lu bytes\n",
-           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: %llu bytes\n",
+           static_cast<unsigned long long>(sizeof (sWelsEncCtx) /* requested size from malloc() or new operator */
+           + pCtx->pMemAlign->WelsGetMemoryUsage())	/* requested size from CMemoryAlign::WelsMalloc() */
           );
 #endif//MEMORY_MONITOR
 
@@ -2943,8 +2943,8 @@
   if ((pBs->pBufEnd - pBs->pBufPtr) < iLen || iNal >= pCtx->pOut->iCountNals) {
 #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);
+             "[RC] paddingcal pBuffer overflow, bufferlen=%lld, paddinglen=%d, iNalIdx= %d, iCountNals= %d\n",
+             static_cast<long long int>(pBs->pBufEnd - pBs->pBufPtr), iLen, iNal, pCtx->pOut->iCountNals);
 #endif
     return 0;
   }
@@ -3522,7 +3522,7 @@
                    (pCtx->eSliceType == P_SLICE ? 'P' : 'I'),
                    eNalRefIdc,
                    iSliceSize);
-#endif//SLICE_INFO_OUTPUT						
+#endif//SLICE_INFO_OUTPUT
           ++ iNalIdxInLayer;
           ++ iSliceIdx;
         }
@@ -3758,7 +3758,7 @@
 
 #if defined(X86_ASM)
   WelsEmms();
-#endif //X86_ASM	
+#endif //X86_ASM
 
   return eFrameType;
 }
--- a/codec/encoder/core/src/utils.cpp
+++ b/codec/encoder/core/src/utils.cpp
@@ -157,7 +157,7 @@
 #endif//_MSC_VER
 #else//__GNUC__
       struct tm* t_now;
-#endif//WIN32			
+#endif//WIN32
 
 #if defined( _WIN32 )
       struct _timeb tb;
@@ -172,7 +172,7 @@
         return;
       }
 #endif//_MSC_VER >= 1500
-#endif//_MSC_VER			
+#endif//_MSC_VER
       FTIME (&tb);
 #elif defined( __GNUC__ )
       struct timeval tv;
@@ -252,7 +252,8 @@
 #endif//_MSC_VER >= 1500
 #endif//_MSC_VER
 #elif defined (__GNUC__)
-        iCurUsed = SNPRINTF (&pBuf[iBufUsed], iBufLeft, ".%3.3u]: ", 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;