mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-04 18:06:22 +03:00
0024257: Minor corrections for building / testing on VC++ 11
Several corrections coming from building and testing on MSVC++ 11: - compiler warnings corrected in structiges.c (32-bit mode) and BOPAlgo (64-bit mode) - DRAW command for testing exceptions (OCC6143) refactored for getting some output even if process fails (problem with stack overflow handling) - DRAW command readstep removed as it leads to hang-up in Debug mode due to waiting for user input; the only test that used it changed to use testreadstep command
This commit is contained in:
parent
3054a9f4df
commit
37e640d5bd
@ -96,9 +96,9 @@ void BOPAlgo_Builder::FillImagesFaces()
|
||||
void BOPAlgo_Builder::BuildSplitFaces()
|
||||
{
|
||||
Standard_Boolean bHasFaceInfo, bIsClosed, bIsDegenerated, bToReverse;
|
||||
Standard_Integer i, j, aNbS, aNbPBIn, aNbPBOn, aNbPBSc, aNbAV, nSp;
|
||||
Standard_Integer i, j, k, aNbS, aNbPBIn, aNbPBOn, aNbPBSc, aNbAV, nSp;
|
||||
Standard_Boolean bRunParallel;
|
||||
Standard_Size aNbBF, k;
|
||||
Standard_Size aNbBF;
|
||||
TopoDS_Face aFF, aFSD;
|
||||
TopoDS_Edge aSp, aEE;
|
||||
TopAbs_Orientation anOriF, anOriE;
|
||||
@ -267,7 +267,7 @@ void BOPAlgo_Builder::BuildSplitFaces()
|
||||
BOPAlgo_BuilderFaceCnt::Perform(bRunParallel, aVBF);
|
||||
//===================================================
|
||||
//
|
||||
for (k=0; k<aNbBF; ++k) {
|
||||
for (k=0; k<(Standard_Integer)aNbBF; ++k) {
|
||||
aLFIm.Clear();
|
||||
//
|
||||
BOPAlgo_BuilderFace& aBF=aVBF(k);
|
||||
|
@ -63,7 +63,7 @@ class BOPAlgo_BuilderFaceFunctor {
|
||||
iBeg=aBR.begin();
|
||||
iEnd=aBR.end();
|
||||
for(i=iBeg; i!=iEnd; ++i) {
|
||||
BOPAlgo_BuilderFace& aBF=aVBF(i);
|
||||
BOPAlgo_BuilderFace& aBF=aVBF((Standard_Integer)i);
|
||||
//
|
||||
aBF.Perform();
|
||||
}
|
||||
|
@ -222,13 +222,13 @@ void iges_newparam (int typarg, int longval, char *parval)
|
||||
/* Complement du parametre courant (cf Hollerith sur +ieurs lignes) */
|
||||
void iges_addparam (int longval, char* parval)
|
||||
{
|
||||
char *newval, *oldval; int i;
|
||||
size_t long0;
|
||||
char *newval, *oldval;
|
||||
int i, long0;
|
||||
if (longval <= 0) return;
|
||||
oldval = curparam->parval;
|
||||
long0 = strlen(oldval);
|
||||
long0 = (int)strlen(oldval);
|
||||
/* newval = (char*) malloc(long0+longval+1); */
|
||||
newval = iges_newchar("",(int)long0+longval+1);
|
||||
newval = iges_newchar("",long0+longval+1);
|
||||
for (i = 0; i < long0; i ++) newval[i] = oldval[i];
|
||||
for (i = 0; i < longval; i ++) newval[i+long0] = parval[i];
|
||||
newval[long0+longval] = '\0';
|
||||
|
@ -2380,26 +2380,13 @@ static Standard_Integer OCC5698 (Draw_Interpretor& di, Standard_Integer argc, co
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char sarr[2000];
|
||||
static int si=1;
|
||||
|
||||
#ifdef WNT
|
||||
static int StackOverflow(int i = -1)
|
||||
static int StackOverflow (int i = -1)
|
||||
{
|
||||
char arr[2000];
|
||||
if (si == 1) {
|
||||
si = 0;
|
||||
memcpy(arr,sarr,2000);
|
||||
arr[1999]=0;
|
||||
int n = (int)strlen(arr), s=0;
|
||||
while (n--)
|
||||
s += StackOverflow(i-1);
|
||||
return i + s + StackOverflow(i-1);
|
||||
}
|
||||
else if (i != 0) {
|
||||
return i + StackOverflow(i-1);
|
||||
}
|
||||
si = 1;
|
||||
memset (arr, 0, sizeof(arr));
|
||||
if (i < 0)
|
||||
StackOverflow(i-1);
|
||||
return i;
|
||||
}
|
||||
|
||||
@ -2410,7 +2397,7 @@ static Standard_Integer OCC6143 (Draw_Interpretor& di, Standard_Integer argc, co
|
||||
{
|
||||
if (argc != 1)
|
||||
{
|
||||
di << "Usage : " << argv[0] << "\n";
|
||||
cout << "Usage : " << argv[0] << "\n";
|
||||
return 1;
|
||||
}
|
||||
Standard_Boolean Succes;
|
||||
@ -2421,6 +2408,7 @@ static Standard_Integer OCC6143 (Draw_Interpretor& di, Standard_Integer argc, co
|
||||
{//==== Test Divide ByZero (Integer) ========================================
|
||||
try{
|
||||
OCC_CATCH_SIGNALS
|
||||
cout << "(Integer) Divide By Zero..." << endl;
|
||||
di << "(Integer) Divide By Zero...";
|
||||
//cout.flush();
|
||||
di << "\n";
|
||||
@ -2456,6 +2444,7 @@ static Standard_Integer OCC6143 (Draw_Interpretor& di, Standard_Integer argc, co
|
||||
{//==== Test Divide ByZero (Real) ===========================================
|
||||
try{
|
||||
OCC_CATCH_SIGNALS
|
||||
cout << "(Real) Divide By Zero..." << endl;
|
||||
di << "(Real) Divide By Zero...";
|
||||
//cout.flush();
|
||||
di << "\n";
|
||||
@ -2484,6 +2473,7 @@ static Standard_Integer OCC6143 (Draw_Interpretor& di, Standard_Integer argc, co
|
||||
{//==== Test Overflow (Integer) =============================================
|
||||
try{
|
||||
OCC_CATCH_SIGNALS
|
||||
cout << "(Integer) Overflow..." << endl;
|
||||
di << "(Integer) Overflow...";
|
||||
//cout.flush();
|
||||
di << "\n";
|
||||
@ -2508,6 +2498,7 @@ static Standard_Integer OCC6143 (Draw_Interpretor& di, Standard_Integer argc, co
|
||||
{//==== Test Overflow (Real) ================================================
|
||||
try{
|
||||
OCC_CATCH_SIGNALS
|
||||
cout << "(Real) Overflow..." << endl;
|
||||
di << "(Real) Overflow...";
|
||||
//cout.flush();
|
||||
di << "\n";
|
||||
@ -2539,6 +2530,7 @@ static Standard_Integer OCC6143 (Draw_Interpretor& di, Standard_Integer argc, co
|
||||
{//==== Test Underflow (Real) ===============================================
|
||||
try{
|
||||
OCC_CATCH_SIGNALS
|
||||
cout << "(Real) Underflow" << endl; // to have message in log even if process crashed
|
||||
di << "(Real) Underflow";
|
||||
//cout.flush();
|
||||
di << "\n";
|
||||
@ -2569,6 +2561,7 @@ static Standard_Integer OCC6143 (Draw_Interpretor& di, Standard_Integer argc, co
|
||||
{//==== Test Invalid Operation (Real) ===============================================
|
||||
try{
|
||||
OCC_CATCH_SIGNALS
|
||||
cout << "(Real) Invalid Operation..." << endl;
|
||||
di << "(Real) Invalid Operation...";
|
||||
//cout.flush();
|
||||
di << "\n";
|
||||
@ -2592,6 +2585,7 @@ static Standard_Integer OCC6143 (Draw_Interpretor& di, Standard_Integer argc, co
|
||||
{//==== Test Access Violation ===============================================
|
||||
try {
|
||||
OCC_CATCH_SIGNALS
|
||||
cout << "Segmentation Fault..." << endl;
|
||||
di << "Segmentation Fault...";
|
||||
//cout.flush();
|
||||
di << "\n";
|
||||
@ -2620,6 +2614,7 @@ static Standard_Integer OCC6143 (Draw_Interpretor& di, Standard_Integer argc, co
|
||||
{//==== Test Stack Overflow ===============================================
|
||||
try {
|
||||
OCC_CATCH_SIGNALS
|
||||
cout << "Stack Overflow..." << endl;
|
||||
di << "Stack Overflow...";
|
||||
//cout.flush();
|
||||
di << "\n";
|
||||
|
@ -311,47 +311,6 @@ static Standard_Integer testread (Draw_Interpretor& di, Standard_Integer argc, c
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : readstep
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
static Standard_Integer readstep (Draw_Interpretor& di, Standard_Integer /*argc*/, const char** argv)
|
||||
{
|
||||
// On admet le controller AP214 ou une variante
|
||||
|
||||
|
||||
STEPControl_Reader sr;
|
||||
|
||||
IFSelect_ReturnStatus readstat = IFSelect_RetVoid;
|
||||
|
||||
readstat = sr.ReadFile (argv[1]);
|
||||
|
||||
if (readstat != IFSelect_RetDone) {
|
||||
|
||||
di<<"No model loaded"<<"\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Standard_Integer num = sr.NbRootsForTransfer();
|
||||
Standard_Integer modepri;
|
||||
di<<"NbRootsForTransfer="<<num<<" :\n";
|
||||
|
||||
cout<<"Mode (0 End, 1 root n0 1, 2 one root/n0, 3 one entity/n0, 4 Selection) : "<<flush;
|
||||
cin>>modepri;
|
||||
if (modepri == 0) { di<<"End Reading STEP"<<"\n"; return 0; }
|
||||
|
||||
|
||||
if (!sr.TransferRoot (num)) di<<"Transfer root n0 "<<num<<" : no result"<<"\n";
|
||||
else {
|
||||
TopoDS_Shape sh = sr.OneShape();
|
||||
DBRep::Set (argv[2],sh);
|
||||
}
|
||||
cin>>modepri;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ######## COMMANDE steptrans : teste les transformations #########
|
||||
//=======================================================================
|
||||
//function : steptrans
|
||||
@ -607,6 +566,5 @@ void XSDRAWSTEP::InitCommands (Draw_Interpretor& theCommands)
|
||||
theCommands.Add("steptrans", "steptrans shape stepax1 stepax2", __FILE__, steptrans, g);
|
||||
theCommands.Add("countexpected","TEST", __FILE__, countexpected, g);
|
||||
theCommands.Add("dumpassembly", "TEST", __FILE__, dumpassembly, g);
|
||||
theCommands.Add("readstep", "readstep [file]", __FILE__, readstep, g);
|
||||
theCommands.Add("stepfileunits" , "stepfileunits name_file", __FILE__, stepfileunits, g);
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ puts ""
|
||||
# Incorrect faces of the filleted cube after import from iges file
|
||||
#######################################################################
|
||||
|
||||
readstep [locate_data_file bug22715_cube.stp] s1 *
|
||||
testreadstep [locate_data_file bug22715_cube.stp] s1
|
||||
puts [whatis s1]
|
||||
explode s1 F
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user