1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0029355: OCCT 6.9.1 persistence restored in OCCT 7.2.0 not working

Auxiliary classes StdObjMgt_ReadData::Object and StdObjMgt_WriteData::Object are renamed to "ObjectSentry" (to better reflect their nature); constructor is made explicit to ensure that such objects are always created intentionally.
These objects are instantiated explicitly in the body of relevant functions, instead of implicit creation as temporary objects when function requires such object as argument.
Variable used to get char from stream is nullified in several places in FSD_File and other classes, to avoid possible usage of uninitialized memory in case if stream is bad.
This commit is contained in:
abv
2017-12-02 11:24:58 +03:00
committed by bugmaster
parent 67160f4e79
commit 472433e2c7
18 changed files with 210 additions and 142 deletions

View File

@@ -281,7 +281,7 @@ void DDF_IOStream::ReadExtendedLine(TCollection_ExtendedString& buffer)
void DDF_IOStream::ReadChar(TCollection_AsciiString& buffer, const Standard_Integer rsize)
{
char c;
char c = '\0';
Standard_Integer ccount = 0;
buffer.Clear();
@@ -1216,7 +1216,7 @@ Storage_Error DDF_IOStream::BeginReadDataSection()
void DDF_IOStream::ReadPersistentObjectHeader(Standard_Integer& aRef,
Standard_Integer& aType)
{
char c;
char c = '\0';
myIStream->get(c);
@@ -1256,7 +1256,7 @@ void DDF_IOStream::ReadPersistentObjectHeader(Standard_Integer& aRef,
void DDF_IOStream::BeginReadPersistentObjectData()
{
char c;
char c = '\0';
myIStream->get(c);
while (c != '(') {
if (IsEnd() || (c != ' ') || (c == '\n')) {
@@ -1273,7 +1273,7 @@ void DDF_IOStream::BeginReadPersistentObjectData()
void DDF_IOStream::BeginReadObjectData()
{
char c;
char c = '\0';
myIStream->get(c);
while (c != '(') {
if (IsEnd() || (c != ' ') || (c == '\n')) {
@@ -1290,7 +1290,7 @@ void DDF_IOStream::BeginReadObjectData()
void DDF_IOStream::EndReadObjectData()
{
char c;
char c = '\0';
myIStream->get(c);
while (c != ')') {
if (IsEnd() || (c != ' ') || (c == '\n')) {
@@ -1307,7 +1307,7 @@ void DDF_IOStream::EndReadObjectData()
void DDF_IOStream::EndReadPersistentObjectData()
{
char c;
char c = '\0';
myIStream->get(c);
while (c != ')') {