Re: [PATCH 01/16] use the libiberty crc code

Pedro Alves
2013-06-24T16:39:55Z

On 06/21/2013 06:24 PM, Tom Tromey wrote:
> gdb has a copy of some CRC code that also appears in libiberty.
> This patch just removes the local copy.

No exactly the same, as libiberty's pre-computes the table, but,
yeah.

> You may notice that "crc32" returns unsigned long but "xcrc32" returns
> unsigned int. However, this does not matter, because crc32 actually
> does all its operations in unsigned int type, and only the return
> result is widened. So, the difference does not matter.
>
> * remote.c (crc32_table, crc32): Remove.
> (remote_verify_memory): Use xcrc32.

That's fine.

(gdbserver also has it's own copy in server.c (and for that one
the return type does matter), but we don't use
libiberty-the-kitchen-sink there... Oh well.)

Thanks,
--
Pedro Alves