lkml.org 
[lkml]   [2003]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRE: [PATCH RFC] 2.5.73 zlib #2 codefold
> This patch folds three calls to memmove_update into one.  This is the
> same structure that was in the 1.1.3 version of the zlib as well. The
> change towards 1.1.4 was mixed with a real bugfix, so it slipped
> through my brain.
>
> Jörn
[SNIP]

Looks fine to me.

Here is another one in gen_bitlen():
Replace:
for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;
with:
memset(&s->bl_count[0], 0, MAX_BITS * sizeof(s->bl_count[0]));

Also the following could should be replaced(in defutil.h):
/* ===========================================================================
* Reverse the first len bits of a code, using straightforward code (a faster
* method would use a table)
* IN assertion: 1 <= len <= 15
*/
static inline unsigned bi_reverse(unsigned code, /* the value to invert */
int len) /* its bit length */
{
register unsigned res = 0;
do {
res |= code & 1;
code >>= 1, res <<= 1;
} while (--len > 0);
return res >> 1;
}

Anybody have a table version handy?

Joakim


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:46    [W:0.103 / U:21.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site