diff --git a/STL_Extension/include/CGAL/Compact_container.h b/STL_Extension/include/CGAL/Compact_container.h index b4960af00c4..6064a81c6d9 100644 --- a/STL_Extension/include/CGAL/Compact_container.h +++ b/STL_Extension/include/CGAL/Compact_container.h @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -815,7 +816,8 @@ private: static char * clean_pointer(char * p) { - return ((p - (char *) NULL) & ~ (std::ptrdiff_t) START_END) + (char *) NULL; + return reinterpret_cast(reinterpret_cast(p) & + ~ (std::ptrdiff_t) START_END); } // Returns the pointee, cleaned up from the squatted bits. @@ -828,7 +830,8 @@ private: static Type type(const_pointer ptr) { char * p = (char *) Traits::pointer(*ptr); - return (Type) (p - clean_pointer(p)); + return (Type) (reinterpret_cast(p) - + reinterpret_cast(clean_pointer(p))); } // Sets the pointer part and the type of the pointee. @@ -837,7 +840,8 @@ private: // This out of range compare is always true and causes lots of // unnecessary warnings. // CGAL_precondition(0 <= t && t < 4); - Traits::pointer(*ptr) = (void *) ((clean_pointer((char *) p)) + (int) t); + Traits::pointer(*ptr) = reinterpret_cast + (reinterpret_cast(clean_pointer((char *) p)) + (int) t); } public: