[llvm-commits] [llvm] r172466 - /llvm/trunk/lib/Object/MachOObject.cpp
David Greene
greened at obbligato.org
Mon Jan 14 13:04:38 PST 2013
Author: greened
Date: Mon Jan 14 15:04:38 2013
New Revision: 172466
URL: http://llvm.org/viewvc/llvm-project?rev=172466&view=rev
Log:
Fix More Casts
Fix another cast-away-const cast.
Modified:
llvm/trunk/lib/Object/MachOObject.cpp
Modified: llvm/trunk/lib/Object/MachOObject.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/MachOObject.cpp?rev=172466&r1=172465&r2=172466&view=diff
==============================================================================
--- llvm/trunk/lib/Object/MachOObject.cpp (original)
+++ llvm/trunk/lib/Object/MachOObject.cpp Mon Jan 14 15:04:38 2013
@@ -44,7 +44,8 @@
}
// Check whether we can return a direct pointer.
- struct_type *Ptr = (struct_type *) (Buffer.data() + Base);
+ struct_type *Ptr = reinterpret_cast<struct_type *>(
+ const_cast<char *>(Buffer.data() + Base));
if (!MOO.isSwappedEndian()) {
Res = Ptr;
return;
More information about the llvm-commits
mailing list