Commit 2100f5e4 authored by Sean McBride's avatar Sean McBride Committed by Code Review

Merge topic 'debug-to-bool' into master

b54bce1d Unified mixed unsigned char/int usage to bool
parents 40f458e9 b54bce1d
......@@ -60,9 +60,9 @@ static vtkGarbageCollectorSingleton* vtkGarbageCollectorSingletonInstance;
//----------------------------------------------------------------------------
// Global debug setting. This flag specifies whether a collector
// should print debugging output. This must be default initialized to
// zero by the compiler and is therefore not initialized here. The
// false by the compiler and is therefore not initialized here. The
// ClassInitialize and ClassFinalize methods handle it.
static int vtkGarbageCollectorGlobalDebugFlag;
static bool vtkGarbageCollectorGlobalDebugFlag;
//----------------------------------------------------------------------------
// The thread identifier of the main thread. Delayed garbage
......@@ -93,13 +93,13 @@ void vtkGarbageCollector::PrintSelf(ostream& os, vtkIndent indent)
}
//----------------------------------------------------------------------------
void vtkGarbageCollector::SetGlobalDebugFlag(int flag)
void vtkGarbageCollector::SetGlobalDebugFlag(bool flag)
{
vtkGarbageCollectorGlobalDebugFlag = flag;
}
//----------------------------------------------------------------------------
int vtkGarbageCollector::GetGlobalDebugFlag()
bool vtkGarbageCollector::GetGlobalDebugFlag()
{
return vtkGarbageCollectorGlobalDebugFlag;
}
......@@ -439,7 +439,7 @@ vtkGarbageCollectorImpl::~vtkGarbageCollectorImpl()
this->Visited.clear();
// Disable debugging to avoid destruction message.
this->SetDebug(0);
this->SetDebug(false);
}
//----------------------------------------------------------------------------
......@@ -844,7 +844,7 @@ void vtkGarbageCollectorImpl::FlushEntryReferences(Entry* e)
void vtkGarbageCollector::ClassInitialize()
{
// Set default debugging state.
vtkGarbageCollectorGlobalDebugFlag = 0;
vtkGarbageCollectorGlobalDebugFlag = false;
// Record the id of the main thread.
vtkGarbageCollectorMainThread = vtkMultiThreader::GetCurrentThreadID();
......
......@@ -131,10 +131,10 @@ public:
static void DeferredCollectionPop();
// Description:
// Set/Get global garbage collection debugging flag. When set to 1,
// Set/Get global garbage collection debugging flag. When set to true,
// all garbage collection checks will produce debugging information.
static void SetGlobalDebugFlag(int flag);
static int GetGlobalDebugFlag();
static void SetGlobalDebugFlag(bool flag);
static bool GetGlobalDebugFlag();
protected:
vtkGarbageCollector();
......
......@@ -138,7 +138,7 @@ vtkObject *vtkObject::New()
// to zero.
vtkObject::vtkObject()
{
this->Debug = 0;
this->Debug = false;
this->SubjectHelper = NULL;
this->Modified(); // Insures modified time > than any other time
// initial reference count = 1 and reference counting on.
......@@ -191,26 +191,26 @@ void vtkObject::PrintSelf(ostream& os, vtkIndent indent)
// the modification time when enabling debug output.
void vtkObject::DebugOn()
{
this->Debug = 1;
this->Debug = true;
}
//----------------------------------------------------------------------------
// Turn debugging output off.
void vtkObject::DebugOff()
{
this->Debug = 0;
this->Debug = false;
}
//----------------------------------------------------------------------------
// Get the value of the debug flag.
unsigned char vtkObject::GetDebug()
bool vtkObject::GetDebug()
{
return this->Debug;
}
//----------------------------------------------------------------------------
// Set the value of the debug flag. A non-zero value turns debugging on.
void vtkObject::SetDebug(unsigned char debugFlag)
// Set the value of the debug flag. A true value turns debugging on.
void vtkObject::SetDebug(bool debugFlag)
{
this->Debug = debugFlag;
}
......
......@@ -73,11 +73,11 @@ public:
// Description:
// Get the value of the debug flag.
unsigned char GetDebug();
bool GetDebug();
// Description:
// Set the value of the debug flag. A non-zero value turns debugging on.
void SetDebug(unsigned char debugFlag);
// Set the value of the debug flag. A true value turns debugging on.
void SetDebug(bool debugFlag);
// Description:
// This method is called when vtkErrorMacro executes. It allows
......@@ -223,7 +223,7 @@ protected:
virtual void RegisterInternal(vtkObjectBase*, int check);
virtual void UnRegisterInternal(vtkObjectBase*, int check);
unsigned char Debug; // Enable debug messages
bool Debug; // Enable debug messages
vtkTimeStamp MTime; // Keep track of modification time
vtkSubjectHelper *SubjectHelper; // List of observers on this object
......
......@@ -289,8 +289,8 @@ int vtkThreadedImageAlgorithm::RequestData(
this->Threader->SetSingleMethod(vtkThreadedImageAlgorithmThreadedExecute, &str);
// always shut off debugging to avoid threading problems with GetMacros
int debug = this->Debug;
this->Debug = 0;
bool debug = this->Debug;
this->Debug = false;
this->Threader->SingleMethodExecute();
this->Debug = debug;
......
......@@ -1090,7 +1090,7 @@ void vtkOBBTree::BuildLocator()
vtkDebugMacro(<<"# Cells: " << numCells << ", Deepest tree level: " <<
this->Level <<", Created: " << this->OBBCount << " OBB nodes");
if ( this->GetDebug() > 1 )
if ( this->GetDebug() )
{ // print tree
double volume = 0.0;
int minCells = 65535, maxCells = 0;
......
......@@ -136,7 +136,7 @@ template <class T, class S>
int vtkSliceCubesContour(T *slice, S *scalars, int imageRange[2], int dims[3],
double origin[3], double Spacing[3], double value,
double xmin[3], double xmax[3], FILE *outFP,
vtkVolumeReader *reader, unsigned char debug)
vtkVolumeReader *reader, bool debug)
{
S *slice0scalars=NULL, *slice1scalars=NULL;
S *slice2scalars, *slice3scalars;
......
......@@ -707,8 +707,8 @@ int vtkImageHistogram::RequestData(
this->Threader->SetSingleMethod(vtkImageHistogramThreadedExecute, &ts);
// always shut off debugging to avoid threading problems with GetMacros
int debug = this->Debug;
this->Debug = 0;
bool debug = this->Debug;
this->Debug = false;
this->Threader->SingleMethodExecute();
this->Debug = debug;
......
......@@ -229,8 +229,8 @@ int main( int argc, char *argv[] )
// Clean up
cube->Delete();
vtkGarbageCollector::SetGlobalDebugFlag(1);
vtkGarbageCollector::SetGlobalDebugFlag(0);
vtkGarbageCollector::SetGlobalDebugFlag(true);
vtkGarbageCollector::SetGlobalDebugFlag(false);
prop->Delete();
ren1->Delete();
renWindow->Delete();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment