From: Ivan Maidanski Date: Tue, 13 Sep 2016 18:22:24 +0000 (+0300) Subject: Eliminate 'C-style pointer casting' cppcheck style warnings in test X-Git-Tag: v8.0.0~1155 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=83b7e0e6ecb27ca2c99a05435cc74ba2db2f959f;p=gc Eliminate 'C-style pointer casting' cppcheck style warnings in test * tests/test_cpp.cc (D::CleanUp, main): Use static_cast instead of C-style pointer cast. --- diff --git a/tests/test_cpp.cc b/tests/test_cpp.cc index 041151ca..ed98fb73 100644 --- a/tests/test_cpp.cc +++ b/tests/test_cpp.cc @@ -136,7 +136,7 @@ class D: public GC_NS_QUALIFY(gc) { public: D( int iArg ): i( iArg ) { nAllocated++;} static void CleanUp( void* obj, void* data ) { - D* self = (D*) obj; + D* self = static_cast(obj); nFreed++; my_assert( self->i == (int) (GC_word) data );} static void Test() { @@ -288,8 +288,8 @@ void* Undisguise( GC_word i ) { /* Make sure the uncollectible As and Bs are still there. */ for (i = 0; i < 1000; i++) { - A* a = (A*) Undisguise( as[ i ] ); - B* b = (B*) Undisguise( bs[ i ] ); + A* a = static_cast(Undisguise(as[i])); + B* b = static_cast(Undisguise(bs[i])); a->Test( i ); delete a; b->Test( i );