summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQbProg <tholag@gmail.com>2011-06-19 18:14:47 +0200
committerQbProg <tholag@gmail.com>2011-06-19 18:31:01 +0200
commit5fb069b47c23265ecb433bc03f71d1a85258782b (patch)
treeb63e2505ee5319efec5c34de11143ff22d0e35ae
parent80288ae43cf2acbad4f50e3f0a2b44b298e2b5df (diff)
downloadoce-5fb069b47c23265ecb433bc03f71d1a85258782b.tar.gz
oce-5fb069b47c23265ecb433bc03f71d1a85258782b.zip
[warning-fix][assignment-in-conditional-expression]
Fixes warnings like : assignment in conditional expression
-rw-r--r--src/BRepClass3d/BRepClass3d_Intersector3d.cxx4
-rw-r--r--src/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx8
-rw-r--r--src/CGM/Gestfic.cxx4
-rw-r--r--src/Graphic2d/Graphic2d_Drawer.cxx2
-rw-r--r--src/Graphic2d/Graphic2d_FramedText.cxx6
-rw-r--r--src/Graphic2d/Graphic2d_HidingText.cxx6
-rw-r--r--src/Graphic2d/Graphic2d_Paragraph.cxx2
-rw-r--r--src/Graphic2d/Graphic2d_Text.cxx6
-rw-r--r--src/IntTools/IntTools_FClass2d.cxx4
-rw-r--r--src/OpenGl/OpenGl_togl_begin_animation.cxx2
-rw-r--r--src/OpenGl/OpenGl_txgl.cxx4
-rw-r--r--src/PlotMgt/PlotMgt_Plotter.cxx2
-rw-r--r--src/Standard/Standard.cxx14
-rw-r--r--src/TDataXtd/TDataXtd_Constraint.cxx2
-rw-r--r--src/Visual3d/Visual3d_View.cxx6
15 files changed, 34 insertions, 38 deletions
diff --git a/src/BRepClass3d/BRepClass3d_Intersector3d.cxx b/src/BRepClass3d/BRepClass3d_Intersector3d.cxx
index cc235adc..000f1a2f 100644
--- a/src/BRepClass3d/BRepClass3d_Intersector3d.cxx
+++ b/src/BRepClass3d/BRepClass3d_Intersector3d.cxx
@@ -48,9 +48,9 @@ void BRepClass3d_Intersector3d::Perform(const gp_Lin& L,
Standard_Boolean IsUPer, IsVPer;
Standard_Real uperiod=0, vperiod=0;
- if ((IsUPer = surface.IsUPeriodic()))
+ if ((IsUPer = surface.IsUPeriodic()) == Standard_True)
uperiod = surface.UPeriod();
- if ((IsVPer = surface.IsVPeriodic()))
+ if ((IsVPer = surface.IsVPeriodic()) == Standard_True)
vperiod = surface.VPeriod();
Standard_Real U1, U2, V1, V2;
diff --git a/src/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx b/src/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx
index b2b45aa7..74454b48 100644
--- a/src/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx
+++ b/src/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx
@@ -411,9 +411,9 @@ TopAbs_State BRepTopAdaptor_FClass2d::Perform(const gp_Pnt2d& _Puv,
surf->ChangeSurface().Initialize( Face, Standard_False );
Standard_Boolean IsUPer, IsVPer;
Standard_Real uperiod=0, vperiod=0;
- if ((IsUPer = surf->IsUPeriodic()))
+ if ((IsUPer = surf->IsUPeriodic()) == Standard_True)
uperiod = surf->UPeriod();
- if ((IsVPer = surf->IsVPeriodic()))
+ if ((IsVPer = surf->IsVPeriodic()) == Standard_True)
vperiod = surf->VPeriod();
TopAbs_State Status = TopAbs_UNKNOWN;
Standard_Boolean urecadre = Standard_False, vrecadre = Standard_False;
@@ -547,9 +547,9 @@ TopAbs_State BRepTopAdaptor_FClass2d::TestOnRestriction(const gp_Pnt2d& _Puv,
surf->ChangeSurface().Initialize( Face, Standard_False );
Standard_Boolean IsUPer, IsVPer;
Standard_Real uperiod=0, vperiod=0;
- if ((IsUPer = surf->IsUPeriodic()))
+ if ((IsUPer = surf->IsUPeriodic()) == Standard_True)
uperiod = surf->UPeriod();
- if ((IsVPer = surf->IsVPeriodic()))
+ if ((IsVPer = surf->IsVPeriodic())== Standard_True)
vperiod = surf->VPeriod();
TopAbs_State Status = TopAbs_UNKNOWN;
Standard_Boolean urecadre = Standard_False, vrecadre = Standard_False;
diff --git a/src/CGM/Gestfic.cxx b/src/CGM/Gestfic.cxx
index 59a85d57..dcf6e80c 100644
--- a/src/CGM/Gestfic.cxx
+++ b/src/CGM/Gestfic.cxx
@@ -12,7 +12,7 @@ FILE* OPEN_FILE (char* f_name, int TypeCgm)
switch (TypeCgm){
case 1:
case 2:
- if ((filed = fopen(f_name,"wb" ))) {
+ if ((filed = fopen(f_name,"wb" )) != NULL) {
#ifdef WNT
chmod (f_name, S_IREAD | S_IWRITE);
#else
@@ -22,7 +22,7 @@ FILE* OPEN_FILE (char* f_name, int TypeCgm)
}
break;
case 3:
- if ((filed = fopen(f_name,"w" ))) {
+ if ((filed = fopen(f_name,"w" )) != NULL) {
#ifdef WNT
chmod (f_name, S_IREAD | S_IWRITE);
#else
diff --git a/src/Graphic2d/Graphic2d_Drawer.cxx b/src/Graphic2d/Graphic2d_Drawer.cxx
index f8bebed3..9e9044ae 100644
--- a/src/Graphic2d/Graphic2d_Drawer.cxx
+++ b/src/Graphic2d/Graphic2d_Drawer.cxx
@@ -334,7 +334,7 @@ Standard_Boolean Graphic2d_Drawer::GetImageSize(
Standard_Integer width,height;
if( myDriverIsDefined ) {
- if(( theStatus = myDriver->SizeOfImageFile(aFileName,width,height))){
+ if(( theStatus = myDriver->SizeOfImageFile(aFileName,width,height)) == Standard_True ){
aWidth = Standard_ShortReal(myDriver->Convert(width)/Scale());
aHeight = Standard_ShortReal(myDriver->Convert(height)/Scale());
}
diff --git a/src/Graphic2d/Graphic2d_FramedText.cxx b/src/Graphic2d/Graphic2d_FramedText.cxx
index 00e4d56a..d3cdbfe3 100644
--- a/src/Graphic2d/Graphic2d_FramedText.cxx
+++ b/src/Graphic2d/Graphic2d_FramedText.cxx
@@ -239,7 +239,7 @@ Standard_ShortReal wscale,hscale;
Standard_Boolean status;
myAdjustFlag = Adjust;
- if(( status = TextSize(twidth,theight,xoffset,yoffset) )) {
+ if(( status = TextSize(twidth,theight,xoffset,yoffset) ) == Standard_True ) {
wscale = Standard_ShortReal( aWidth/twidth );
if( wscale > 0. ) {
if( Expand || (twidth > aWidth) ) myWScale *= wscale;
@@ -263,7 +263,7 @@ Quantity_Length twidth,theight,txoffset,tyoffset;
//Standard_ShortReal wscale,hscale;
Standard_Boolean status;
- if(( status = TextSize(twidth,theight,txoffset,tyoffset) )) {
+ if(( status = TextSize(twidth,theight,txoffset,tyoffset) ) == Standard_True ) {
Standard_Integer l = myText.Length();
while( (l > 1) && (twidth > aWidth) ) {
--l;
@@ -298,7 +298,7 @@ Standard_Boolean status = Standard_False;
Standard_ShortReal width,height,xoffset,yoffset;
aDrawer->SetTextAttrib(myColorIndex,myFontIndex,
mySlant,hscale,wscale,myIsUnderlined);
- if(( status = aDrawer->GetTextSize(myText,width,height,xoffset,yoffset) )) {
+ if(( status = aDrawer->GetTextSize(myText,width,height,xoffset,yoffset) ) == Standard_True ) {
Standard_ShortReal dxm,dym;
#ifndef PERF
myResetFlag = Standard_False;
diff --git a/src/Graphic2d/Graphic2d_HidingText.cxx b/src/Graphic2d/Graphic2d_HidingText.cxx
index 6a5581ab..a5872d15 100644
--- a/src/Graphic2d/Graphic2d_HidingText.cxx
+++ b/src/Graphic2d/Graphic2d_HidingText.cxx
@@ -255,7 +255,7 @@ Standard_ShortReal wscale,hscale;
Standard_Boolean status;
myAdjustFlag = Adjust;
- if(( status = TextSize(twidth,theight,xoffset,yoffset) )) {
+ if(( status = TextSize(twidth,theight,xoffset,yoffset) ) == Standard_True ) {
wscale = Standard_ShortReal( aWidth/twidth );
if( wscale > 0. ) {
if( Expand || (twidth > aWidth) ) myWScale *= wscale;
@@ -279,7 +279,7 @@ Quantity_Length twidth,theight,txoffset,tyoffset;
//Standard_ShortReal wscale,hscale;
Standard_Boolean status;
- if(( status = TextSize(twidth,theight,txoffset,tyoffset) )) {
+ if(( status = TextSize(twidth,theight,txoffset,tyoffset) ) == Standard_True ) {
Standard_Integer l = myText.Length();
while( (l > 1) && (twidth > aWidth) ) {
--l;
@@ -314,7 +314,7 @@ Standard_Boolean status = Standard_False;
Standard_ShortReal width,height,xoffset,yoffset;
aDrawer->SetTextAttrib(myColorIndex,myFontIndex,
mySlant,hscale,wscale,myIsUnderlined);
- if(( status = aDrawer->GetTextSize(myText,width,height,xoffset,yoffset) )) {
+ if(( status = aDrawer->GetTextSize(myText,width,height,xoffset,yoffset) ) == Standard_True ) {
Standard_ShortReal dxm,dym;
#ifndef PERF
myResetFlag = Standard_False;
diff --git a/src/Graphic2d/Graphic2d_Paragraph.cxx b/src/Graphic2d/Graphic2d_Paragraph.cxx
index 12a9c41d..2a2043c0 100644
--- a/src/Graphic2d/Graphic2d_Paragraph.cxx
+++ b/src/Graphic2d/Graphic2d_Paragraph.cxx
@@ -752,7 +752,7 @@ Standard_Boolean status = Standard_False;
static TCollection_ExtendedString hletter("Hp");
Standard_ShortReal hwidth,hheight,hxoffset,hyoffset;
if(( status = aDrawer->GetTextSize(hletter,hwidth,hheight,
- hxoffset,hyoffset) )) {
+ hxoffset,hyoffset) ) == Standard_True ) {
theight = Max(hheight-hyoffset,theight-tyoffset);
tyoffset = Max(hyoffset,tyoffset);
}
diff --git a/src/Graphic2d/Graphic2d_Text.cxx b/src/Graphic2d/Graphic2d_Text.cxx
index ab6db6fe..d2e38097 100644
--- a/src/Graphic2d/Graphic2d_Text.cxx
+++ b/src/Graphic2d/Graphic2d_Text.cxx
@@ -371,7 +371,7 @@ Standard_ShortReal wscale,hscale;
Standard_Boolean status;
myAdjustFlag = Adjust;
- if(( status = TextSize(twidth,theight,txoffset,tyoffset) )) {
+ if(( status = TextSize(twidth,theight,txoffset,tyoffset) ) == Standard_True ) {
wscale = Standard_ShortReal(aWidth/twidth);
if( wscale > 0. ) {
if( Expand || (twidth > aWidth) ) myWScale *= wscale;
@@ -395,7 +395,7 @@ Quantity_Length twidth,theight,txoffset,tyoffset;
//Standard_ShortReal wscale,hscale;
Standard_Boolean status;
- if(( status = TextSize(twidth,theight,txoffset,tyoffset) )) {
+ if(( status = TextSize(twidth,theight,txoffset,tyoffset) ) == Standard_True ) {
Standard_Integer l = myText.Length();
while( (l > 1) && (twidth > aWidth) ) {
--l;
@@ -427,7 +427,7 @@ Standard_Boolean status = Standard_False;
aDrawer->SetTextAttrib(myColorIndex,myFontIndex,
mySlant,hscale,wscale,myIsUnderlined);
if(( status =
- aDrawer->GetTextSize(myText,width,height,xoffset,yoffset) )) {
+ aDrawer->GetTextSize(myText,width,height,xoffset,yoffset) ) == Standard_True ) {
#ifndef PERF
myResetFlag = Standard_False;
#endif
diff --git a/src/IntTools/IntTools_FClass2d.cxx b/src/IntTools/IntTools_FClass2d.cxx
index 1a25caf5..1983bad2 100644
--- a/src/IntTools/IntTools_FClass2d.cxx
+++ b/src/IntTools/IntTools_FClass2d.cxx
@@ -686,9 +686,9 @@
surf->ChangeSurface().Initialize( Face, Standard_False );
Standard_Boolean IsUPer, IsVPer;
Standard_Real uperiod=0, vperiod=0;
- if ((IsUPer = surf->IsUPeriodic()))
+ if ((IsUPer = surf->IsUPeriodic()) == Standard_True)
uperiod = surf->UPeriod();
- if ((IsVPer = surf->IsVPeriodic()))
+ if ((IsVPer = surf->IsVPeriodic()) == Standard_True)
vperiod = surf->VPeriod();
TopAbs_State Status = TopAbs_UNKNOWN;
Standard_Boolean urecadre = Standard_False, vrecadre = Standard_False;
diff --git a/src/OpenGl/OpenGl_togl_begin_animation.cxx b/src/OpenGl/OpenGl_togl_begin_animation.cxx
index 7ef68a62..3b2d7965 100644
--- a/src/OpenGl/OpenGl_togl_begin_animation.cxx
+++ b/src/OpenGl/OpenGl_togl_begin_animation.cxx
@@ -103,7 +103,7 @@ call_togl_begin_animation
#ifdef G003
g_fAnimation = GL_TRUE;
g_fList = GL_FALSE;
- g_fDegeneration = aview -> IsDegenerates;
+ g_fDegeneration = aview->IsDegenerates != 0;
g_fUpdateAM = ( aview -> IsDegenerates ==
aview -> IsDegeneratesPrev
) ? GL_FALSE : GL_TRUE;
diff --git a/src/OpenGl/OpenGl_txgl.cxx b/src/OpenGl/OpenGl_txgl.cxx
index 38888941..70a6c372 100644
--- a/src/OpenGl/OpenGl_txgl.cxx
+++ b/src/OpenGl/OpenGl_txgl.cxx
@@ -385,7 +385,6 @@ __declspec( dllexport ) int __fastcall __OpenGl_INIT__ (
HTBL_ENTRY* hte;
PIXELFORMATDESCRIPTOR pfd;
- BOOL DBuffer = TRUE;
int iPixelFormat;
char string[ CALL_DEF_STRING_LENGTH ];
@@ -564,7 +563,6 @@ __declspec( dllexport ) int __fastcall __OpenGl_INIT__ (
cmn_htbl_elem rec;*/
HTBL_ENTRY* hte;
PIXELFORMATDESCRIPTOR pfd;
- BOOL DBuffer = TRUE;
int iPixelFormat;
char string[ CALL_DEF_STRING_LENGTH ];
@@ -684,8 +682,6 @@ __declspec( dllexport ) int __fastcall __OpenGl_INIT__ (
#else /* WNT */
HTBL_ENTRY* hte;
- HDC hdc = NULL;
- HGLRC hglrc = NULL;
TStatus retVal = TFailure;
__try {
diff --git a/src/PlotMgt/PlotMgt_Plotter.cxx b/src/PlotMgt/PlotMgt_Plotter.cxx
index e5c5628b..1c5296d4 100644
--- a/src/PlotMgt/PlotMgt_Plotter.cxx
+++ b/src/PlotMgt/PlotMgt_Plotter.cxx
@@ -416,7 +416,7 @@ Standard_Boolean PlotMgt_Plotter::ReadParametersFromFile (
STRING_TRIM(aParamDef);
aParamDef.Prepend (TCollection_AsciiString ("."));
}
- if ((idx = FindParameter(aParamName))) {
+ if ((idx = FindParameter(aParamName)) != 0) {
aParameter = myParameters -> Value (idx);
} else {
aParameter = new PlotMgt_PlotterParameter (aParamName);
diff --git a/src/Standard/Standard.cxx b/src/Standard/Standard.cxx
index 8e31453e..6d03f8a1 100644
--- a/src/Standard/Standard.cxx
+++ b/src/Standard/Standard.cxx
@@ -41,13 +41,13 @@ Standard_MMgrFactory::Standard_MMgrFactory() : myFMMgr(0)
Standard_Boolean bClear, bMMap, bReentrant;
Standard_Integer aCellSize, aNbPages, aThreshold, bOptAlloc;
//
- bOptAlloc = atoi((var = getenv("MMGT_OPT" )) ? var : "1" );
- bClear = atoi((var = getenv("MMGT_CLEAR" )) ? var : "1" );
- bMMap = atoi((var = getenv("MMGT_MMAP" )) ? var : "1" );
- aCellSize = atoi((var = getenv("MMGT_CELLSIZE" )) ? var : "200" );
- aNbPages = atoi((var = getenv("MMGT_NBPAGES" )) ? var : "1000" );
- aThreshold = atoi((var = getenv("MMGT_THRESHOLD")) ? var : "40000");
- bReentrant = atoi((var = getenv("MMGT_REENTRANT")) ? var : "0" );
+ bOptAlloc = atoi(((var = getenv("MMGT_OPT" )) != NULL) ? var : "1" );
+ bClear = atoi(((var = getenv("MMGT_CLEAR" )) != NULL) ? var : "1" );
+ bMMap = atoi(((var = getenv("MMGT_MMAP" )) != NULL) ? var : "1" );
+ aCellSize = atoi(((var = getenv("MMGT_CELLSIZE" )) != NULL) ? var : "200" );
+ aNbPages = atoi(((var = getenv("MMGT_NBPAGES" )) != NULL) ? var : "1000" );
+ aThreshold = atoi(((var = getenv("MMGT_THRESHOLD")) != NULL) ? var : "40000");
+ bReentrant = atoi(((var = getenv("MMGT_REENTRANT")) != NULL) ? var : "0" );
if ( bOptAlloc == 1 ) {
myFMMgr = new Standard_MMgrOpt(bClear, bMMap, aCellSize, aNbPages,
diff --git a/src/TDataXtd/TDataXtd_Constraint.cxx b/src/TDataXtd/TDataXtd_Constraint.cxx
index 1f92d24a..68ebf618 100644
--- a/src/TDataXtd/TDataXtd_Constraint.cxx
+++ b/src/TDataXtd/TDataXtd_Constraint.cxx
@@ -216,7 +216,7 @@ const Handle(TNaming_NamedShape)& TDataXtd_Constraint::GetPlane() const
void TDataXtd_Constraint::SetType (const TDataXtd_ConstraintEnum CTR)
{
// OCC2932 correction
- if(myType = CTR) return;
+ if((myType = CTR) != 0) return;
Backup();
myType = CTR;
diff --git a/src/Visual3d/Visual3d_View.cxx b/src/Visual3d/Visual3d_View.cxx
index 3b13b66a..e1becd00 100644
--- a/src/Visual3d/Visual3d_View.cxx
+++ b/src/Visual3d/Visual3d_View.cxx
@@ -1165,7 +1165,7 @@ Standard_Real Sx, Sy, Sz;
MyCView.Orientation.ViewScaleZ = float (Sz);
CustomIsModified =
- MyCView.Orientation.IsCustomMatrix != MyViewOrientation.IsCustomMatrix(); // note: warning should be removed by changing .IsCustomMatrix type
+ Standard_Boolean(MyCView.Orientation.IsCustomMatrix != 0) != MyViewOrientation.IsCustomMatrix(); // note: warning should be removed by changing .IsCustomMatrix type
MyCView.Orientation.IsCustomMatrix = MyViewOrientation.IsCustomMatrix();
if ( MyViewOrientation.IsCustomMatrix() ) {
Standard_Integer i, j;
@@ -1280,7 +1280,7 @@ Standard_Real Sx, Sy, Sz;
MyCView.Orientation.ViewScaleZ = float (Sz);
CustomIsModified =
- MyCView.Orientation.IsCustomMatrix != MyViewOrientation.IsCustomMatrix(); // note: warning should be removed by changing .IsCustomMatrix type
+ Standard_Boolean(MyCView.Orientation.IsCustomMatrix != 0) != MyViewOrientation.IsCustomMatrix(); // note: warning should be removed by changing .IsCustomMatrix type
MyCView.Orientation.IsCustomMatrix = MyViewOrientation.IsCustomMatrix();
if ( MyViewOrientation.IsCustomMatrix() ) {
Standard_Integer i, j;
@@ -4002,7 +4002,7 @@ void Visual3d_View :: SetComputedMode ( const Standard_Boolean aMode ) {
Standard_Integer StructId;
Standard_Integer i = MyDisplayedStructure.Extent ();
- if ( !( ComputedModeIsActive = aMode ) ) {
+ if ( !( (ComputedModeIsActive = aMode) != 0 ) ) {
while ( S1Iterator.More () ) {