diff --git a/src/Graphic2d/Graphic2d_Buffer.cxx b/src/Graphic2d/Graphic2d_Buffer.cxx index 56d7061888..68432a325d 100755 --- a/src/Graphic2d/Graphic2d_Buffer.cxx +++ b/src/Graphic2d/Graphic2d_Buffer.cxx @@ -311,7 +311,7 @@ printf(" Graphic2d_Buffer::ReLoad(%d)\n",ResetPosition); #endif if( !myDriver.IsNull() ) { - myBufferId = this->HashCode(IntegerLast()); + myBufferId = ::HashCode ((Standard_Address)this, IntegerLast()); // Maximum depth of primitive lines // contained in the buffer is required diff --git a/src/Standard/Standard_Persistent.cxx b/src/Standard/Standard_Persistent.cxx index 9a65e7da91..5f6c4eca94 100755 --- a/src/Standard/Standard_Persistent.cxx +++ b/src/Standard/Standard_Persistent.cxx @@ -96,14 +96,6 @@ Standard_Boolean Standard_Persistent::IsKind (const Handle(Standard_Type)& aType // return (aType == STANDARD_TYPE(Standard_Persistent)); } -//============================================================================ -Standard_Integer Standard_Persistent::HashCode(const Standard_Integer Lim)const -{ - Handle(Standard_Persistent) me = this; - return ::HashCode(me, Lim); -} - - void Standard_Persistent::ShallowDump(Standard_OStream& AStream) const { Handle(Standard_Persistent) me = this; diff --git a/src/Standard/Standard_Persistent_proto.hxx b/src/Standard/Standard_Persistent_proto.hxx index 1134079a14..3e4d4e71fd 100755 --- a/src/Standard/Standard_Persistent_proto.hxx +++ b/src/Standard/Standard_Persistent_proto.hxx @@ -58,7 +58,6 @@ public: Standard_EXPORT virtual const Handle_Standard_Type& DynamicType() const; Standard_EXPORT Standard_Boolean IsKind(const Handle_Standard_Type&)const; Standard_EXPORT Standard_Boolean IsInstance(const Handle_Standard_Type&)const; - Standard_EXPORT virtual Standard_Integer HashCode(const Standard_Integer Upper) const; Standard_EXPORT virtual void ShallowDump(Standard_OStream& ) const; }; diff --git a/src/Standard/Standard_Transient.cxx b/src/Standard/Standard_Transient.cxx index a8f9b25f5a..68be73e837 100755 --- a/src/Standard/Standard_Transient.cxx +++ b/src/Standard/Standard_Transient.cxx @@ -55,13 +55,6 @@ Standard_Boolean Standard_Transient::IsKind (const Standard_CString theTypeName) return DynamicType()->SubType ( theTypeName ); } -//============================================================================ -Standard_Integer Standard_Transient::HashCode(const Standard_Integer Lim) const -{ - return ::HashCode(this, Lim); -} - - void Standard_Transient::ShallowDump(Standard_OStream& theStream) const { theStream << "class " << DynamicType()->Name() << " at " << this << endl; diff --git a/src/Standard/Standard_Transient_proto.hxx b/src/Standard/Standard_Transient_proto.hxx index aedc3d0819..37691716fb 100755 --- a/src/Standard/Standard_Transient_proto.hxx +++ b/src/Standard/Standard_Transient_proto.hxx @@ -52,10 +52,6 @@ class Standard_Transient //! Memory deallocator for transient classes Standard_EXPORT virtual void Delete() const; - //! Returns a hash code value for this object. - //! The value is in the range 1..Upper. - Standard_EXPORT virtual Standard_Integer HashCode(const Standard_Integer Upper) const; - Standard_EXPORT virtual void ShallowDump(Standard_OStream& ) const; //! Returns a type information object about this object. diff --git a/src/TopLoc/TopLoc_Location.cxx b/src/TopLoc/TopLoc_Location.cxx index 776b9462d3..ce00af743d 100755 --- a/src/TopLoc/TopLoc_Location.cxx +++ b/src/TopLoc/TopLoc_Location.cxx @@ -200,7 +200,7 @@ Standard_Integer TopLoc_Location::HashCode(const Standard_Integer upper) const TopLoc_SListOfItemLocation items = myItems; while (items.More()) { depth += 3; - unsigned int i = items.Value().myDatum->HashCode(upper); + unsigned int i = ::HashCode (items.Value().myDatum, upper); unsigned int j = ( (i + items.Value().myPower) <>(32-depth) | j< myImages -> Index ( - anImage -> HashCode( - IntegerLast () - ) + ) +{ + return myWNTWindow -> myImages -> Index ( ::HashCode (anImage, IntegerLast()) ) ? Standard_True : Standard_False; - } // end WNT_WDriver :: IsKnownImage Standard_Boolean WNT_WDriver :: SizeOfImageFile ( @@ -417,9 +413,7 @@ Standard_Boolean WNT_WDriver :: SizeOfImageFile ( void WNT_WDriver :: ClearImage ( const Handle( Standard_Transient )& anImageId ) { Standard_Integer i = myWNTWindow -> myImages -> Index ( - anImageId -> HashCode ( - IntegerLast () - ) + ::HashCode (anImageId, IntegerLast()) ); if ( i ) myWNTWindow -> myImages -> Discard ( i ); @@ -441,9 +435,7 @@ void WNT_WDriver :: DrawImage ( ) { Standard_Integer i = myWNTWindow -> myImages -> Index ( - anImageId -> HashCode ( - IntegerLast () - ) + ::HashCode (anImageId, IntegerLast()) ); if ( i ) A -> Image ( @@ -512,7 +504,7 @@ void WNT_WDriver :: FillAndDrawImage ( hpo = SelectPalette ( hdcMem, ( HPALETTE )gDev -> HPalette (), FALSE ); i = myWNTWindow -> myImages -> Index ( - h = anImageId -> HashCode ( IntegerLast () ) + h = ::HashCode (anImageId, IntegerLast()) ); if ( i == 0 ) i = myWNTWindow -> myImages -> Open ( hdc, Width, Height, h ); @@ -586,7 +578,7 @@ void WNT_WDriver :: FillAndDrawImage ( hpo = SelectPalette ( hdcMem, ( HPALETTE )gDev -> HPalette (), FALSE ); i = myWNTWindow -> myImages -> Index ( - h = anImageId -> HashCode ( IntegerLast () ) + h = ::HashCode (anImageId, IntegerLast()) ); if ( i == 0 ) i = myWNTWindow -> myImages -> Open ( hdc, Width, Height, h ); diff --git a/src/Xw/Xw_Driver.cxx b/src/Xw/Xw_Driver.cxx index c23af3c375..3354637a95 100755 --- a/src/Xw/Xw_Driver.cxx +++ b/src/Xw/Xw_Driver.cxx @@ -865,7 +865,7 @@ Standard_Boolean setattrib = Standard_False; Standard_Boolean Xw_Driver::IsKnownImage(const Handle(Standard_Transient)& anImage) { MyImage = Xw_get_image_handle( MyExtendedDrawable, - (void*)(anImage->HashCode(IntegerLast())) ) ; + (void*)(::HashCode (anImage, IntegerLast())) ) ; if( MyImage ) return (Standard_True) ; else return Standard_False; @@ -899,7 +899,7 @@ float zoom; void Xw_Driver::ClearImage (const Handle(Standard_Transient)& anImage) { MyImage = Xw_get_image_handle( MyExtendedDrawable, - (void*) (anImage->HashCode(IntegerLast())) ) ; + (void*) (::HashCode (anImage, IntegerLast())) ) ; if( MyImage ) { status = Xw_close_image (MyImage); @@ -921,7 +921,7 @@ XW_EXT_IMAGEDATA *pimage; void Xw_Driver::DrawImage (const Handle(Standard_Transient)& anImage, const Standard_ShortReal aX, const Standard_ShortReal aY) { MyImage = Xw_get_image_handle( MyExtendedDrawable, - (void*) (anImage->HashCode(IntegerLast())) ) ; + (void*) (::HashCode (anImage, IntegerLast())) ) ; if( MyImage ) { status = Xw_draw_image (MyExtendedDrawable, MyImage, aX, aY); @@ -973,7 +973,7 @@ GRAPHIC2D_PIXEL pixel; if ((aWidth > 0) && (aHeight > 0)) { if( !MyImage ) { MyImage = Xw_open_image (MyExtendedDrawable, - (void*) (anImage->HashCode(IntegerLast())), + (void*) (::HashCode (anImage, IntegerLast())), int (aWidth),int (aHeight)); } if( !MyImage ) { @@ -1092,7 +1092,7 @@ GRAPHIC2D_PIXEL pixel; if ((aWidth > 0) && (aHeight > 0) && (anIndexOfLine == 0)) { if( !MyImage ) { MyImage = Xw_open_image (MyExtendedDrawable, - (void*) (anImage->HashCode(IntegerLast())), + (void*) (::HashCode (anImage, IntegerLast())), int (aWidth),int (aHeight)); } }