From: Shawn O. Pearce Date: Mon, 12 Mar 2007 19:16:39 GMT Subject: Re: [PATCH 2/3] fast-import: tree allocation cleanups Message-ID: <20070312191639.GD15887@spearce.org> In-Reply-To: <20070311155138.GA7110@coredump.intra.peff.net> Jeff King wrote: > On Sat, Mar 10, 2007 at 10:21:47PM -0500, Shawn O. Pearce wrote: > > > + name = to_atom(p, n); > > [...] > > > - e->name = to_atom(p, (unsigned short)n); > > > > You missed an unsigned short cast here. > > Actually, I removed it intentionally (though clearly I should have > documented it). It's casting from an unsigned int to an unsigned short. > Such a cast is at best pointless (since the compiler performs the exact > same cast implicitly -- see C99 6.5.2.2, paragraph 7), and at worst > masks an error (e.g., if the type of n is changed). Hmm. You are probably right. I had put that cast into place before because (if I recall correctly) I was getting compiler errors. But today looking at it I'm not, even if I remove the casts. So uh, yea... they should probably come out. -- Shawn.