Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@users.sourceforge.net>2010-12-17 19:42:55 +0300
committerXhmikosR <xhmikosr@users.sourceforge.net>2010-12-17 19:42:55 +0300
commit7359bd509afa235acc2ac2f7f95fc9cb5cafd1a4 (patch)
treeb5bb90eeca58fdeb9fde6825f21a25a319823cb4 /src/DSUtil/GolombBuffer.cpp
parentd30b15ed4b98c28951d6d45b8928f4c2b6a11129 (diff)
apply astyle formatting
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@2786 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/DSUtil/GolombBuffer.cpp')
-rw-r--r--src/DSUtil/GolombBuffer.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/DSUtil/GolombBuffer.cpp b/src/DSUtil/GolombBuffer.cpp
index 4e4a15639..4fd1a4a52 100644
--- a/src/DSUtil/GolombBuffer.cpp
+++ b/src/DSUtil/GolombBuffer.cpp
@@ -35,13 +35,14 @@ CGolombBuffer::CGolombBuffer(BYTE* pBuffer, int nSize)
UINT64 CGolombBuffer::BitRead(int nBits, bool fPeek)
{
-// ASSERT(nBits >= 0 && nBits <= 64);
+ // ASSERT(nBits >= 0 && nBits <= 64);
- while(m_bitlen < nBits)
- {
+ while(m_bitlen < nBits) {
m_bitbuff <<= 8;
- if (m_nBitPos >= m_nSize) return 0;
+ if (m_nBitPos >= m_nSize) {
+ return 0;
+ }
*(BYTE*)&m_bitbuff = m_pBuffer[m_nBitPos++];
m_bitlen += 8;
@@ -51,8 +52,7 @@ UINT64 CGolombBuffer::BitRead(int nBits, bool fPeek)
UINT64 ret = (m_bitbuff >> bitlen) & ((1ui64 << nBits) - 1);
- if(!fPeek)
- {
+ if(!fPeek) {
m_bitbuff &= ((1ui64 << bitlen) - 1);
m_bitlen = bitlen;
}
@@ -64,7 +64,9 @@ UINT64 CGolombBuffer::BitRead(int nBits, bool fPeek)
UINT64 CGolombBuffer::UExpGolombRead()
{
int n = -1;
- for(BYTE b = 0; !b; n++) b = (BYTE)BitRead(1);
+ for(BYTE b = 0; !b; n++) {
+ b = (BYTE)BitRead(1);
+ }
return (1ui64 << n) - 1 + BitRead(n);
}