From: Thomas Gummerer Date: Tue, 07 Aug 2012 19:02:45 GMT Subject: Re: [PATCH/RFC v2 08/16] Make in-memory format aware of stat_crc Message-ID: <20120807190245.GA867@tgummerer.surfnet.iacbox> In-Reply-To: <7vobmo23n8.fsf@alter.siamese.dyndns.org> On 08/05, Junio C Hamano wrote: > Thomas Gummerer writes: > > > + stat_crc = crc32(stat_crc, (Bytef*)&stat, 4); > > + stat = htonl(ce->ce_ino); > > + stat_crc = crc32(stat_crc, (Bytef*)&stat, 4); > > + stat = htonl(ce->ce_size); > > + stat_crc = crc32(stat_crc, (Bytef*)&stat, 4); > > + stat = htonl(ce->ce_dev); > > + stat_crc = crc32(stat_crc, (Bytef*)&stat, 4); > > + stat = htonl(ce->ce_uid); > > + stat_crc = crc32(stat_crc, (Bytef*)&stat, 4); > > + stat = htonl(ce->ce_gid); > > + stat_crc = crc32(stat_crc, (Bytef*)&stat, 4); > > + return stat_crc; > > What are these (Bytef *) casts are about? We do not use it in any > of our existing calls to crc32(). >From a quick look over the existing calls, their argument is always either a void* or a char* pointer. Using pointers other than those two or Bytef* gives compiler warnings. I can cast to either void* or char* if that's preferred.