[haiku-commits] Re: haiku: hrev49454 - src/add-ons/kernel/partitioning_systems/gpt build/jam/images/definitions

  • From: Paweł Dziepak <pdziepak@xxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 27 Jul 2015 13:50:36 +0200

On 27 July 2015 at 09:46, Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> wrote:

Am 27.07.2015 um 06:50 schrieb Adrien Destugues:

This is a CRC, not a simple checksum, so it is not that simple.


Indeed. In that case, I think copying the data, or even have a reader
version that alters the checksum on read would be the way to go.


Well, we can make crc computing code take iterator range as an argument and
implement boost::adaptors-style transformer that would replace the checksum
field value with zeroes or we can just write: efi_table_header header_copy
= original_header; (passing the header to function by value has the
disadvantage of leaking implementation detail to the interface – const ref
is what one would normally expect from function validating some values). I
don't think there is much doubt which option is better.

Paweł

Other related posts: