This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 01/16] use the libiberty crc code
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 24 Jun 2013 17:39:46 +0100
- Subject: Re: [PATCH 01/16] use the libiberty crc code
- References: <1371835506-15691-1-git-send-email-tromey at redhat dot com> <1371835506-15691-2-git-send-email-tromey at redhat dot com>
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