Re: [PATCH 2/3] fast-import: tree allocation cleanups
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Mar 12, 2007, 19:16 UTC
- Message-ID
- <20070312191639.GD15887@spearce.org>
- In-Reply-To
- <20070311155138.GA7110@coredump.intra.peff.net>
Jeff King <peff@peff.net> wrote:
Show 12 quoted lines
> 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.