Commit 1a27e731 by Nathan Sidwell

tinfo.cc (__dynamic_cast): Use a reinterpret_cast.

	* tinfo.cc (__dynamic_cast): Use a reinterpret_cast. Fix
	offsetof expansion.

	* inc/cxxabi.h:  Fix typos in comment.
	(__base_class_info::__offset): Use a static_cast.

From-SVN: r33773
parent 93f69683
2000-05-08 Nathan Sidwell <nathan@codesourcery.com>
* tinfo.cc (__dynamic_cast): Use a reinterpret_cast. Fix
offsetof expansion.
2000-05-08 Branko Cibej <branko.cibej@hermes.si>
* inc/cxxabi.h: Fix typos in comment.
(__base_class_info::__offset): Use a static_cast.
2000-05-07 Nathan Sidwell <nathan@codesourcery.com> 2000-05-07 Nathan Sidwell <nathan@codesourcery.com>
* inc/cxxabi.h: Use __SIZE_TYPE_ and __PTRDIFF_TYPE__ in place * inc/cxxabi.h: Use __SIZE_TYPE_ and __PTRDIFF_TYPE__ in place
......
...@@ -49,11 +49,11 @@ ...@@ -49,11 +49,11 @@
#ifdef __cplusplus #ifdef __cplusplus
// We use the compiler builtins __SIZE__TYPE__ and __PTRDIFF_TYPE__ instead of // We use the compiler builtins __SIZE_TYPE__ and __PTRDIFF_TYPE__ instead of
// std::size_t and std::ptrdiff_t respectively. This makes us independant of // std::size_t and std::ptrdiff_t respectively. This makes us independant of
// the conformance level of <cstddef> and whether -fhonor-std was supplied. // the conformance level of <cstddef> and whether -fhonor-std was supplied.
// <cstddef> is not currently available during compiler building anyway. // <cstddef> is not currently available during compiler building anyway.
// including <stddef.h> would be wrong, as that would rudely place size_t in // Including <stddef.h> would be wrong, as that would rudely place size_t in
// the global namespace. // the global namespace.
#include <typeinfo> #include <typeinfo>
...@@ -215,7 +215,7 @@ public: ...@@ -215,7 +215,7 @@ public:
{ {
// This shift, being of a signed type, is implementation defined. GCC // This shift, being of a signed type, is implementation defined. GCC
// implements such shifts as arithmetic, which is what we want. // implements such shifts as arithmetic, which is what we want.
return __PTRDIFF_TYPE__ (vmi_offset_flags) >> offset_shift; return static_cast<__PTRDIFF_TYPE__> (vmi_offset_flags) >> offset_shift;
} }
}; };
......
...@@ -1146,7 +1146,8 @@ __dynamic_cast (const void *src_ptr, // object started from ...@@ -1146,7 +1146,8 @@ __dynamic_cast (const void *src_ptr, // object started from
const void *vtable = *static_cast <const void *const *> (src_ptr); const void *vtable = *static_cast <const void *const *> (src_ptr);
const vtable_prefix *prefix = const vtable_prefix *prefix =
adjust_pointer <vtable_prefix> adjust_pointer <vtable_prefix>
(vtable, -__PTRDIFF_TYPE__(static_cast <vtable_prefix *> (NULL)->origin)); (vtable, -reinterpret_cast <__PTRDIFF_TYPE__>
(&static_cast <vtable_prefix *> (NULL)->origin));
const void *whole_ptr = const void *whole_ptr =
adjust_pointer <void> (src_ptr, prefix->whole_object); adjust_pointer <void> (src_ptr, prefix->whole_object);
const __class_type_info *whole_type = prefix->whole_type; const __class_type_info *whole_type = prefix->whole_type;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment