[llvm-commits] [llvm] r74929 - /llvm/trunk/include/llvm/CodeGen/BinaryObject.h

Chris Lattner clattner at apple.com
Tue Jul 7 13:11:29 PDT 2009


On Jul 7, 2009, at 11:35 AM, Misha Brukman wrote:

> 2009/7/7 Chris Lattner <sabre at nondot.org>
> -    Data.push_back((W >> 0) & 255);
> -    Data.push_back((W >> 8) & 255);
> +    Data.push_back((uint8_t)(W >> 0));
> +    Data.push_back((uint8_t)(W >> 8));
>
> These are all C-style casts, rather than C++-style casts, e.g.  
> static_cast<uint8_t>(value) .
> Is there a preference for C-style casts in LLVM?  I thought we were  
> trying to stick with C++ here.

We don't use one consistently over the other.  I don't think there is  
a clear win to using c++ style casts here, in the sense that they  
don't add any value. OTOH, for const_cast, I think that using the c++  
style cast makes the intention more clear.

-Chris

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20090707/63e0a903/attachment.html>


More information about the llvm-commits mailing list