mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0024171: Eliminate CLang compiler warning -Wreorder
Got rid of -Wreorder warning (wrong fields' initialization order); some warnings -Wdangling-else are also fixed
This commit is contained in:
@@ -563,7 +563,7 @@ VrmlData_ErrorStatus VrmlData_TextureCoordinate::Read
|
||||
// Match the name with the current word in the stream
|
||||
if (VRMLDATA_LCOMPARE (theBuffer.LinePtr, "point"))
|
||||
// Read the body of the data node (comma-separated list of duplets)
|
||||
if (OK(aStatus, VrmlData_Scene::ReadLine(theBuffer)))
|
||||
if (OK(aStatus, VrmlData_Scene::ReadLine(theBuffer))) {
|
||||
if (theBuffer.LinePtr[0] != '[') // opening bracket
|
||||
aStatus = VrmlData_VrmlFormatError;
|
||||
else {
|
||||
@@ -591,6 +591,7 @@ VrmlData_ErrorStatus VrmlData_TextureCoordinate::Read
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (OK(aStatus) && OK(aStatus, readBrace (theBuffer))) {
|
||||
myLength = vecValues.Length();
|
||||
if (myLength > 0) {
|
||||
@@ -652,7 +653,7 @@ VrmlData_ErrorStatus VrmlData_ArrayVec3d::ReadArray
|
||||
theBuffer.LinePtr++;
|
||||
}
|
||||
// Read the body of the data node (list of triplets)
|
||||
if (OK(aStatus) && OK(aStatus, VrmlData_Scene::ReadLine(theBuffer)))
|
||||
if (OK(aStatus) && OK(aStatus, VrmlData_Scene::ReadLine(theBuffer))) {
|
||||
if (theBuffer.LinePtr[0] != '[') // opening bracket
|
||||
aStatus = VrmlData_VrmlFormatError;
|
||||
else {
|
||||
@@ -679,6 +680,7 @@ VrmlData_ErrorStatus VrmlData_ArrayVec3d::ReadArray
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (OK(aStatus) && OK(aStatus, readBrace (theBuffer))) {
|
||||
myLength = vecValues.Length();
|
||||
if (myLength > 0) {
|
||||
|
@@ -66,11 +66,12 @@ VrmlData_ErrorStatus VrmlData_Faceted::readData (VrmlData_InBuffer& theBuffer)
|
||||
} else if (VRMLDATA_LCOMPARE (theBuffer.LinePtr, "creaseAngle")) {
|
||||
Standard_Real anAngle;
|
||||
if (OK(aStatus, Scene().ReadReal (theBuffer, anAngle,
|
||||
Standard_False, Standard_False)))
|
||||
Standard_False, Standard_False))) {
|
||||
if (anAngle < -Precision::Confusion()*0.001)
|
||||
aStatus = VrmlData_IrrelevantNumber;
|
||||
else
|
||||
myCreaseAngle = anAngle;
|
||||
}
|
||||
}
|
||||
return aStatus;
|
||||
}
|
||||
|
@@ -181,11 +181,12 @@ VrmlData_ErrorStatus VrmlData_Node::WriteClosing () const
|
||||
VrmlData_ErrorStatus VrmlData_Node::readBrace (VrmlData_InBuffer& theBuffer)
|
||||
{
|
||||
VrmlData_ErrorStatus aStatus;
|
||||
if (OK(aStatus, VrmlData_Scene::ReadLine(theBuffer)))
|
||||
if (OK(aStatus, VrmlData_Scene::ReadLine(theBuffer))) {
|
||||
if (theBuffer.LinePtr[0] == '}')
|
||||
theBuffer.LinePtr++;
|
||||
else
|
||||
aStatus = VrmlData_VrmlFormatError;
|
||||
}
|
||||
return aStatus;
|
||||
}
|
||||
|
||||
|
@@ -208,13 +208,17 @@ VrmlData_ErrorStatus VrmlData_Scene::readLine (VrmlData_InBuffer& theBuffer)
|
||||
theBuffer.Input.getline (theBuffer.Line, sizeof(theBuffer.Line));
|
||||
theBuffer.LineCount++;
|
||||
const int stat = theBuffer.Input.rdstate();
|
||||
if (stat & ios::badbit)
|
||||
if (stat & ios::badbit) {
|
||||
aStatus = VrmlData_UnrecoverableError;
|
||||
else if (stat & ios::failbit)
|
||||
if (stat & ios::eofbit)
|
||||
}
|
||||
else if (stat & ios::failbit) {
|
||||
if (stat & ios::eofbit) {
|
||||
aStatus = VrmlData_EndOfFile;
|
||||
else
|
||||
}
|
||||
else {
|
||||
aStatus = VrmlData_GeneralError;
|
||||
}
|
||||
}
|
||||
theBuffer.LinePtr = &theBuffer.Line[0];
|
||||
theBuffer.IsProcessed = Standard_False;
|
||||
}
|
||||
@@ -449,7 +453,7 @@ VrmlData_ErrorStatus VrmlData_Scene::createNode
|
||||
TCollection_AsciiString aName;
|
||||
|
||||
// Read the DEF token to assign the node name
|
||||
if (VrmlData_Node::OK(aStatus, ReadLine(theBuffer)))
|
||||
if (VrmlData_Node::OK(aStatus, ReadLine(theBuffer))) {
|
||||
if (VRMLDATA_LCOMPARE(theBuffer.LinePtr, "DEF")) {
|
||||
if (VrmlData_Node::OK(aStatus, ReadWord (theBuffer, aName)))
|
||||
aStatus = ReadLine(theBuffer);
|
||||
@@ -457,6 +461,7 @@ VrmlData_ErrorStatus VrmlData_Scene::createNode
|
||||
theNode.Nullify();
|
||||
return aStatus;
|
||||
}
|
||||
}
|
||||
|
||||
const char * strName = aName.ToCString();
|
||||
if (aStatus == VrmlData_StatusOK) {
|
||||
@@ -517,7 +522,7 @@ VrmlData_ErrorStatus VrmlData_Scene::createNode
|
||||
aStatus = ReadWord (theBuffer, aTitle);
|
||||
if (isProto) {
|
||||
aStatus = ReadLine(theBuffer);
|
||||
if (aStatus == VrmlData_StatusOK)
|
||||
if (aStatus == VrmlData_StatusOK) {
|
||||
if (theBuffer.LinePtr[0] != '[')
|
||||
aStatus = VrmlData_VrmlFormatError;
|
||||
else {
|
||||
@@ -541,6 +546,7 @@ VrmlData_ErrorStatus VrmlData_Scene::createNode
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (aStatus == VrmlData_StatusOK)
|
||||
aNode = new VrmlData_UnknownNode(* this,
|
||||
@@ -550,19 +556,21 @@ VrmlData_ErrorStatus VrmlData_Scene::createNode
|
||||
}
|
||||
aStatus = ReadLine(theBuffer);
|
||||
if (aNode.IsNull() == Standard_False) {
|
||||
if (aNode->Name()[0] != '\0')
|
||||
if (aNode->Name()[0] != '\0')
|
||||
myNamedNodes.Add (aNode);
|
||||
if (theType.IsNull() == Standard_False)
|
||||
if (aNode->IsKind(theType) == Standard_False)
|
||||
aStatus = VrmlData_VrmlFormatError;
|
||||
}
|
||||
if (aStatus == VrmlData_StatusOK)
|
||||
if (aStatus == VrmlData_StatusOK) {
|
||||
if (theBuffer.LinePtr[0] == '{') {
|
||||
theBuffer.LinePtr++;
|
||||
theNode = aNode;
|
||||
myAllNodes.Append(aNode);
|
||||
} else
|
||||
} else {
|
||||
aStatus = VrmlData_VrmlFormatError;
|
||||
}
|
||||
}
|
||||
return aStatus;
|
||||
}
|
||||
|
||||
@@ -718,13 +726,16 @@ VrmlData_ErrorStatus VrmlData_Scene::ReadXYZ
|
||||
theBuffer.LinePtr = endptr;
|
||||
}
|
||||
}
|
||||
if (aStatus == VrmlData_StatusOK)
|
||||
if (isScale)
|
||||
if (aStatus == VrmlData_StatusOK) {
|
||||
if (isScale) {
|
||||
theXYZ.SetCoord (aVal[0] * myLinearScale,
|
||||
aVal[1] * myLinearScale,
|
||||
aVal[2] * myLinearScale);
|
||||
else
|
||||
}
|
||||
else {
|
||||
theXYZ.SetCoord (aVal[0], aVal[1], aVal[2]);
|
||||
}
|
||||
}
|
||||
return aStatus;
|
||||
}
|
||||
|
||||
@@ -757,11 +768,12 @@ VrmlData_ErrorStatus VrmlData_Scene::ReadXY
|
||||
theBuffer.LinePtr = endptr;
|
||||
}
|
||||
}
|
||||
if (aStatus == VrmlData_StatusOK)
|
||||
if (aStatus == VrmlData_StatusOK) {
|
||||
if (isScale)
|
||||
theXY.SetCoord (aVal[0] * myLinearScale, aVal[1] * myLinearScale);
|
||||
else
|
||||
theXY.SetCoord (aVal[0], aVal[1]);
|
||||
}
|
||||
return aStatus;
|
||||
}
|
||||
|
||||
@@ -778,7 +790,7 @@ VrmlData_ErrorStatus VrmlData_Scene::ReadArrIndex
|
||||
{
|
||||
VrmlData_ErrorStatus aStatus;
|
||||
theNBlocks = 0;
|
||||
if (VrmlData_Node::OK(aStatus, ReadLine(theBuffer)))
|
||||
if (VrmlData_Node::OK(aStatus, ReadLine(theBuffer))) {
|
||||
if (theBuffer.LinePtr[0] != '[') // opening bracket
|
||||
aStatus = VrmlData_VrmlFormatError;
|
||||
else {
|
||||
@@ -845,6 +857,7 @@ VrmlData_ErrorStatus VrmlData_Scene::ReadArrIndex
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return aStatus;
|
||||
}
|
||||
|
||||
@@ -915,7 +928,7 @@ VrmlData_ErrorStatus VrmlData_Scene::WriteXYZ
|
||||
const char * thePostfix) const
|
||||
{
|
||||
char buf[240];
|
||||
if (IsDummyWrite() == Standard_False)
|
||||
if (IsDummyWrite() == Standard_False) {
|
||||
if (isApplyScale && myLinearScale > Precision::Confusion())
|
||||
Sprintf (buf, "%.12g %.12g %.12g%s", theXYZ.X() / myLinearScale,
|
||||
theXYZ.Y() / myLinearScale, theXYZ.Z() / myLinearScale,
|
||||
@@ -923,6 +936,7 @@ VrmlData_ErrorStatus VrmlData_Scene::WriteXYZ
|
||||
else
|
||||
Sprintf (buf, "%.12g %.12g %.12g%s", theXYZ.X(), theXYZ.Y(), theXYZ.Z(),
|
||||
thePostfix ? thePostfix : "");
|
||||
}
|
||||
return WriteLine (buf);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user