@@ -54,8 +54,8 @@ typedef basAnc* BP; // basAnc pointer -- formerly used to localize NEARness
5454// --- bits for basAnc.flags
5555#define RFSTAT 0x4000 // "static" record basAnc: not reallocable, min subscr 0 not 1. set ancrec.cpp, tested ancrec,cul,cuprobe.cpp.
5656#define RFTYS 0x1000 // is in TYPES sub-basAnc (pted to by a basAnc.tys)
57- #define RFNOEX 0x0800 // don't register exprs in records in this basAnc: appl (e.g. ul\ cul.cpp) to ul\ exman.cpp:exWalkRecs()
58- #define RFINP 0x0400 // is an input (not run) records basAnc: ul\ cul.cpp to ul\ cuparse.cpp:probe. 12-91.
57+ #define RFNOEX 0x0800 // don't register exprs in records in this basAnc: appl (e.g. cul.cpp) to exman.cpp:exWalkRecs()
58+ #define RFINP 0x0400 // is an input (not run) records basAnc: cul.cpp to cuparse.cpp:probe. 12-91.
5959#define RFPROBED 0x0200 // set if basAnc has been 'probed': do not free (input) basAnc b4 run. cuparse.cpp:probe to cul.cpp:finalClear.
6060#define RFLOCAL 0x0100 // flag for private local uses 1-92. used in: cuprobe.cpp:showProbeNames, .
6161#define RFHEAP 0x0080 // set if block is in heap, else don't dmfree. 5-92.
@@ -80,32 +80,32 @@ class basAnc // base class for record anchors: basAnc<recordName>
8080 TI mn, n; // minimum (0 or 1) and max NOT+1 used record subscript (spaces unused if .gud==0)
8181 inline int GetSSRange () const { return n-mn+1 ; } // count INCLUDING UNUSED
8282 inline int GetSS0 () const { return mn; } // subscript of 0th entry
83- USI flags; // bits, RFxxxx defines above -- also set by user
83+ int ba_flags; // bits, RFxxxx defines above -- also set by user
8484 // members setable by application user language (cul.cpp)
8585 BP tyB; // 0 or ptr to user language TYPES anchor in heap (destructor deletes)
8686 BP ownB; // 0 or ptr to anchor whose objects own this anchor's objects (record.ownTi)
8787 const CULT* an_pCULT; // NULL or associated CULT input table for records of this type
8888 // simplifies back translation of input names
8989
9090 basAnc ();
91- basAnc ( USI flags, SFIR * fir, USI nFlds, char * what, USI eSz, RCT rt, USI sOff , SI dontRegister=0 );
91+ basAnc ( int flags, SFIR * fir, USI nFlds, char * what, USI eSz, RCT rt, USI sOff , int dontRegister=0 );
9292 void FC regis ();
9393 virtual ~basAnc (); // destroyed in deriv classes, to use vf
9494 virtual record* ptr () = 0; // access block ptr (in drv class: typed)
9595 virtual void ** pptr () = 0;
9696 virtual void setPtr ( record* r) = 0;
9797 virtual record& rec (TI i) = 0; // { return (record)((char *)ptr() + i*eSz); } // access record i
98- virtual record* GetAtSafe ( int i) const = 0; // typed pointer to ith record or NULL
99- virtual void * recMbr (TI i, USI off) = 0; // point record i member by offset
100- void * FC recFld (TI i, SI fn); // point record i member by FIELD # 3-92
101- RC FC al ( TI n, int erOp=ABT, BP _ownB=NULL ); // allocate records block. destroys old recs.
102- RC FC reAl ( TI n, int erOp=ABT); // (re)allocate records block. keeps old recs <= n.
103- RC FC free (); // free block
104- RC add ( record **r, int erOp, TI i=0 ); // add record to block
105- RC FC del ( TI i, int erOp=ABT); // delete record i
106- void statSetup ( record &r, TI n=1 , SI noZ=0 , SI inHeap=0 ); // set up with static record(s)
107- SI FC isNamed () const { return flags & RFNAMED; } // records have .name[]: always on, coding out 7-92
108- static BP FC anc4n ( USI an, int erOp=ABT); // access anchor by anchor #
98+ virtual record* GetAtSafe ( int i) const = 0; // typed pointer to ith record or NULL
99+ virtual void * recMbr (TI i, USI off) = 0; // point record i member by offset
100+ void * FC recFld (TI i, SI fn); // point record i member by FIELD # 3-92
101+ RC FC al ( TI n, int erOp=ABT, BP _ownB=NULL ); // allocate records block. destroys old recs.
102+ RC FC reAl ( TI n, int erOp=ABT); // (re)allocate records block. keeps old recs <= n.
103+ RC FC free (); // free block
104+ RC add ( record **r, int erOp, TI i=0 ); // add record to block
105+ RC FC del ( TI i, int erOp=ABT); // delete record i
106+ void statSetup ( record &r, TI n=1 , SI noZ=0 , SI inHeap=0 ); // set up with static record(s)
107+ int isNamed () const { return ba_flags & RFNAMED; } // records have .name[]: always on, coding out 7-92
108+ static BP FC anc4n ( USI an, int erOp=ABT); // access anchor by anchor #
109109 static RC FC findAnchorByNm ( char *what, BP *b);
110110 static SI FC ancNext ( USI &an, BP *_b); // iterate anchors
111111 RC validate ( char *fcnName, int erOp=ABT, SI noStat=0 ); // check for valid anchor
@@ -261,11 +261,11 @@ class record // base class for records
261261
262262template <class T > class anc : public basAnc
263263{ public:
264- anc ( char *what, SFIR *sFir , USI nFlds, RCT rt) // cpp'tor used for static instances
264+ anc ( char *what, SFIR *sFir , USI nFlds, RCT rt) // cpp'tor used for static instances
265265 : basAnc( RFNAMED|RFOWNED, sFir , nFlds, what, sizeof (T), rt, offsetof( T, sstat) )
266266 { p = 0 ; } // soon code out obsolete flags RFNAMED, RFOWNED.
267- anc ( const BP src, USI _flags , char *_what, // like-another constructor,
268- BP _ownB, SI dontRegister=0 ); // code included only ifdef NEEDLIKECTOR.
267+ anc ( const BP src, int flags , char *_what, // like-another constructor,
268+ BP _ownB, int dontRegister=0 ); // code included only ifdef NEEDLIKECTOR.
269269 virtual ~anc (); // destroys records, and types anchor & its recs.
270270
271271 T* p; // typed pointer to record array storage block
@@ -326,7 +326,7 @@ template <class T> class anc : public basAnc
326326// =============================================================================
327327#ifdef NEEDLIKECTOR // define where this constructor is USED: avoids generating for classes where not used.
328328
329- template <class T > anc<T>::anc( const BP src, USI _flags , char *_what, BP _ownB, SI dontRegister/* =0*/ )
329+ template <class T > anc<T>::anc( const BP src, int flags , char *_what, BP _ownB, int dontRegister/* =0*/ )
330330
331331 // like-another-with-records-deleted constructor.
332332
@@ -337,10 +337,11 @@ template <class T> anc<T>::anc( const BP src, USI _flags, char *_what, BP _ownB,
337337 memcpy ( this , src, sizeof (anc<T>) ); // bitwise copy ALL, to incude virt fcn table ptr.
338338 ancN= nAl= n= 0 ; p= 0 ; tyB= 0 ; // clear what don't want: anchor #, records, ul stuff.
339339 mn = 1 ; // mn = 1 when no records allocated even if will be static
340- flags = _flags; what = _what; ownB = _ownB; // store members given by caller
341- if (!dontRegister) regis (); // conditionally include in nextAnc iteration.
342- /* CAUTION: don't regis() tyB's or any dm anc<T>'s without
343- adding unregister logic to destructor, 10-93. */
340+ ba_flags = flags; what = _what; ownB = _ownB; // store members given by caller
341+ if (!dontRegister)
342+ regis (); // conditionally include in nextAnc iteration.
343+ // CAUTION: don't regis() tyB's or any dm anc<T>'s without
344+ // adding unregister logic to destructor, 10-93.
344345} // anc<T>::anc
345346#endif // NEEDLIKECTOR
346347// -------------------------------------------------------------------------------------------------------------------------
0 commit comments