mirror of
https://github.com/libretro/RetroArch
synced 2025-03-23 01:21:47 +00:00
(zlib) Backport 60a5ecc62b (diff-e17b59778d9aff01f3b9b23f56d76d48)
This commit is contained in:
parent
b1d82f1b27
commit
da9a0786f7
24
deps/libz/inffast.c
vendored
24
deps/libz/inffast.c
vendored
@ -47,7 +47,7 @@ output space.
|
|||||||
*/
|
*/
|
||||||
void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start)
|
void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start)
|
||||||
{
|
{
|
||||||
code here; /* retrieved table entry */
|
code const *here; /* retrieved table entry */
|
||||||
unsigned op; /* code bits, operation, extra bits, or */
|
unsigned op; /* code bits, operation, extra bits, or */
|
||||||
/* window position, window bytes to copy */
|
/* window position, window bytes to copy */
|
||||||
unsigned len; /* match length, unused bytes */
|
unsigned len; /* match length, unused bytes */
|
||||||
@ -83,17 +83,17 @@ void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start)
|
|||||||
hold += (unsigned long)(*in++) << bits;
|
hold += (unsigned long)(*in++) << bits;
|
||||||
bits += 8;
|
bits += 8;
|
||||||
}
|
}
|
||||||
here = lcode[hold & lmask];
|
here = lcode + (hold & lmask);
|
||||||
dolen:
|
dolen:
|
||||||
op = (unsigned)(here.bits);
|
op = (unsigned)(here->bits);
|
||||||
hold >>= op;
|
hold >>= op;
|
||||||
bits -= op;
|
bits -= op;
|
||||||
op = (unsigned)(here.op);
|
op = (unsigned)(here->op);
|
||||||
if (op == 0) /* literal */
|
if (op == 0) /* literal */
|
||||||
*out++ = (unsigned char)(here.val);
|
*out++ = (unsigned char)(here->val);
|
||||||
else if (op & 16) /* length base */
|
else if (op & 16) /* length base */
|
||||||
{
|
{
|
||||||
len = (unsigned)(here.val);
|
len = (unsigned)(here->val);
|
||||||
op &= 15; /* number of extra bits */
|
op &= 15; /* number of extra bits */
|
||||||
if (op)
|
if (op)
|
||||||
{
|
{
|
||||||
@ -115,16 +115,16 @@ dolen:
|
|||||||
bits += 8;
|
bits += 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
here = dcode[hold & dmask];
|
here = dcode + (hold & dmask);
|
||||||
|
|
||||||
dodist:
|
dodist:
|
||||||
op = (unsigned)(here.bits);
|
op = (unsigned)(here->bits);
|
||||||
hold >>= op;
|
hold >>= op;
|
||||||
bits -= op;
|
bits -= op;
|
||||||
op = (unsigned)(here.op);
|
op = (unsigned)(here->op);
|
||||||
if (op & 16) /* distance base */
|
if (op & 16) /* distance base */
|
||||||
{
|
{
|
||||||
dist = (unsigned)(here.val);
|
dist = (unsigned)(here->val);
|
||||||
op &= 15; /* number of extra bits */
|
op &= 15; /* number of extra bits */
|
||||||
if (bits < op)
|
if (bits < op)
|
||||||
{
|
{
|
||||||
@ -236,7 +236,7 @@ dodist:
|
|||||||
}
|
}
|
||||||
else if ((op & 64) == 0) /* 2nd level distance code */
|
else if ((op & 64) == 0) /* 2nd level distance code */
|
||||||
{
|
{
|
||||||
here = dcode[here.val + (hold & ((1U << op) - 1))];
|
here = dcode + here->val + (hold & ((1U << op) - 1));
|
||||||
goto dodist;
|
goto dodist;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -248,7 +248,7 @@ dodist:
|
|||||||
}
|
}
|
||||||
else if ((op & 64) == 0) /* 2nd level length code */
|
else if ((op & 64) == 0) /* 2nd level length code */
|
||||||
{
|
{
|
||||||
here = lcode[here.val + (hold & ((1U << op) - 1))];
|
here = lcode + here->val + (hold & ((1U << op) - 1));
|
||||||
goto dolen;
|
goto dolen;
|
||||||
}
|
}
|
||||||
else if (op & 32) /* end-of-block */
|
else if (op & 32) /* end-of-block */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user