On 138, 05 18, 2007 at 03:28:31PM +0530, Nitin Gupta wrote:
> + register const unsigned char *ip;
register keyword is meaningless for today's compiler.
> + unsigned char *op;
> + const unsigned char * const in_end = in + in_len;
> + const unsigned char * const ip_end = in + in_len - M2_MAX_LEN - 5;
> + const unsigned char *ii;
> + const unsigned char ** const dict = (const unsigned char **)workmem;
> +
> + op = out;
Why not write this as `unsigned char *op = out;` ?
Empty if() body ?
> + m_off -= 0x4000;
What's this magic number 0x4000 repeated everywhere ? M3_MAX_OFFSET perhaps ?
> +#if defined(__LITTLE_ENDIAN)
> + m_pos = op - 1;
> + m_pos -= (*(const unsigned short *)ip) >> 2;
> +#else
> + m_pos = op - 1;
> + m_pos -= (ip[0] >> 2) + (ip[1] << 6);
> +#endif
IMHO you could write it this way:
m_pos = op - 1 - (le16_to_cpu(*(const u16 *)ip) >> 2);
> +#if defined(__LITTLE_ENDIAN)
> + m_pos -= (*(const unsigned short *)ip) >> 2;
> +#else
> + m_pos -= (ip[0] >> 2) + (ip[1] << 6);
> +#endif
m_pos -= le16_to_cpu(*(const u16 *)ip) >> 2;