From 3ace56117823a61e46be5584b496cd81f2a3c91a Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sat, 1 Mar 2014 16:35:58 +0100 Subject: TONY: Indent code properly in lzo --- engines/tony/mpal/lzo.cpp | 89 ++++++++++++++++++++++++----------------------- 1 file changed, 45 insertions(+), 44 deletions(-) (limited to 'engines') 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++; -- cgit v1.2.3