@@ -206,14 +206,10 @@ TypeDescriptor::TypeDescriptor
206206 const char * d )
207207 : _name( nm ), altNames( 0 ), _fundamentalType( ft ),
208208 _originatingSchema ( origSchema ), _referentType( 0 ), _description( d ),
209- _where_rules( 0 )
210-
211- {
209+ _where_rules( 0 ) {
212210}
213211
214- const char *
215- TypeDescriptor::Name ( const char * schnm ) const
216- /*
212+ /* *
217213 * Determines the current name of this. Normally, this is simply _name.
218214 * If "schnm" is set to a value, however, then this function becomes a
219215 * request for our name when referenced by schnm. (This will be diff from
@@ -223,7 +219,7 @@ TypeDescriptor::Name( const char * schnm ) const
223219 * and returns the new name if found. (See header comments to function
224220 * SchRename::rename().)
225221 */
226- {
222+ const char * TypeDescriptor::Name ( const char * schnm ) const {
227223 if ( schnm == NULL ) {
228224 return _name;
229225 }
@@ -235,13 +231,11 @@ TypeDescriptor::Name( const char * schnm ) const
235231 return _name;
236232}
237233
238- const char *
239- TypeDescriptor::BaseTypeName () const {
234+ const char * TypeDescriptor::BaseTypeName () const {
240235 return BaseTypeDescriptor () ? BaseTypeDescriptor () -> Name () : 0 ;
241236}
242237
243- const TypeDescriptor *
244- TypeDescriptor::BaseTypeIsA ( const TypeDescriptor * td ) const {
238+ const TypeDescriptor * TypeDescriptor::BaseTypeIsA ( const TypeDescriptor * td ) const {
245239 switch ( NonRefType () ) {
246240 case AGGREGATE_TYPE:
247241 return AggrElemTypeDescriptor () -> IsA ( td );
@@ -250,20 +244,17 @@ TypeDescriptor::BaseTypeIsA( const TypeDescriptor * td ) const {
250244 default :
251245 return IsA ( td );
252246 }
253-
254247}
255248
256- int
257- TypeDescriptor::CurrName ( const char * other, const char * schNm ) const
258- /*
249+ /* *
259250 * Check if our "current" name = other. CurrName may be different from
260251 * _name if schNm tells us the current schema is a different one from the
261252 * one in which we're defined. If so, we may have an alternate name for
262253 * that schema (it may be listed in our altNames list). This would be the
263254 * case if schNm USEs or REFERENCEs type and renames it in the process
264255 * (e.g., "USE (X as Y)".
265256 */
266- {
257+ int TypeDescriptor::CurrName ( const char * other, const char * schNm ) const {
267258 if ( !schNm || *schNm == ' \0 ' ) {
268259 // If there's no current schema, accept any possible name of this.
269260 // (I.e., accept its actual name or any substitute):
@@ -280,35 +271,29 @@ TypeDescriptor::CurrName( const char * other, const char * schNm ) const
280271 }
281272}
282273
283- int
284- TypeDescriptor::PossName ( const char * nm ) const
285- /*
286- * return TRUE if nm is either our name or one of the possible alternates.
274+ /* *
275+ * return true if nm is either our name or one of the possible alternates.
287276 */
288- {
277+ int TypeDescriptor::PossName ( const char * nm ) const {
289278 return ( OurName ( nm ) || AltName ( nm ) );
290279}
291280
292- int
293- TypeDescriptor::OurName ( const char * nm ) const {
281+ int TypeDescriptor::OurName ( const char * nm ) const {
294282 return !StrCmpIns ( nm, _name );
295283}
296284
297- int
298- TypeDescriptor::AltName ( const char * nm ) const {
285+ int TypeDescriptor::AltName ( const char * nm ) const {
299286 if ( altNames ) {
300287 return ( altNames->choice ( nm ) );
301288 }
302289 return 0 ;
303290}
304291
305- void
306- TypeDescriptor::addAltName ( const char * schnm, const char * newnm )
307- /*
292+ /* *
308293 * Creates a SchRename consisting of schnm & newnm. Places it in alphabe-
309294 * tical order in this's altNames list.
310295 */
311- {
296+ void TypeDescriptor::addAltName ( const char * schnm, const char * newnm ) {
312297 SchRename * newpair = new SchRename ( schnm, newnm ),
313298 *node = ( SchRename * )altNames, *prev = NULL ;
314299
@@ -327,13 +312,11 @@ TypeDescriptor::addAltName( const char * schnm, const char * newnm )
327312 }
328313}
329314
330- int
331- SchRename::choice ( const char * nm ) const
332- /*
315+ /* *
333316 * See if nm = one of our choices (either ours or that of a SchRename
334317 * later in the list.
335318 */
336- {
319+ int SchRename::choice ( const char * nm ) const {
337320 if ( !StrCmpIns ( nm, newName ) ) {
338321 return 1 ;
339322 }
@@ -343,16 +326,14 @@ SchRename::choice( const char * nm ) const
343326 return 0 ;
344327}
345328
346- char *
347- SchRename::rename ( const char * schnm, char * newnm ) const
348- /*
329+ /* *
349330 * Check if this SchRename represents the rename of its owning TypeDesc for
350331 * schema schnm. (This will be the case if schnm = schName.) If so, the
351332 * new name is returned and copied into newnm. If not, ::rename is called
352333 * on next. Thus, this function will tell us if this or any later SchRe-
353334 * name in this list provide a new name for TypeDesc for schema schnm.
354335 */
355- {
336+ char * SchRename::rename ( const char * schnm, char * newnm ) const {
356337 if ( !StrCmpIns ( schnm, schName ) ) {
357338 strcpy ( newnm, newName );
358339 return newnm;
@@ -367,19 +348,11 @@ SchRename::rename( const char * schnm, char * newnm ) const
367348// AttrDescriptor functions
368349// /////////////////////////////////////////////////////////////////////////////
369350
370- AttrDescriptor::AttrDescriptor (
371- const char * name, // i.e. char *
372- const TypeDescriptor * domainType,
373- Logical optional, // i.e. F U or T
374- Logical unique, // i.e. F U or T
375- AttrType_Enum at, // AttrType_Explicit,AttrType_Inverse,
376- // AttrType_Deriving,AttrType_Redefining
377- const EntityDescriptor & owner )
351+ AttrDescriptor::AttrDescriptor ( const char * name, const TypeDescriptor * domainType,
352+ Logical optional, Logical unique, AttrType_Enum at,
353+ const EntityDescriptor & owner )
378354 : _name( name ), _domainType( domainType ), _optional( optional ),
379- _unique( unique ), _attrType( at ),
380-
381- _owner( ( EntityDescriptor & )owner )
382- {
355+ _unique( unique ), _attrType( at ), _owner( ( EntityDescriptor & )owner ) {
383356}
384357
385358AttrDescriptor::~AttrDescriptor () {
@@ -413,47 +386,8 @@ Logical AttrDescriptor::Deriving() const {
413386 return LFalse;
414387}
415388
416- /*
417- // outdated function
418- void
419- AttrDescriptor::Derived( SDAI_LOGICAL x ) {
420- if( x.asInt() ) {
421- _attrType = AttrType_Deriving;
422- } else {
423- _attrType = AttrType_Explicit;
424- }
425- }
426- */
427-
428- // outdated function
429- void
430- AttrDescriptor::Derived ( Logical x ) {
431- if ( x == LTrue ) {
432- _attrType = AttrType_Deriving;
433- } else {
434- _attrType = AttrType_Explicit;
435- }
436- }
437-
438- // outdated function
439- void
440- AttrDescriptor::Derived ( const char * x ) {
441- if ( !strcmp ( x, " LTrue" ) || !strcmp ( x, " T" ) ) {
442- _attrType = AttrType_Deriving;
443- } else {
444- _attrType = AttrType_Explicit;
445- }
446- }
447-
448-
449- Derived_attribute::Derived_attribute (
450- const char * name, // i.e. char *
451- const TypeDescriptor * domainType,
452- Logical optional, // i.e. F U or T
453- Logical unique, // i.e. F U or T
454- AttrType_Enum at, // AttrType_Explicit,AttrType_Inverse,
455- // AttrType_Deriving,AttrType_Redefining
456- const EntityDescriptor & owner )
389+ Derived_attribute::Derived_attribute ( const char * name, const TypeDescriptor * domainType,
390+ Logical optional, Logical unique, AttrType_Enum at, const EntityDescriptor & owner )
457391 : AttrDescriptor( name, domainType, optional, unique, at, owner ) {
458392 _initializer = ( const char * )0 ;
459393}
0 commit comments