mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-06 02:10:28 +00:00
TONY: Indent code properly in lzo
This commit is contained in:
parent
3f6b51ce55
commit
3ace561178
@ -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);
|
||||
|
||||
*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++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user