1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

0026585: Eliminate compile warnings obtained by building occt with vc14: 'type cast' pointer truncation and 'type cast' truncation

- Class OSD_EnvironmentIterator is removed (not used, and would definitely fail under Windows if tried)
- Methods UserId() and GroupId() removed from OSD_FileNode (cannot be made portable, as there is no integer IDs of user and group on Windows)
- Draw_ProgressIndicator corrected to properly pass address via Tcl
- OSD_File.cxx: local function is refactored to avoid senseless encoding / decoding of results
- OSD_Process::UserId() method removed, as it cannot be made cross-platform (no integer IDs on Windows)
- OSD_Thread: use WinAPI conversion functions to avoid warnings
- OSD_WNT.cxx: recursion counter passed via function argument instead of TLS
- TDF_LabelMapHasher revised to use correct hasher function for an address
This commit is contained in:
abv
2015-10-09 11:29:18 +03:00
committed by bugmaster
parent 2f220b97b7
commit 682993040a
19 changed files with 77 additions and 679 deletions

View File

@@ -115,9 +115,8 @@ Standard_Boolean Draw_ProgressIndicator::Show(const Standard_Boolean force)
".xprogress.bar create rectangle 2 2 2 21 -fill blue -tags progress;"
".xprogress.bar create rectangle 2 2 2 21 -outline black -tags progress_next;"
"message .xprogress.text -width 400 -text \"Progress 0%%\";"
"button .xprogress.stop -text \"Break\" -relief groove -width 9 -command {XProgress -stop %ld};"
"pack .xprogress.bar .xprogress.text .xprogress.stop -side top;",
(long)(void*)this );
"button .xprogress.stop -text \"Break\" -relief groove -width 9 -command {XProgress -stop %p};"
"pack .xprogress.bar .xprogress.text .xprogress.stop -side top;", this );
((Draw_Interpretor*)myDraw)->Eval ( command );
myShown = Standard_True;
}
@@ -146,7 +145,7 @@ Standard_Boolean Draw_ProgressIndicator::Show(const Standard_Boolean force)
Standard_Boolean Draw_ProgressIndicator::UserBreak()
{
if ( StopIndicator() == (long)(void*)this ) {
if ( StopIndicator() == this ) {
// cout << "Progress Indicator - User Break: " << StopIndicator() << ", " << (void*)this << endl;
myBreak = Standard_True;
((Draw_Interpretor*)myDraw)->Eval ( "XProgress -stop 0" );
@@ -221,9 +220,9 @@ Standard_Boolean &Draw_ProgressIndicator::DefaultGraphMode ()
//purpose :
//=======================================================================
Standard_Integer &Draw_ProgressIndicator::StopIndicator ()
Standard_Address &Draw_ProgressIndicator::StopIndicator ()
{
static Standard_Integer stopIndicator = 0;
static Standard_Address stopIndicator = 0;
return stopIndicator;
}

View File

@@ -17,16 +17,10 @@
#define _Draw_ProgressIndicator_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Address.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Size.hxx>
#include <Message_ProgressIndicator.hxx>
#include <Draw_Interpretor.hxx>
class Draw_ProgressIndicator;
DEFINE_STANDARD_HANDLE(Draw_ProgressIndicator, Message_ProgressIndicator)
@@ -79,21 +73,13 @@ public:
//! Get/Set default values for output modes
Standard_EXPORT static Standard_Boolean& DefaultGraphMode();
//! Internal method for implementation of UserBreak mechanism
Standard_EXPORT static Standard_Integer& StopIndicator();
//! Internal method for implementation of UserBreak mechanism;
//! note that it uses static variable and thus not thread-safe!
Standard_EXPORT static Standard_Address& StopIndicator();
DEFINE_STANDARD_RTTI(Draw_ProgressIndicator,Message_ProgressIndicator)
protected:
private:
Standard_Boolean myTextMode;
Standard_Boolean myGraphMode;
Standard_Address myDraw;
@@ -102,14 +88,6 @@ private:
Standard_Integer myUpdateTime;
Standard_Size myLastUpdate;
Standard_Size myStartTime;
};
#endif // _Draw_ProgressIndicator_HeaderFile