mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-05 18:16:23 +03:00
0030684: Coding Rules - eliminate GCC compiler warnings -Wformat-overflow and -Wcatch-value
This commit is contained in:
parent
b44bf0f8fe
commit
1ac1059961
@ -56,7 +56,7 @@ Standard_Boolean Storage_TypeData::Read (Storage_BaseDriver& theDriver)
|
|||||||
OCC_CATCH_SIGNALS
|
OCC_CATCH_SIGNALS
|
||||||
theDriver.ReadTypeInformations (aTypeNum, aTypeName);
|
theDriver.ReadTypeInformations (aTypeNum, aTypeName);
|
||||||
}
|
}
|
||||||
catch (Storage_StreamTypeMismatchError)
|
catch (const Storage_StreamTypeMismatchError&)
|
||||||
{
|
{
|
||||||
myErrorStatus = Storage_VSTypeMismatch;
|
myErrorStatus = Storage_VSTypeMismatch;
|
||||||
myErrorStatusExt = "ReadTypeInformations";
|
myErrorStatusExt = "ReadTypeInformations";
|
||||||
|
@ -282,7 +282,7 @@ static IFSelect_ReturnStatus XSControl_traccess
|
|||||||
// **** trscomp (comp -> save) **** 29
|
// **** trscomp (comp -> save) **** 29
|
||||||
Standard_Boolean cascomp = (pilot->Word(0).Location(1,'o',1,5) > 0);
|
Standard_Boolean cascomp = (pilot->Word(0).Location(1,'o',1,5) > 0);
|
||||||
Standard_Boolean cassave = (pilot->Word(0).Location(1,'s',1,5) > 0);
|
Standard_Boolean cassave = (pilot->Word(0).Location(1,'s',1,5) > 0);
|
||||||
char nomsh[100], noms[100];
|
TCollection_AsciiString nomsh, noms;
|
||||||
const Handle(XSControl_TransferReader) &TR = XSControl::Session(pilot)->TransferReader();
|
const Handle(XSControl_TransferReader) &TR = XSControl::Session(pilot)->TransferReader();
|
||||||
Handle(Message_Messenger) sout = Message::DefaultMessenger();
|
Handle(Message_Messenger) sout = Message::DefaultMessenger();
|
||||||
if (TR.IsNull()) { sout<<" manque init"<<endl; return IFSelect_RetError; }
|
if (TR.IsNull()) { sout<<" manque init"<<endl; return IFSelect_RetError; }
|
||||||
@ -290,8 +290,8 @@ static IFSelect_ReturnStatus XSControl_traccess
|
|||||||
if (mdl.IsNull()) { sout<<" modele absent"<<endl; return IFSelect_RetError; }
|
if (mdl.IsNull()) { sout<<" modele absent"<<endl; return IFSelect_RetError; }
|
||||||
Standard_Integer num = (argc > 1 ? IFSelect_Functions::GiveEntityNumber(XSControl::Session(pilot),arg1) : 0);
|
Standard_Integer num = (argc > 1 ? IFSelect_Functions::GiveEntityNumber(XSControl::Session(pilot),arg1) : 0);
|
||||||
|
|
||||||
if (argc > 1) strcpy (nomsh,arg1);
|
if (argc > 1) nomsh = arg1;
|
||||||
else strcpy (nomsh,(cascomp ? "TREAD_COMP" : "TREAD_LIST"));
|
else nomsh = cascomp ? "TREAD_COMP" : "TREAD_LIST";
|
||||||
if (cassave) sout<<" save shapes -> current directory"<<endl;
|
if (cassave) sout<<" save shapes -> current directory"<<endl;
|
||||||
|
|
||||||
if (num == 0 || cascomp) {
|
if (num == 0 || cascomp) {
|
||||||
@ -300,30 +300,30 @@ static IFSelect_ReturnStatus XSControl_traccess
|
|||||||
B.MakeCompound(C);
|
B.MakeCompound(C);
|
||||||
|
|
||||||
const Handle(TopTools_HSequenceOfShape) &list = TR->ShapeResultList(Standard_True);
|
const Handle(TopTools_HSequenceOfShape) &list = TR->ShapeResultList(Standard_True);
|
||||||
Standard_Integer i, nb = list->Length();
|
sout<<" TOUS RESULTATS par ShapeResultList, soit "<<list->Length()<<endl;
|
||||||
sout<<" TOUS RESULTATS par ShapeResultList, soit "<<nb<<endl;
|
for (Standard_Integer i = 1, nb = list->Length(); i <= nb; ++i)
|
||||||
for (i = 1; i <= nb; i ++) {
|
{
|
||||||
sprintf (noms,"%s_%d",nomsh,i);
|
noms = nomsh + "_" + i;
|
||||||
if ( (i%1000) == 0) sout<<"("<<i<<")"<<endl;
|
if ( (i%1000) == 0) sout<<"("<<i<<")"<<endl;
|
||||||
else if ( (i%100) == 0) sout<<"*";
|
else if ( (i%100) == 0) sout<<"*";
|
||||||
else if ( (i%10) == 0) sout<<"0";
|
else if ( (i%10) == 0) sout<<"0";
|
||||||
else sout<<".";
|
else sout<<".";
|
||||||
if (list->Value(i).IsNull()) continue;
|
if (list->Value(i).IsNull()) continue;
|
||||||
if (!cascomp && !cassave) XSControl::Vars(pilot)->SetShape(noms,list->Value(i));
|
if (!cascomp && !cassave) XSControl::Vars(pilot)->SetShape (noms.ToCString(), list->Value(i));
|
||||||
else if (!cascomp && cassave) BRepTools::Write (list->Value(i),noms);
|
else if (!cascomp && cassave) BRepTools::Write (list->Value(i), noms.ToCString());
|
||||||
else if (cascomp) B.Add (C,list->Value(i));
|
else if (cascomp) B.Add (C,list->Value(i));
|
||||||
}
|
}
|
||||||
sout<<endl;
|
sout<<endl;
|
||||||
if (cascomp && !cassave) XSControl::Vars(pilot)->SetShape(nomsh,C);
|
if (cascomp && !cassave) XSControl::Vars(pilot)->SetShape (nomsh.ToCString(), C);
|
||||||
else if (cascomp && cassave) BRepTools::Write (C,nomsh);
|
else if (cascomp && cassave) BRepTools::Write (C, nomsh.ToCString());
|
||||||
} else {
|
} else {
|
||||||
if (num < 1 || num > mdl->NbEntities()) { sout<<" incorrect:"<<arg1<<endl; return IFSelect_RetError; }
|
if (num < 1 || num > mdl->NbEntities()) { sout<<" incorrect:"<<arg1<<endl; return IFSelect_RetError; }
|
||||||
TopoDS_Shape sh = TR->ShapeResult(mdl->Value(num));
|
TopoDS_Shape sh = TR->ShapeResult(mdl->Value(num));
|
||||||
if (sh.IsNull()) { sout<<" Pas de resultat pour "<<arg1<<endl; return IFSelect_RetError; }
|
if (sh.IsNull()) { sout<<" Pas de resultat pour "<<arg1<<endl; return IFSelect_RetError; }
|
||||||
if (argc > 2) sprintf (nomsh,"%s",arg2);
|
if (argc > 2) nomsh = arg2;
|
||||||
else sprintf (nomsh,"TREAD_%d",num);
|
else nomsh = TCollection_AsciiString ("TREAD_") + num;
|
||||||
if (!cascomp && !cassave) XSControl::Vars(pilot)->SetShape(nomsh,sh);
|
if (!cascomp && !cassave) XSControl::Vars(pilot)->SetShape (nomsh.ToCString(), sh);
|
||||||
else if (!cascomp && cassave) BRepTools::Write (sh,nomsh);
|
else if (!cascomp && cassave) BRepTools::Write (sh, nomsh.ToCString());
|
||||||
else sout<<"Option non comprise"<<endl;
|
else sout<<"Option non comprise"<<endl;
|
||||||
}
|
}
|
||||||
return IFSelect_RetDone;
|
return IFSelect_RetDone;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user