Revision: 50682
http://brlcad.svn.sourceforge.net/brlcad/?rev=50682&view=rev
Author: n_reed
Date: 2012-05-24 22:57:28 +0000 (Thu, 24 May 2012)
Log Message:
-----------
apply SCL git e72ca29; remove some superfluous boolean types and use std bool
more often
Modified Paths:
--------------
brlcad/trunk/src/other/step/src/cleditor/cmdmgr.cc
brlcad/trunk/src/other/step/src/cleditor/cmdmgr.h
brlcad/trunk/src/other/step/src/cleditor/instmgr.h
brlcad/trunk/src/other/step/src/clstepcore/ExpDict.h
brlcad/trunk/src/other/step/src/clstepcore/ExpDict.inline.cc
brlcad/trunk/src/other/step/src/clstepcore/Registry.inline.cc
brlcad/trunk/src/other/step/src/clstepcore/STEPcomplex.cc
brlcad/trunk/src/other/step/src/clstepcore/collect.cc
brlcad/trunk/src/other/step/src/clstepcore/complexSupport.h
brlcad/trunk/src/other/step/src/clstepcore/complexlist.cc
brlcad/trunk/src/other/step/src/clstepcore/entlist.cc
brlcad/trunk/src/other/step/src/clstepcore/entnode.cc
brlcad/trunk/src/other/step/src/clstepcore/multlist.cc
brlcad/trunk/src/other/step/src/clstepcore/non-ors.cc
brlcad/trunk/src/other/step/src/clstepcore/orlist.cc
Modified: brlcad/trunk/src/other/step/src/cleditor/cmdmgr.cc
===================================================================
--- brlcad/trunk/src/other/step/src/cleditor/cmdmgr.cc 2012-05-24 21:43:53 UTC
(rev 50681)
+++ brlcad/trunk/src/other/step/src/cleditor/cmdmgr.cc 2012-05-24 22:57:28 UTC
(rev 50682)
@@ -10,8 +10,6 @@
* and is not subject to copyright.
*/
-/* $Id: cmdmgr.cc,v 3.0.1.2 1997/11/05 22:11:41 sauderd DP3.1 $ */
-
#include <cmdmgr.h>
@@ -27,61 +25,45 @@
return 0;
}
-BOOLEAN ReplicateList::IsOnList( MgrNode * mn ) {
+bool ReplicateList::IsOnList( MgrNode * mn ) {
return ( FindNode( mn ) != 0 );
- /*
- ReplicateLinkNode *rln = (ReplicateLinkNode *)GetHead();
- int numEntries = EntryCount();
- int found = 0;
- while(numEntries--)
- {
- if(rln->ReplicateNode() == mn)
- {
- found = 1;
- numEntries = 0;
- }
- rln = (ReplicateLinkNode *)rln->NextNode();
- }
- return found;
- */
}
///////////////////////////////////////////////////////////////////////////////
// returns true if it could delete the node
///////////////////////////////////////////////////////////////////////////////
-BOOLEAN ReplicateList::Remove( ReplicateLinkNode * rln ) {
+bool ReplicateList::Remove( ReplicateLinkNode * rln ) {
ReplicateLinkNode * rnFollow = ( ReplicateLinkNode * )GetHead();
if( !rnFollow || !rln ) {
- return 0;
+ return false;
} else {
if( rnFollow == rln ) {
head = rln->NextNode();
delete rln;
- return 1;
+ return true;
} else {
ReplicateLinkNode * rn = ( ReplicateLinkNode *
)rnFollow->NextNode();
while( rn ) {
if( rn == rln ) {
rnFollow->next = ( SingleLinkNode * )rln->NextNode();
delete rln;
- return 1;
+ return true;
}
rnFollow = rn;
rn = ( ReplicateLinkNode * )rn->NextNode();
} // end while(rn)
} // end else
} // end else
- return 0;
+ return false;
}
-BOOLEAN ReplicateList::Remove( MgrNode * rn ) {
+bool ReplicateList::Remove( MgrNode * rn ) {
return Remove( FindNode( rn ) );
}
CmdMgr::CmdMgr() {
completeList = new MgrNodeList( completeSE );
incompleteList = new MgrNodeList( incompleteSE );
-// newList = new MgrNodeList(newSE);
deleteList = new MgrNodeList( deleteSE );
mappedWriteList = new DisplayNodeList( mappedWrite );
@@ -90,30 +72,12 @@
replicateList = new ReplicateList();
}
-int CmdMgr::ReplicateCmdList( MgrNode * mn ) {
+void CmdMgr::ReplicateCmdList( MgrNode * mn ) {
if( !( replicateList->IsOnList( mn ) ) ) {
replicateList->AddNode( mn );
}
- return 1;
}
-/*
-void CmdMgr::ModifyCmdList(MgrNode *mn)
-{
- mn->ChangeList(mappedWriteList);
-}
-
-void CmdMgr::ViewCmdList(MgrNode *mn)
-{
- mn->ChangeList(mappedViewList);
-}
-
-void CmdMgr::CloseCmdList(MgrNode *mn)
-{
- mn->ChangeList(closeList);
-}
-*/
-
void CmdMgr::ClearInstances() {
completeList->ClearEntries();
incompleteList->ClearEntries();
@@ -121,9 +85,8 @@
deleteList->ClearEntries();
replicateList->Empty();
-// newList->ClearEntries();
}
-// searches current list for fileId
+/// searches current list for fileId
MgrNode * CmdMgr::StateFindFileId( stateEnum s, int fileId ) {
switch( s ) {
case completeSE:
Modified: brlcad/trunk/src/other/step/src/cleditor/cmdmgr.h
===================================================================
--- brlcad/trunk/src/other/step/src/cleditor/cmdmgr.h 2012-05-24 21:43:53 UTC
(rev 50681)
+++ brlcad/trunk/src/other/step/src/cleditor/cmdmgr.h 2012-05-24 22:57:28 UTC
(rev 50682)
@@ -12,12 +12,8 @@
* and is not subject to copyright.
*/
-/* $Id: cmdmgr.h,v 3.0.1.2 1997/11/05 22:11:41 sauderd DP3.1 $ */
-
-
#include <gennode.h>
#include <gennodelist.h>
-//#include <gennode.inline.h>
#include <gennodearray.h>
#include <editordefines.h>
@@ -27,8 +23,6 @@
#include <dispnodelist.h>
#include <SingleLinkList.h>
-typedef unsigned short BOOLEAN;
-
//#define NUM_CMDMGR_CMDS 9
// this is the number of columns that contain cmds (as opposed
// to state info)
@@ -115,7 +109,7 @@
return new ReplicateLinkNode;
}
- BOOLEAN IsOnList( MgrNode * mn );
+ bool IsOnList( MgrNode * mn );
ReplicateLinkNode * FindNode( MgrNode * mn );
ReplicateLinkNode * AddNode( MgrNode * rn ) {
@@ -125,8 +119,8 @@
return node;
}
- BOOLEAN Remove( ReplicateLinkNode * rln );
- BOOLEAN Remove( MgrNode * rn );
+ bool Remove( ReplicateLinkNode * rln );
+ bool Remove( MgrNode * rn );
const char * ClassName() {
return "ReplicateList";
@@ -195,15 +189,9 @@
( mn->DisplayState() == mappedView ) ) ?
mn->ChangeList( closeList ) : 0;
}
- /*
- // { if(mn->DisplayState() == mappedWrite ||
- // mn->DisplayState() == mappedView)
- // return mn->ChangeList(closeList);
- // else return 0;
- // }
- */
- int ReplicateCmdList( MgrNode * mn );
+ void ReplicateCmdList( MgrNode * mn );
+
void ClearInstances();
protected:
Modified: brlcad/trunk/src/other/step/src/cleditor/instmgr.h
===================================================================
--- brlcad/trunk/src/other/step/src/cleditor/instmgr.h 2012-05-24 21:43:53 UTC
(rev 50681)
+++ brlcad/trunk/src/other/step/src/cleditor/instmgr.h 2012-05-24 22:57:28 UTC
(rev 50682)
@@ -22,7 +22,6 @@
-typedef unsigned boolean;
extern char * EntityClassName( char * );
// IT IS VERY IMPORTANT THAT THE ORDER OF THE FOLLOWING INCLUDE FILES
Modified: brlcad/trunk/src/other/step/src/clstepcore/ExpDict.h
===================================================================
--- brlcad/trunk/src/other/step/src/clstepcore/ExpDict.h 2012-05-24
21:43:53 UTC (rev 50681)
+++ brlcad/trunk/src/other/step/src/clstepcore/ExpDict.h 2012-05-24
22:57:28 UTC (rev 50682)
@@ -1135,7 +1135,7 @@
int operator< ( SchRename & schrnm ) {
return ( strcmp( schName, schrnm.schName ) < 0 );
}
- int choice( const char * nm ) const;
+ bool choice( const char * nm ) const;
// is nm one of our possible choices?
char * rename( const char * schm, char * newnm ) const;
// given a schema name, returns new object name if exists
@@ -1282,9 +1282,9 @@
protected:
// Functions used to check the current name of the type (may
// != _name if altNames has diff name for current schema).
- int PossName( const char * ) const;
- int OurName( const char * ) const;
- int AltName( const char * ) const;
+ bool PossName( const char * ) const;
+ bool OurName( const char * ) const;
+ bool AltName( const char * ) const;
public:
@@ -1416,7 +1416,7 @@
const char * schNm = 0 ) const {
return ( CurrName( n, schNm ) ? this : 0 );
}
- int CurrName( const char *, const char * = 0 ) const;
+ bool CurrName( const char *, const char * = 0 ) const;
void addAltName( const char * schnm, const char * newnm );
// Adds an additional name, newnm, to be use when schema schnm
// is USE/REFERENCE'ing us (added to altNames).
Modified: brlcad/trunk/src/other/step/src/clstepcore/ExpDict.inline.cc
===================================================================
--- brlcad/trunk/src/other/step/src/clstepcore/ExpDict.inline.cc
2012-05-24 21:43:53 UTC (rev 50681)
+++ brlcad/trunk/src/other/step/src/clstepcore/ExpDict.inline.cc
2012-05-24 22:57:28 UTC (rev 50682)
@@ -254,7 +254,7 @@
* case if schNm USEs or REFERENCEs type and renames it in the process
* (e.g., "USE (X as Y)".
*/
-int TypeDescriptor::CurrName( const char * other, const char * schNm ) const {
+bool TypeDescriptor::CurrName( const char * other, const char * schNm ) const {
if( !schNm || *schNm == '\0' ) {
// If there's no current schema, accept any possible name of this.
// (I.e., accept its actual name or any substitute):
@@ -274,19 +274,19 @@
/**
* return true if nm is either our name or one of the possible alternates.
*/
-int TypeDescriptor::PossName( const char * nm ) const {
+bool TypeDescriptor::PossName( const char * nm ) const {
return ( OurName( nm ) || AltName( nm ) );
}
-int TypeDescriptor::OurName( const char * nm ) const {
+bool TypeDescriptor::OurName( const char * nm ) const {
return !StrCmpIns( nm, _name );
}
-int TypeDescriptor::AltName( const char * nm ) const {
+bool TypeDescriptor::AltName( const char * nm ) const {
if( altNames ) {
return ( altNames->choice( nm ) );
}
- return 0;
+ return false;
}
/**
@@ -316,14 +316,14 @@
* See if nm = one of our choices (either ours or that of a SchRename
* later in the list.
*/
-int SchRename::choice( const char * nm ) const {
+bool SchRename::choice( const char * nm ) const {
if( !StrCmpIns( nm, newName ) ) {
- return 1;
+ return true;
}
if( next ) {
return ( next->choice( nm ) );
}
- return 0;
+ return false;
}
/**
Modified: brlcad/trunk/src/other/step/src/clstepcore/Registry.inline.cc
===================================================================
--- brlcad/trunk/src/other/step/src/clstepcore/Registry.inline.cc
2012-05-24 21:43:53 UTC (rev 50681)
+++ brlcad/trunk/src/other/step/src/clstepcore/Registry.inline.cc
2012-05-24 22:57:28 UTC (rev 50682)
@@ -273,10 +273,10 @@
( ( EntityDescriptor * )entd ) -> NewSTEPentity();
// See comment in previous function.
- if( entd->AbstractEntity().asInt() == TRUE ) {
+ if( entd->AbstractEntity().asInt() == true ) {
se->Error().severity( SEVERITY_WARNING );
se->Error().UserMsg( "ENTITY is abstract supertype" );
- } else if( entd->ExtMapping().asInt() == TRUE ) {
+ } else if( entd->ExtMapping().asInt() == true ) {
se->Error().severity( SEVERITY_WARNING );
se->Error().UserMsg( "ENTITY requires external mapping" );
}
Modified: brlcad/trunk/src/other/step/src/clstepcore/STEPcomplex.cc
===================================================================
--- brlcad/trunk/src/other/step/src/clstepcore/STEPcomplex.cc 2012-05-24
21:43:53 UTC (rev 50681)
+++ brlcad/trunk/src/other/step/src/clstepcore/STEPcomplex.cc 2012-05-24
22:57:28 UTC (rev 50682)
@@ -70,7 +70,7 @@
enDesc = _registry->FindEntity( *eptr, schnm );
if( enDesc ) {
if( enDesc->Supertypes().EntryCount() > 1 ) {
- eptr->multSuprs( TRUE );
+ eptr->multSuprs( true );
}
if( StrCmpIns( *eptr, enDesc->Name() ) ) {
// If this entity was referred by another name rather than the
Modified: brlcad/trunk/src/other/step/src/clstepcore/collect.cc
===================================================================
--- brlcad/trunk/src/other/step/src/clstepcore/collect.cc 2012-05-24
21:43:53 UTC (rev 50681)
+++ brlcad/trunk/src/other/step/src/clstepcore/collect.cc 2012-05-24
22:57:28 UTC (rev 50682)
@@ -86,15 +86,15 @@
* Determines if the parent schema supports the instantiation of a complex
* type consisting of the the entities named in ents. Does so by attempt-
* ing to match ents against the ComplexLists in clists. If one of the
- * nodes of ents has multSupers set to TRUE (it has >1 supertype), it
+ * nodes of ents has multSupers set to true (it has >1 supertype), it
* should be included in >1 CList. A more complicated algorithm is applied
* to match it, as described in the commenting.
*/
-int ComplexCollect::supports( EntNode * ents ) const {
+bool ComplexCollect::supports( EntNode * ents ) const {
EntNode * node = ents, *nextnode;
AndList * alist = 0;
ComplexList * clist = clists, *cl = NULL, *current;
- int retval;
+ bool retval;
EntList * elist, *next;
// Loop through the nodes of ents. If 1+ of them have >1 supertype, build
@@ -137,15 +137,15 @@
// which had mult supers. Simply go through each CList separately:
while( clist != NULL ) {
if( clist->matches( ents ) ) {
- return TRUE;
+ return true;
}
clist = clist->next;
}
// Went through whole list without match:
- return FALSE;
+ return false;
} else {
// Use cl to test that the conditions of all supertypes are met:
- cl->multSupers = TRUE;
+ cl->multSupers = true;
cl->buildList();
retval = cl->matches( ents );
Modified: brlcad/trunk/src/other/step/src/clstepcore/complexSupport.h
===================================================================
--- brlcad/trunk/src/other/step/src/clstepcore/complexSupport.h 2012-05-24
21:43:53 UTC (rev 50681)
+++ brlcad/trunk/src/other/step/src/clstepcore/complexSupport.h 2012-05-24
22:57:28 UTC (rev 50682)
@@ -19,8 +19,6 @@
using namespace std;
#include "Str.h"
-#define FALSE 0
-#define TRUE 1
#define LISTEND 999
/** \def LISTEND
* signifies that an OrList has gone beyond its last viable choice
@@ -93,13 +91,13 @@
operator const char * () {
return name;
}
- int operator== ( EntNode & ent ) {
+ bool operator== ( EntNode & ent ) {
return ( strcmp( name, ent.name ) == 0 );
}
- int operator< ( EntNode & ent ) {
+ bool operator< ( EntNode & ent ) {
return ( strcmp( name, ent.name ) < 0 );
}
- int operator> ( EntNode & ent ) {
+ bool operator> ( EntNode & ent ) {
return ( strcmp( name, ent.name ) > 0 );
}
EntNode & operator= ( EntNode & ent );
@@ -116,12 +114,12 @@
void unmarkAll() {
markAll( NOMARK );
}
- int marked( MarkType base = ORMARK ) {
+ bool marked( MarkType base = ORMARK ) {
return ( mark >= base );
}
- int allMarked(); ///< returns true if all nodes in list are marked
+ bool allMarked(); ///< returns true if all nodes in list are marked
int unmarkedCount();
- int multSuprs() {
+ bool multSuprs() {
return multSupers;
}
void multSuprs( int j ) {
@@ -134,7 +132,7 @@
private:
MarkType mark;
char name[BUFSIZ];
- int multSupers; ///< do I correspond to an entity with >1 supertype?
+ bool multSupers; ///< do I correspond to an entity with >1 supertype?
EntNode * lastSmaller( EntNode * ); ///< used by ::sort()
};
@@ -157,12 +155,12 @@
virtual void setLevel( int l ) {
level = l;
}
- virtual int contains( char * ) = 0;
- virtual int hit( char * ) = 0;
+ virtual bool contains( char * ) = 0;
+ virtual bool hit( char * ) = 0;
virtual MatchType matchNonORs( EntNode * ) {
return UNKNOWN;
}
- virtual int acceptChoice( EntNode * ) = 0;
+ virtual bool acceptChoice( EntNode * ) = 0;
virtual void unmarkAll( EntNode * ) = 0;
virtual void reset() {
viable = UNKNOWN;
@@ -223,14 +221,14 @@
const char * Name() {
return name;
}
- int contains( char * nm ) {
+ bool contains( char * nm ) {
return *this == nm;
}
- int hit( char * nm ) {
+ bool hit( char * nm ) {
return *this == nm;
}
MatchType matchNonORs( EntNode * );
- int acceptChoice( EntNode * );
+ bool acceptChoice( EntNode * );
void unmarkAll( EntNode * );
void reset() {
viable = UNKNOWN;
@@ -257,8 +255,8 @@
childList( 0 ) {}
~MultList();
void setLevel( int );
- int contains( char * );
- int hit( char * );
+ bool contains( char * );
+ bool hit( char * );
void appendList( EntList * );
EntList * copyList( EntList * );
virtual MatchType matchORs( EntNode * ) = 0;
@@ -273,7 +271,7 @@
return ( getChild( numchildren - 1 ) );
}
void unmarkAll( EntNode * );
- int prevKnown( EntList * );
+ bool prevKnown( EntList * );
void reset();
protected:
@@ -297,7 +295,7 @@
JoinList( JoinType j ) : MultList( j ) {}
~JoinList() {}
void setViableVal( EntNode * );
- int acceptChoice( EntNode * );
+ bool acceptChoice( EntNode * );
};
class AndOrList : public JoinList {
@@ -325,12 +323,12 @@
public:
OrList() : MultList( OR ), choice( -1 ), choice1( -1 ), choiceCount( 0
) {}
~OrList() {}
- int hit( char * );
+ bool hit( char * );
MatchType matchORs( EntNode * );
MatchType tryNext( EntNode * );
void unmarkAll( EntNode * );
- int acceptChoice( EntNode * );
- int acceptNextChoice( EntNode * ents ) {
+ bool acceptChoice( EntNode * );
+ bool acceptNextChoice( EntNode * ents ) {
choice++;
return ( acceptChoice( ents ) );
}
@@ -379,9 +377,9 @@
* Based on knowledge that ComplexList always created by ANDing
supertype
* with subtypes.
*/
- int toplevel( const char * );
- int contains( EntNode * );
- int matches( EntNode * );
+ bool toplevel( const char * );
+ bool contains( EntNode * );
+ bool matches( EntNode * );
EntNode * list; /**< List of all entities contained in this complex
type,
* regardless of how. (Used as a quick way of determining
@@ -395,10 +393,10 @@
private:
void addChildren( EntList * );
- int hitMultNodes( EntNode * );
+ bool hitMultNodes( EntNode * );
int abstract; ///< is our supertype abstract?
int dependent; ///< is our supertype also a subtype of other
supertype(s)?
- int multSupers; ///< am I a combo-CList created to test a subtype
which has >1 supertypes?
+ bool multSupers; ///< am I a combo-CList created to test a subtype
which has >1 supertypes?
};
/// The collection of all the ComplexLists defined by the current schema.
@@ -413,7 +411,7 @@
void insert( ComplexList * );
void remove( ComplexList * ); ///< Remove this list but don't delete
its hierarchy structure, because it's used elsewhere.
ComplexList * find( char * );
- int supports( EntNode * ) const;
+ bool supports( EntNode * ) const;
ComplexList * clists;
Modified: brlcad/trunk/src/other/step/src/clstepcore/complexlist.cc
===================================================================
--- brlcad/trunk/src/other/step/src/clstepcore/complexlist.cc 2012-05-24
21:43:53 UTC (rev 50681)
+++ brlcad/trunk/src/other/step/src/clstepcore/complexlist.cc 2012-05-24
22:57:28 UTC (rev 50682)
@@ -37,24 +37,24 @@
}
/**
- * Returns TRUE if name is already contained at the top level of our
+ * Returns true if name is already contained at the top level of our
* EntList hierarchy. By top level, we mean the level under head. This
* is a highly specialized function which is used during the building of
* a temporary CList to test entities which are subtypes of >1 supertype.
*/
-int ComplexList::toplevel( const char * name ) {
+bool ComplexList::toplevel( const char * name ) {
EntList * slist = head->childList;
while( slist ) {
if( *( SimpleList * )slist == name ) {
- return TRUE;
+ return true;
}
slist = slist->next;
if( slist ) {
slist = slist->next;
}
}
- return FALSE;
+ return false;
}
/**
@@ -136,7 +136,7 @@
* tion is simplified greatly because both EntNodes are ordered alphabeti-
* cally.
*/
-int ComplexList::contains( EntNode * ents ) {
+bool ComplexList::contains( EntNode * ents ) {
EntNode * ours = list, *theirs = ents;
while( theirs != NULL ) {
@@ -146,37 +146,37 @@
if( ours == NULL || *ours > *theirs ) {
// If either of these occured, we couldn't find one of ours which
// matched the current "theirs".
- return FALSE;
+ return false;
}
theirs = theirs->next;
ours = ours->next;
}
// At this point we must have matched them all. (We may have extra, but
// there's nothing wrong with that.)
- return TRUE;
+ return true;
}
/**
* Receives as input an EntNode list, corresponding to a user request to
- * instantiate the corresponding complex type. Returns TRUE if such a list
+ * instantiate the corresponding complex type. Returns true if such a list
* can be instantiated based on the list of EntLists which were generated
- * when the schema was read; FALSE otherwise.
+ * when the schema was read; false otherwise.
*/
-int ComplexList::matches( EntNode * ents ) {
+bool ComplexList::matches( EntNode * ents ) {
MatchType retval, otherChoices = NEWCHOICE;
- int result = FALSE;
+ int result = false;
// First check if this ComplexList at least contains all the nodes of ents.
// If it does, we'll search in detail. If not, we're done.
if( ! contains( ents ) ) {
- return FALSE;
+ return false;
}
// Now start a thorough search through this ComplexList:
if( ( retval = head->matchNonORs( ents ) ) == MATCHALL ) {
- result = TRUE;
+ result = true;
} else if( retval != UNKNOWN ) {
- result = FALSE;
+ result = false;
// UNKNOWN is the return val if there are ORs matchNonORs can't
// analyze. Unless we got a MATCHALL already, that's our only hope.
} else {
@@ -185,7 +185,7 @@
// hitMultNodes() checks that in case we're a combo-CList (see
// CColect->supports()) we have a legal choice (see comments in
// hitMultNodes()).
- result = TRUE;
+ result = true;
} else if( retval >= MATCHSOME ) {
// We have a partial answer. Check if other solutions exist (i.e.,
// if there are OR's with other choices):
@@ -193,7 +193,7 @@
otherChoices = head->tryNext( ents );
if( otherChoices == MATCHALL ) {
if( hitMultNodes( ents ) ) {
- result = TRUE;
+ result = true;
} else {
otherChoices = NEWCHOICE;
}
@@ -221,7 +221,7 @@
* valid. (This function is actually slightly more complicated because it
* also deals with the possibility that >1 entities like C exist.)
*/
-int ComplexList::hitMultNodes( EntNode * ents ) {
+bool ComplexList::hitMultNodes( EntNode * ents ) {
EntNode * node;
EntList * child;
@@ -229,7 +229,7 @@
// we have nothing to check for. (CList::matches() routinely checks for
// hitMultNodes in case we're a combo.)
if( !multSupers ) {
- return TRUE;
+ return true;
}
for( node = ents; node != NULL; node = node->next ) {
@@ -245,7 +245,7 @@
// below.
if( child->contains( node->name ) ) {
if( ! child->hit( node->name ) ) {
- return FALSE;
+ return false;
}
}
child = child->next;
@@ -257,6 +257,6 @@
}
}
}
- return TRUE;
+ return true;
// If we got here, we didn't find any unmatched complex subtypes.
}
Modified: brlcad/trunk/src/other/step/src/clstepcore/entlist.cc
===================================================================
--- brlcad/trunk/src/other/step/src/clstepcore/entlist.cc 2012-05-24
21:43:53 UTC (rev 50681)
+++ brlcad/trunk/src/other/step/src/clstepcore/entlist.cc 2012-05-24
22:57:28 UTC (rev 50682)
@@ -109,10 +109,10 @@
/**
* Marks whichever node we can mark. We assume there is a match because
* this function is only called by a parent MultList if its child had a
- * viable val of MATCHSOME. Return TRUE if we mark a previously unmarked
- * node; otherwise FALSE.
+ * viable val of MATCHSOME. Return true if we mark a previously unmarked
+ * node; otherwise false.
*/
-int SimpleList::acceptChoice( EntNode * ents ) {
+bool SimpleList::acceptChoice( EntNode * ents ) {
EntNode * eptr = ents;
int comp;
@@ -123,15 +123,15 @@
I_marked = ORMARK;
// Remember that we're the one who marked this. (Nec. in case
// we have to unmark later to try out another OR branch.)
- return TRUE;
+ return true;
}
- return FALSE; // we didn't mark
+ return false; // we didn't mark
}
if( comp < 0 ) {
// We're beyond name in the ents list. No more checking to do.
- return FALSE;
+ return false;
}
eptr = eptr->next;
}
- return FALSE;
+ return false;
}
Modified: brlcad/trunk/src/other/step/src/clstepcore/entnode.cc
===================================================================
--- brlcad/trunk/src/other/step/src/clstepcore/entnode.cc 2012-05-24
21:43:53 UTC (rev 50681)
+++ brlcad/trunk/src/other/step/src/clstepcore/entnode.cc 2012-05-24
22:57:28 UTC (rev 50682)
@@ -90,18 +90,18 @@
}
/**
- * Returns TRUE if this and all nodes following it are marked.
+ * Returns true if this and all nodes following it are marked.
*/
-int EntNode::allMarked() {
+bool EntNode::allMarked() {
EntNode * node = this;
while( node != NULL ) {
if( node->mark == NOMARK ) {
- return FALSE;
+ return false;
}
node = node->next;
}
- return TRUE;
+ return true;
}
/**
Modified: brlcad/trunk/src/other/step/src/clstepcore/multlist.cc
===================================================================
--- brlcad/trunk/src/other/step/src/clstepcore/multlist.cc 2012-05-24
21:43:53 UTC (rev 50681)
+++ brlcad/trunk/src/other/step/src/clstepcore/multlist.cc 2012-05-24
22:57:28 UTC (rev 50682)
@@ -44,22 +44,22 @@
/**
* Check if one of this's descendants matches nm.
*/
-int MultList::contains( char * nm ) {
+bool MultList::contains( char * nm ) {
EntList * child = childList;
while( child ) {
if( child->contains( nm ) ) {
- return TRUE;
+ return true;
}
child = child->next;
}
- return FALSE;
+ return false;
}
/**
* Check if one of our descendants matches nm.
*/
-int MultList::hit( char * nm ) {
+bool MultList::hit( char * nm ) {
EntList * child = childList;
while( child ) {
if( child->viable > UNSATISFIED && child->hit( nm ) ) {
@@ -68,11 +68,11 @@
// thing. If child->join = AND, we must skip child. One of its
// children may "hit" nm, but it wouldn't be valid because overall
// child is an UNSAT.
- return TRUE;
+ return true;
}
child = child->next;
}
- return FALSE;
+ return false;
}
/**
@@ -206,12 +206,12 @@
/**
* Accept the path we're a part of: Mark all nodes of ents we can. Mark
- * value will = mark (either MARK or ORMARK). Return TRUE if we mark any-
- * thing; FALSE otherwise.
+ * value will = mark (either MARK or ORMARK). Return true if we mark any-
+ * thing; false otherwise.
*/
-int JoinList::acceptChoice( EntNode * ents ) {
+bool JoinList::acceptChoice( EntNode * ents ) {
EntList * child;
- int result = FALSE;
+ int result = false;
for( child = childList; child != NULL; child = child->next ) {
if( child->viable >= MATCHSOME ) {
@@ -227,7 +227,7 @@
// MATCHSOME'd when we originally went through the hierarchy.)
result = child->acceptChoice( ents ) || result;
// (NOTE - must run acceptChoice() first in above line. If result
- // were TRUE and we ||'ed it with acceptChoice(), aC() would never
+ // were true and we ||'ed it with acceptChoice(), aC() would never
// be run.)
}
}
@@ -239,14 +239,14 @@
* (a pointer to one of the EntLists of childList) have viable = UNKNOWN.
* Used in MatchNonORs() (see).
*/
-int MultList::prevKnown( EntList * desc ) {
+bool MultList::prevKnown( EntList * desc ) {
EntList * child = childList;
while( child != NULL && child != desc ) {
if( child->viable == UNKNOWN ) {
- return FALSE;
+ return false;
}
child = child->next;
}
- return TRUE;
+ return true;
}
Modified: brlcad/trunk/src/other/step/src/clstepcore/non-ors.cc
===================================================================
--- brlcad/trunk/src/other/step/src/clstepcore/non-ors.cc 2012-05-24
21:43:53 UTC (rev 50681)
+++ brlcad/trunk/src/other/step/src/clstepcore/non-ors.cc 2012-05-24
22:57:28 UTC (rev 50682)
@@ -25,7 +25,7 @@
while( eptr != NULL ) {
if( ( comp = strcmp( name, eptr->name ) ) == 0 ) {
if( ! eptr->marked( MARK ) ) {
- // NOTE - this cond also returns TRUE if eptr did have an OR-
+ // NOTE - this cond also returns true if eptr did have an OR-
// MARK. We don't want to remark now (since we're also trying
// out OR choices -- we know this because no OR's are done
// until after all the non-OR's). But, we do want to return
Modified: brlcad/trunk/src/other/step/src/clstepcore/orlist.cc
===================================================================
--- brlcad/trunk/src/other/step/src/clstepcore/orlist.cc 2012-05-24
21:43:53 UTC (rev 50681)
+++ brlcad/trunk/src/other/step/src/clstepcore/orlist.cc 2012-05-24
22:57:28 UTC (rev 50682)
@@ -24,7 +24,7 @@
* context of a sub w/ >1 super, in which case we build a combo-CList and
* may need to check if all sub-CLists matched the multi-sub, C.)
*/
-int OrList::hit( char * nm ) {
+bool OrList::hit( char * nm ) {
EntList * child = getChild( choice );
if( child ) {
@@ -35,12 +35,12 @@
while( child ) {
if( child->viable > UNSATISFIED && child->hit( nm ) ) {
// See MultList::hit() on why we must skip UNSATs.
- return TRUE;
+ return true;
}
child = child->next;
}
}
- return FALSE;
+ return false;
}
/**
@@ -61,7 +61,7 @@
* LISTEND. If choice was set to LISTEND before calling aC(), we reset
* choice to choice1, and search again.
*/
-int OrList::acceptChoice( EntNode * ents ) {
+bool OrList::acceptChoice( EntNode * ents ) {
EntList * child;
if( choice == LISTEND ) {
@@ -70,8 +70,8 @@
child = getChild( choice );
while( child ) {
if( child->viable >= MATCHSOME && child->acceptChoice( ents ) ) {
- // acceptChoice() returns TRUE if we marked something.
- return TRUE;
+ // acceptChoice() returns true if we marked something.
+ return true;
}
child = child->next;
choice++;
@@ -79,5 +79,5 @@
// If we got here, we must have gotten to the end of the childList without
// finding a choice which marks something.
choice = LISTEND;
- return FALSE;
+ return false;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits