0011758: TCollection strings are not memory safe as reported by Purify
authorvsr <vsr@opencascade.com>
Thu, 22 Aug 2013 07:21:09 +0000 (11:21 +0400)
committerbugmaster <bugmaster@opencascade.com>
Thu, 22 Aug 2013 07:22:51 +0000 (11:22 +0400)
commit29cb310ae9d84501469362415ba4080b55d138fa
treeea4a5e1fa0797424fd501820e813c6f995011500
parent80cd454f1dd08a07538ec79bcda8aeeefb5df44a
0011758: TCollection strings are not memory safe as reported by Purify

Custom string handling code enabled by OptJr macro removed from implementation of strings in TCollection and elsewhere.
Functions from string.h are used instead of macros from Standard_String.hxx
File Standard_String.hxx and methods ISSIMILAR and HASHCODE of TCollection*String classes are removed (to be replaced by strcasecmp).
Functions HashCode for strings reimplemented using DJB2 algorithm for C strings and SDBM algorithm for extended strings.
Adding test cases and draw-command for issue CR11758
Fix misprint added with previous integration
Fix misprint in the test command.
Remove compilation warnings (Linux).
Avoid compiler warning "dereferencing type-punned pointer will break strict-aliasing rules" on Linux
18 files changed:
src/BOPTest/BOPTest_BOPCommands.cxx
src/BRepTest/BRepTest_TopologyCommands.cxx
src/DDataStd/DDataStd_BasicCommands.cxx
src/Image/Image_AlienPixMap.cxx
src/QABugs/QABugs_19.cxx
src/Standard/FILES
src/Standard/Standard_CString.cxx
src/Standard/Standard_CString.hxx
src/Standard/Standard_ExtString.cxx
src/Standard/Standard_String.hxx [deleted file]
src/TCollection/TCollection_AsciiString.cdl
src/TCollection/TCollection_AsciiString.cxx [changed mode: 0755->0644]
src/TCollection/TCollection_AsciiString.lxx
src/TCollection/TCollection_ExtendedString.cxx [changed mode: 0755->0644]
src/TCollection/TCollection_HAsciiString.cxx
src/ViewerTest/ViewerTest.cxx
src/ViewerTest/ViewerTest_ViewerCommands.cxx
tests/bugs/fclasses/bug11758 [new file with mode: 0755]