Procházet zdrojové kódy

Fixed AVI header writing 4 bytes for 16bit values

{U}INTX_C et al. only seem to guarantee that the size of the constant will be X bits or more. At least this is the behaviour I've seen with VS and Clang

I've made the minimal fix here, but it would be smart to review all remaining uses of these macros, particularly when it comes to I/O.
Stephen Hill před 10 roky
rodič
revize
87d3501ded
1 změnil soubory, kde provedl 6 přidání a 6 odebrání
  1. 6 6
      examples/common/aviwriter.h

+ 6 - 6
examples/common/aviwriter.h

@@ -89,8 +89,8 @@ struct AviWriter
 		bx::write(m_writer, BX_MAKEFOURCC('v', 'i', 'd', 's') ); // fccType
 		bx::write(m_writer, BX_MAKEFOURCC('v', 'i', 'd', 's') ); // fccType
 		bx::write(m_writer, BX_MAKEFOURCC('D', 'I', 'B', ' ') ); // fccHandler
 		bx::write(m_writer, BX_MAKEFOURCC('D', 'I', 'B', ' ') ); // fccHandler
 		bx::write(m_writer, UINT32_C(0) );      // dwFlags
 		bx::write(m_writer, UINT32_C(0) );      // dwFlags
-		bx::write(m_writer, UINT16_C(0) );      // wPriority
-		bx::write(m_writer, UINT16_C(0) );      // wLanguage
+		bx::write(m_writer, uint16_t(0) );      // wPriority
+		bx::write(m_writer, uint16_t(0) );      // wLanguage
 		bx::write(m_writer, UINT32_C(0) );      // dwInitialFrames
 		bx::write(m_writer, UINT32_C(0) );      // dwInitialFrames
 		bx::write(m_writer, UINT32_C(1) );      // dwScale
 		bx::write(m_writer, UINT32_C(1) );      // dwScale
 		bx::write(m_writer, _fps);              // dwRate
 		bx::write(m_writer, _fps);              // dwRate
@@ -102,8 +102,8 @@ struct AviWriter
 		bx::write(m_writer, m_frameSize);       // dwSuggestedBufferSize
 		bx::write(m_writer, m_frameSize);       // dwSuggestedBufferSize
 		bx::write(m_writer, UINT32_MAX);        // dwQuality
 		bx::write(m_writer, UINT32_MAX);        // dwQuality
 		bx::write(m_writer, UINT32_C(0) );      // dwSampleSize
 		bx::write(m_writer, UINT32_C(0) );      // dwSampleSize
-		bx::write(m_writer, INT16_C(0) );       // rcFrame.left
-		bx::write(m_writer, INT16_C(0) );       // rcFrame.top
+		bx::write(m_writer, int16_t(0) );       // rcFrame.left
+		bx::write(m_writer, int16_t(0) );       // rcFrame.top
 		bx::write(m_writer, uint16_t(_width) ); // rcFrame.right
 		bx::write(m_writer, uint16_t(_width) ); // rcFrame.right
 		bx::write(m_writer, uint16_t(_height) );// rcFrame.bottom
 		bx::write(m_writer, uint16_t(_height) );// rcFrame.bottom
 
 
@@ -114,8 +114,8 @@ struct AviWriter
 		bx::write(m_writer, UINT32_C(40) );     // biSize
 		bx::write(m_writer, UINT32_C(40) );     // biSize
 		bx::write(m_writer, _width);            // biWidth
 		bx::write(m_writer, _width);            // biWidth
 		bx::write(m_writer, _height);           // biHeight
 		bx::write(m_writer, _height);           // biHeight
-		bx::write(m_writer, UINT16_C(1) );      // biPlanes
-		bx::write(m_writer, UINT16_C(24) );     // biBitCount
+		bx::write(m_writer, uint16_t(1) );      // biPlanes
+		bx::write(m_writer, uint16_t(24) );     // biBitCount
 		bx::write(m_writer, UINT32_C(0) );      // biCompression
 		bx::write(m_writer, UINT32_C(0) );      // biCompression
 		bx::write(m_writer, m_frameSize);       // biSizeImage
 		bx::write(m_writer, m_frameSize);       // biSizeImage
 		bx::write(m_writer, UINT32_C(0) );      // biXPelsPerMeter
 		bx::write(m_writer, UINT32_C(0) );      // biXPelsPerMeter