From 23bbd9d392a11a4f7324a0b735bde83e8df93aba Mon Sep 17 00:00:00 2001 From: abv Date: Fri, 7 Dec 2012 10:31:38 +0400 Subject: [PATCH] 0023599: Some MFC samples are crached during launching Fixing compiler warnings in MFC samples (MSVC compiler) File .gitignore modified to ignore files generated by VS 2012 --- .gitignore | 8 ++++++-- samples/mfc/standard/04_Viewer3d/src/OffsetDlg.cpp | 14 ++++++++------ samples/mfc/standard/06_Ocaf/src/NewBoxDlg.cpp | 6 ------ samples/mfc/standard/06_Ocaf/src/NewCylDlg.cpp | 6 ------ 4 files changed, 14 insertions(+), 20 deletions(-) diff --git a/.gitignore b/.gitignore index c0d8f5eae6..5c04544c31 100644 --- a/.gitignore +++ b/.gitignore @@ -10,8 +10,10 @@ /drv /inc /work -/win32 -/win64 + +# standard names of directories for objects and binaries on Windows +win32 +win64 # project files and artifacts /adm/msvc @@ -19,9 +21,11 @@ /adm/lin /adm/mac /adm/make +/adm/cmake *.vcproj*user *.ncb *.suo +*.sdf # test results /results* diff --git a/samples/mfc/standard/04_Viewer3d/src/OffsetDlg.cpp b/samples/mfc/standard/04_Viewer3d/src/OffsetDlg.cpp index 34b9966b8e..d9e001054d 100755 --- a/samples/mfc/standard/04_Viewer3d/src/OffsetDlg.cpp +++ b/samples/mfc/standard/04_Viewer3d/src/OffsetDlg.cpp @@ -132,6 +132,8 @@ void COffsetDlg::SetOffsets(Standard_Real theFactor, Standard_Real theUnits) TCollection_AsciiString Message; Standard_Boolean OneOrMoreCurrentIsDisplayed=false; + Standard_ShortReal aFactor = (Standard_ShortReal)theFactor; + Standard_ShortReal aUnits = (Standard_ShortReal)theUnits; for (aAISContext->InitCurrent();aAISContext->MoreCurrent ();aAISContext->NextCurrent ()) if (aAISContext->IsDisplayed(aAISContext->Current())) OneOrMoreCurrentIsDisplayed=true; @@ -139,40 +141,40 @@ void COffsetDlg::SetOffsets(Standard_Real theFactor, Standard_Real theUnits) if(OneOrMoreCurrentIsDisplayed){ if((aAISContext->IsCurrent(aOverlappedBox) || aAISContext->IsCurrent(aBox)) && aAISContext->IsDisplayed(aOverlappedBox)){ - aOverlappedBox->SetPolygonOffsets(Aspect_POM_Fill,theFactor,theUnits); + aOverlappedBox->SetPolygonOffsets(Aspect_POM_Fill,aFactor,aUnits); Message = "Box2 -> SetPolygonOffsets(Aspect_POM_Fill, Factor, Units);\n"; //myDoc -> AddTextInDialog(Message); } if((aAISContext->IsCurrent(aOverlappedCylinder) || aAISContext->IsCurrent(aCylinder)) && aAISContext->IsDisplayed(aOverlappedCylinder)){ - aOverlappedCylinder->SetPolygonOffsets(Aspect_POM_Fill,theFactor,theUnits); + aOverlappedCylinder->SetPolygonOffsets(Aspect_POM_Fill,aFactor,aUnits); Message = Message + "Cylinder2 -> SetPolygonOffsets(Aspect_POM_Fill, Factor, Units);\n"; //myDoc -> AddTextInDialog(Message); } if((aAISContext->IsCurrent(aOverlappedSphere) || aAISContext->IsCurrent(aSphere)) && aAISContext->IsDisplayed(aOverlappedSphere)){ - aOverlappedSphere->SetPolygonOffsets(Aspect_POM_Fill,theFactor,theUnits); + aOverlappedSphere->SetPolygonOffsets(Aspect_POM_Fill,aFactor,aUnits); Message = Message + "Sphere2 -> SetPolygonOffsets(Aspect_POM_Fill, Factor, Units);\n"; //myDoc -> AddTextInDialog(Message); } } else{ if(aAISContext->IsDisplayed(aOverlappedBox)){ - aOverlappedBox->SetPolygonOffsets(Aspect_POM_Fill,theFactor,theUnits); + aOverlappedBox->SetPolygonOffsets(Aspect_POM_Fill,aFactor,aUnits); Message = Message + "Box2 -> SetPolygonOffsets(Aspect_POM_Fill, Factor, Units);\n"; //myDoc -> AddTextInDialog(Message); } if(aAISContext->IsDisplayed(aOverlappedCylinder)){ - aOverlappedCylinder->SetPolygonOffsets(Aspect_POM_Fill,theFactor,theUnits); + aOverlappedCylinder->SetPolygonOffsets(Aspect_POM_Fill,aFactor,aUnits); Message = Message + "Cylinder2 -> SetPolygonOffsets(Aspect_POM_Fill, Factor, Units);\n"; //myDoc -> AddTextInDialog(Message); } if(aAISContext->IsDisplayed(aOverlappedSphere)){ - aOverlappedSphere->SetPolygonOffsets(Aspect_POM_Fill,theFactor,theUnits); + aOverlappedSphere->SetPolygonOffsets(Aspect_POM_Fill,aFactor,aUnits); Message = Message + "Sphere2 -> SetPolygonOffsets(Aspect_POM_Fill, Factor, Units);\n"; //myDoc -> AddTextInDialog(Message); } diff --git a/samples/mfc/standard/06_Ocaf/src/NewBoxDlg.cpp b/samples/mfc/standard/06_Ocaf/src/NewBoxDlg.cpp index 966200d6c9..274ba274e9 100755 --- a/samples/mfc/standard/06_Ocaf/src/NewBoxDlg.cpp +++ b/samples/mfc/standard/06_Ocaf/src/NewBoxDlg.cpp @@ -1,12 +1,6 @@ // NewBoxDlg.cpp : implementation file // -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - #include "stdafx.h" #include "NewBoxDlg.h" diff --git a/samples/mfc/standard/06_Ocaf/src/NewCylDlg.cpp b/samples/mfc/standard/06_Ocaf/src/NewCylDlg.cpp index 83aa8a1776..06d63b2da3 100755 --- a/samples/mfc/standard/06_Ocaf/src/NewCylDlg.cpp +++ b/samples/mfc/standard/06_Ocaf/src/NewCylDlg.cpp @@ -1,12 +1,6 @@ // NewCylDlg.cpp : implementation file // -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - #include "stdafx.h" #include "NewCylDlg.h"