diff options
author | Strangerke | 2014-03-01 16:35:58 +0100 |
---|---|---|
committer | Strangerke | 2014-03-01 16:35:58 +0100 |
commit | 3ace56117823a61e46be5584b496cd81f2a3c91a (patch) | |
tree | a7ec2b87fba5af8d9c6138b72e3011669f847b44 | |
parent | 3f6b51ce55b86d5a1a2f898371368b10a2862252 (diff) | |
download | scummvm-rg350-3ace56117823a61e46be5584b496cd81f2a3c91a.tar.gz scummvm-rg350-3ace56117823a61e46be5584b496cd81f2a3c91a.tar.bz2 scummvm-rg350-3ace56117823a61e46be5584b496cd81f2a3c91a.zip |
TONY: Indent code properly in lzo
-rw-r--r-- | engines/tony/mpal/lzo.cpp | 89 |
1 files changed, 45 insertions, 44 deletions
diff --git a/engines/tony/mpal/lzo.cpp b/engines/tony/mpal/lzo.cpp index 5f564187f8..62b882aa39 100644 --- a/engines/tony/mpal/lzo.cpp +++ b/engines/tony/mpal/lzo.cpp @@ -95,40 +95,44 @@ int lzo1x_decompress(const byte *in, uint32 in_len, byte *out, uint32 *out_len) op = out; ip = in; - if (*ip > 17) - { + if (*ip > 17) { t = *ip++ - 17; if (t < 4) goto match_next; - assert(t > 0); NEED_OP(t); NEED_IP(t+1); - do *op++ = *ip++; while (--t > 0); + assert(t > 0); + NEED_OP(t); + NEED_IP(t + 1); + do + *op++ = *ip++; + while (--t > 0); goto first_literal_run; } - while (TEST_IP && TEST_OP) - { + while (TEST_IP && TEST_OP) { t = *ip++; if (t >= 16) goto match; - if (t == 0) - { + if (t == 0) { NEED_IP(1); - while (*ip == 0) - { + while (*ip == 0) { t += 255; ip++; NEED_IP(1); } t += 15 + *ip++; } - assert(t > 0); NEED_OP(t+3); NEED_IP(t+4); - { - *op++ = *ip++; *op++ = *ip++; *op++ = *ip++; - do *op++ = *ip++; while (--t > 0); - } + assert(t > 0); + NEED_OP(t + 3); + NEED_IP(t + 4); -first_literal_run: + *op++ = *ip++; + *op++ = *ip++; + *op++ = *ip++; + do + *op++ = *ip++; + while (--t > 0); +first_literal_run: t = *ip++; if (t >= 16) goto match; @@ -137,32 +141,31 @@ first_literal_run: m_pos -= t >> 2; m_pos -= *ip++ << 2; - TEST_LB(m_pos); NEED_OP(3); - *op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos; + TEST_LB(m_pos); + NEED_OP(3); + + *op++ = *m_pos++; + *op++ = *m_pos++; + *op++ = *m_pos; + goto match_done; do { match: - if (t >= 64) - { - -#if defined(LZO1X) + if (t >= 64) { m_pos = op - 1; m_pos -= (t >> 2) & 7; m_pos -= *ip++ << 3; t = (t >> 5) - 1; -#endif - TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1); + TEST_LB(m_pos); + assert(t > 0); + NEED_OP(t + 3 - 1); goto copy_match; - } - else if (t >= 32) - { + } else if (t >= 32) { t &= 31; - if (t == 0) - { + if (t == 0) { NEED_IP(1); - while (*ip == 0) - { + while (*ip == 0) { t += 255; ip++; NEED_IP(1); @@ -172,17 +175,13 @@ match: m_pos = op - 1; m_pos -= (ip[0] >> 2) + (ip[1] << 6); ip += 2; - } - else if (t >= 16) - { + } else if (t >= 16) { m_pos = op; m_pos -= (t & 8) << 11; t &= 7; - if (t == 0) - { + if (t == 0) { NEED_IP(1); - while (*ip == 0) - { + while (*ip == 0) { t += 255; ip++; NEED_IP(1); @@ -194,18 +193,20 @@ match: if (m_pos == op) goto eof_found; m_pos -= 0x4000; - } - else - { + } else { m_pos = op - 1; m_pos -= t >> 2; m_pos -= *ip++ << 2; - TEST_LB(m_pos); NEED_OP(2); - *op++ = *m_pos++; *op++ = *m_pos; + TEST_LB(m_pos); + NEED_OP(2); + *op++ = *m_pos++; + *op++ = *m_pos; goto match_done; } - TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1); + TEST_LB(m_pos); + assert(t > 0); + NEED_OP(t + 3 - 1); { copy_match: *op++ = *m_pos++; *op++ = *m_pos++; |