fix another delete problem - this one in SCLP23(Select)::STEPWrite

also remove some commented code and replace more tabs with spaces (?!)
This commit is contained in:
Mark Pictor
2011-09-15 16:19:38 -04:00
parent abb3addf43
commit 0dccb8ba86
5 changed files with 178 additions and 246 deletions
+162 -180
View File
@@ -12,18 +12,10 @@
* and is not subject to copyright.
*/
/* $Id: STEPaggregate.h,v 3.0.1.6 1997/11/05 21:59:27 sauderd DP3.1 $ */
#ifdef __O3DB__
#include <OpenOODB.h>
#endif
class InstMgr;
class STEPaggregate;
#ifndef _ODI_OSSG_
class LOGICAL;
class BOOLEAN;
#endif
class TypeDescriptor;
#include <errordesc.h>
@@ -33,15 +25,9 @@ class TypeDescriptor;
#include <STEPundefined.h>
#include <string>
//class SCLP23(Application_instance);
//#define S_ENTITY_NULL &NilSTEPentity
//extern SCLP23(Application_instance) NilSTEPentity;
#define AGGR_NULL &NilSTEPaggregate
#define AGGR_NULL &NilSTEPaggregate
extern STEPaggregate NilSTEPaggregate;
//typedef unsigned short BOOLEAN;
class SingleLinkNode;
/******************************************************************************
@@ -52,7 +38,7 @@ typedef STEPaggregate * STEPaggregateH;
typedef STEPaggregate * STEPaggregate_ptr;
typedef STEPaggregate_ptr STEPaggregate_var;
class STEPaggregate : public SingleLinkList
class STEPaggregate : public SingleLinkList
{
protected:
int _null;
@@ -60,58 +46,55 @@ class STEPaggregate : public SingleLinkList
protected:
virtual Severity ReadValue(istream &in, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId =0,
int assignVal =1, int ExchangeFileFormat =1,
const char *currSch =0);
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId =0,
int assignVal =1, int ExchangeFileFormat =1,
const char *currSch =0);
public:
int is_null() { return _null; }
virtual Severity AggrValidLevel(const char *value, ErrorDescriptor *err,
const TypeDescriptor *elem_type, InstMgr *insts,
int optional, char *tokenList, int addFileId =0,
int clearError =0);
const TypeDescriptor *elem_type, InstMgr *insts,
int optional, char *tokenList, int addFileId =0,
int clearError =0);
virtual Severity AggrValidLevel(istream &in, ErrorDescriptor *err,
const TypeDescriptor *elem_type, InstMgr *insts,
int optional, char *tokenList, int addFileId =0,
int clearError =0);
const TypeDescriptor *elem_type, InstMgr *insts,
int optional, char *tokenList, int addFileId =0,
int clearError =0);
// INPUT
virtual Severity StrToVal(const char *s, ErrorDescriptor *err =0,
const TypeDescriptor *elem_type =0,
InstMgr *insts =0, int addFileId = 0);
const TypeDescriptor *elem_type =0,
InstMgr *insts =0, int addFileId = 0);
virtual Severity STEPread (istream& in, ErrorDescriptor *err,
const TypeDescriptor *elem_type =0,
InstMgr *insts =0, int addFileId =0,
const char *currSch =0);
const TypeDescriptor *elem_type =0,
InstMgr *insts =0, int addFileId =0,
const char *currSch =0);
// OUTPUT
virtual const char *asStr(std::string& s) const;
virtual void STEPwrite (ostream& out =cout, const char * =0) const;
// SingleLinkNode * GetHead () const
// { return (STEPnode *) SingleLinkList::GetHead(); }
virtual SingleLinkNode * NewNode ();
virtual SingleLinkNode * NewNode ();
void AddNode (SingleLinkNode *);
void Empty ();
STEPaggregate ();
virtual ~STEPaggregate ();
// COPY - defined in subtypes
virtual STEPaggregate& ShallowCopy (const STEPaggregate&);
};
};
/******************************************************************
** Class: GenericAggregate
** Description: This class supports LIST OF:
** SELECT_TYPE, BINARY_TYPE, GENERIC_TYPE, ENUM_TYPE, UNKNOWN_TYPE type
** Description: This class supports LIST OF:
** SELECT_TYPE, BINARY_TYPE, GENERIC_TYPE, ENUM_TYPE, UNKNOWN_TYPE type
******************************************************************/
class GenericAggregate : public STEPaggregate
class GenericAggregate : public STEPaggregate
{
public:
virtual SingleLinkNode *NewNode();
@@ -129,14 +112,14 @@ typedef GenericAggregate_ptr GenericAggregate_var;
**
*****************************************************************************/
class EntityAggregate : public STEPaggregate
class EntityAggregate : public STEPaggregate
{
public:
virtual Severity ReadValue(istream &in, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId =0,
int assignVal =1, int ExchangeFileFormat =1,
const char *currSch =0);
virtual Severity ReadValue(istream &in, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId =0,
int assignVal =1, int ExchangeFileFormat =1,
const char *currSch =0);
virtual SingleLinkNode *NewNode();
virtual STEPaggregate& ShallowCopy (const STEPaggregate&);
@@ -151,17 +134,17 @@ typedef EntityAggregate_ptr EntityAggregate_var;
/******************************************************************
** Class: SelectAggregate
** Description: this is a minimal representions for a collection of
** SCLP23(Select)
** Description: this is a minimal representions for a collection of
** SCLP23(Select)
******************************************************************/
class SelectAggregate : public STEPaggregate
class SelectAggregate : public STEPaggregate
{
public:
virtual Severity ReadValue(istream &in, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId =0,
int assignVal =1, int ExchangeFileFormat =1,
const char *currSch =0);
virtual Severity ReadValue(istream &in, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId =0,
int assignVal =1, int ExchangeFileFormat =1,
const char *currSch =0);
virtual SingleLinkNode *NewNode ();
virtual STEPaggregate& ShallowCopy (const STEPaggregate&);
@@ -178,7 +161,7 @@ typedef SelectAggregate_ptr SelectAggregate_var;
** Class: StringAggregate
** Description: This class supports LIST OF STRING type
******************************************************************/
class StringAggregate : public STEPaggregate
class StringAggregate : public STEPaggregate
{
public:
virtual SingleLinkNode *NewNode();
@@ -197,7 +180,7 @@ typedef StringAggregate_ptr StringAggregate_var;
** Class: BinaryAggregate
** Description: This class supports LIST OF BINARY type
******************************************************************/
class BinaryAggregate : public STEPaggregate
class BinaryAggregate : public STEPaggregate
{
public:
virtual SingleLinkNode *NewNode();
@@ -213,10 +196,10 @@ typedef BinaryAggregate_ptr BinaryAggregate_var;
/******************************************************************
** Class: EnumAggregate
** Description: this is a minimal representions for a collection of
** SCLP23(Enum)
** Description: this is a minimal representions for a collection of
** SCLP23(Enum)
******************************************************************/
class EnumAggregate : public STEPaggregate
class EnumAggregate : public STEPaggregate
{
public:
virtual SingleLinkNode *NewNode ();
@@ -230,10 +213,10 @@ typedef EnumAggregate * EnumAggregateH;
typedef EnumAggregate * EnumAggregate_ptr;
typedef EnumAggregate_ptr EnumAggregate_var;
class LOGICALS : public EnumAggregate
class LOGICALS : public EnumAggregate
{
public:
virtual SingleLinkNode * NewNode ();
virtual SingleLinkNode * NewNode ();
LOGICALS();
virtual ~LOGICALS();
@@ -245,17 +228,16 @@ typedef LOGICALS_ptr LOGICALS_var;
LOGICALS * create_LOGICALS();
class BOOLEANS : public EnumAggregate
class BOOLEANS : public EnumAggregate
{
public:
virtual SingleLinkNode * NewNode ();
virtual SingleLinkNode * NewNode ();
BOOLEANS();
virtual ~BOOLEANS();
};
//typedef BOOLEANS * BooleansH;
typedef BOOLEANS * BOOLEANS_ptr;
typedef BOOLEANS_ptr BOOLEANS_var;
@@ -300,17 +282,17 @@ class STEPnode : public SingleLinkNode {
int _null;
public:
int is_null() { return _null; }
void set_null() { _null = 1; }
int is_null() { return _null; }
void set_null() { _null = 1; }
// INPUT
// INPUT
virtual Severity StrToVal(const char *s, ErrorDescriptor *err);
virtual Severity StrToVal(istream &in, ErrorDescriptor *err);
virtual Severity STEPread(const char *s, ErrorDescriptor *err);
virtual Severity STEPread(istream &in, ErrorDescriptor *err);
// OUTPUT
// OUTPUT
virtual const char *asStr(std::string& s);
virtual const char *STEPwrite(std::string& s, const char * =0);
virtual void STEPwrite (ostream& out =cout);
@@ -328,25 +310,25 @@ class GenericAggrNode : public STEPnode {
SCLundefined value;
public:
// INPUT
// INPUT
virtual Severity StrToVal(const char *s, ErrorDescriptor *err);
virtual Severity StrToVal(istream &in, ErrorDescriptor *err);
virtual Severity STEPread(const char *s, ErrorDescriptor *err);
virtual Severity STEPread(istream &in, ErrorDescriptor *err);
// OUTPUT
// OUTPUT
virtual const char *asStr(std::string& s);
virtual const char *STEPwrite(std::string& s, const char * =0);
virtual void STEPwrite (ostream& out =cout);
virtual void STEPwrite (ostream& out =cout);
// CONSTRUCTORS
// CONSTRUCTORS
GenericAggrNode (const char *str);
GenericAggrNode (GenericAggrNode& gan);
GenericAggrNode ();
~GenericAggrNode ();
virtual SingleLinkNode * NewNode ();
virtual SingleLinkNode * NewNode ();
};
@@ -357,56 +339,56 @@ class EntityNode : public STEPnode {
SCLP23(Application_instance) * node;
// INPUT
virtual Severity StrToVal(const char *s, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId = 0);
virtual Severity StrToVal(istream &in, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId = 0);
virtual Severity StrToVal(const char *s, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId = 0);
virtual Severity StrToVal(istream &in, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId = 0);
virtual Severity STEPread(const char *s, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId = 0);
virtual Severity STEPread(istream &in, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId = 0);
// OUTPUT
virtual Severity STEPread(const char *s, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId = 0);
virtual Severity STEPread(istream &in, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId = 0);
// OUTPUT
virtual const char *asStr(std::string& s);
virtual const char *STEPwrite (std::string& s, const char * =0);
virtual void STEPwrite (ostream& out =cout);
virtual void STEPwrite (ostream& out =cout);
// CONSTRUCTORS
// CONSTRUCTORS
EntityNode (SCLP23(Application_instance) * e);
EntityNode();
~EntityNode();
virtual SingleLinkNode * NewNode ();
virtual SingleLinkNode * NewNode ();
// Calling these funtions is an error.
Severity StrToVal(const char *s, ErrorDescriptor *err)
{
cerr << "Internal error: " << __FILE__ << __LINE__
<< "\n" << _POC_ "\n";
return StrToVal(s, err, 0, 0, 0);
cerr << "Internal error: " << __FILE__ << __LINE__
<< "\n" << _POC_ "\n";
return StrToVal(s, err, 0, 0, 0);
}
Severity StrToVal(istream &in, ErrorDescriptor *err)
{
cerr << "Internal error: " << __FILE__ << __LINE__
<< "\n" << _POC_ "\n";
return StrToVal(in, err, 0, 0, 0);
cerr << "Internal error: " << __FILE__ << __LINE__
<< "\n" << _POC_ "\n";
return StrToVal(in, err, 0, 0, 0);
}
Severity STEPread(const char *s, ErrorDescriptor *err)
{
cerr << "Internal error: " << __FILE__ << __LINE__
<< "\n" << _POC_ "\n";
return STEPread(s, err, 0, 0, 0);
cerr << "Internal error: " << __FILE__ << __LINE__
<< "\n" << _POC_ "\n";
return STEPread(s, err, 0, 0, 0);
}
Severity STEPread(istream &in, ErrorDescriptor *err)
{
cerr << "Internal error: " << __FILE__ << __LINE__
<< "\n" << _POC_ "\n";
return STEPread(in, err, 0, 0, 0);
cerr << "Internal error: " << __FILE__ << __LINE__
<< "\n" << _POC_ "\n";
return STEPread(in, err, 0, 0, 0);
}
};
@@ -416,7 +398,7 @@ class EntityNode : public STEPnode {
/******************************************************************
** Class: SelectNode
** Description: this is a minimal representions for node in lists of
** SCLP23(Select)
** SCLP23(Select)
******************************************************************/
class SelectNode : public STEPnode {
@@ -425,59 +407,59 @@ class SelectNode : public STEPnode {
SCLP23(Select) * node;
public:
// INPUT
virtual Severity StrToVal(const char *s, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId = 0);
virtual Severity StrToVal(istream &in, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId = 0,
const char *currSch =0);
// INPUT
virtual Severity StrToVal(const char *s, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId = 0);
virtual Severity StrToVal(istream &in, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId = 0,
const char *currSch =0);
virtual Severity STEPread(const char *s, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId = 0);
virtual Severity STEPread(istream &in, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId = 0,
const char *currSch =0);
// OUTPUT
virtual Severity STEPread(const char *s, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId = 0);
virtual Severity STEPread(istream &in, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId = 0,
const char *currSch =0);
// OUTPUT
virtual const char *asStr(std::string& s);
virtual const char *STEPwrite (std::string& s, const char * =0);
virtual void STEPwrite (ostream& out =cout);
virtual void STEPwrite (ostream& out =cout);
// CONSTRUCTORS
// CONSTRUCTORS
SelectNode(SCLP23(Select) * s);
SelectNode();
~SelectNode();
virtual SingleLinkNode * NewNode ();
virtual SingleLinkNode * NewNode ();
// Calling these funtions is an error.
Severity StrToVal(const char *s, ErrorDescriptor *err)
{
cerr << "Internal error: " << __FILE__ << __LINE__
<< "\n" << _POC_ "\n";
return StrToVal(s, err, 0, 0, 0);
cerr << "Internal error: " << __FILE__ << __LINE__
<< "\n" << _POC_ "\n";
return StrToVal(s, err, 0, 0, 0);
}
Severity StrToVal(istream &in, ErrorDescriptor *err)
{
cerr << "Internal error: " << __FILE__ << __LINE__
<< "\n" << _POC_ "\n";
return StrToVal(in, err, 0, 0, 0);
cerr << "Internal error: " << __FILE__ << __LINE__
<< "\n" << _POC_ "\n";
return StrToVal(in, err, 0, 0, 0);
}
Severity STEPread(const char *s, ErrorDescriptor *err)
{
cerr << "Internal error: " << __FILE__ << __LINE__
<< "\n" << _POC_ "\n";
return STEPread(s, err, 0, 0, 0);
cerr << "Internal error: " << __FILE__ << __LINE__
<< "\n" << _POC_ "\n";
return STEPread(s, err, 0, 0, 0);
}
Severity STEPread(istream &in, ErrorDescriptor *err)
{
cerr << "Internal error: " << __FILE__ << __LINE__
<< "\n" << _POC_ "\n";
return STEPread(in, err, 0, 0, 0);
cerr << "Internal error: " << __FILE__ << __LINE__
<< "\n" << _POC_ "\n";
return STEPread(in, err, 0, 0, 0);
}
};
@@ -495,25 +477,25 @@ class StringNode : public STEPnode {
SCLP23(String) value;
public:
// INPUT
// INPUT
virtual Severity StrToVal(const char *s, ErrorDescriptor *err);
virtual Severity StrToVal(istream &in, ErrorDescriptor *err);
virtual Severity STEPread(const char *s, ErrorDescriptor *err);
virtual Severity STEPread(istream &in, ErrorDescriptor *err);
// OUTPUT
// OUTPUT
virtual const char *asStr(std::string& s);
virtual const char *STEPwrite (std::string& s, const char * =0);
virtual void STEPwrite (ostream& out =cout);
virtual void STEPwrite (ostream& out =cout);
// CONSTRUCTORS
// CONSTRUCTORS
StringNode(StringNode& sn);
StringNode (const char * sStr);
StringNode();
~StringNode();
virtual SingleLinkNode * NewNode ();
virtual SingleLinkNode * NewNode ();
};
@@ -530,32 +512,32 @@ class BinaryNode : public STEPnode {
SCLP23(Binary) value;
public:
// INPUT
// INPUT
virtual Severity StrToVal(const char *s, ErrorDescriptor *err);
virtual Severity StrToVal(istream &in, ErrorDescriptor *err);
virtual Severity STEPread(const char *s, ErrorDescriptor *err);
virtual Severity STEPread(istream &in, ErrorDescriptor *err);
// OUTPUT
// OUTPUT
virtual const char *asStr(std::string& s);
virtual const char *STEPwrite (std::string& s, const char * =0);
virtual void STEPwrite (ostream& out =cout);
virtual void STEPwrite (ostream& out =cout);
// CONSTRUCTORS
// CONSTRUCTORS
BinaryNode(BinaryNode& bn);
BinaryNode (const char * sStr);
BinaryNode();
~BinaryNode();
virtual SingleLinkNode * NewNode ();
virtual SingleLinkNode * NewNode ();
};
/******************************************************************
** Class: EnumNode
** Description: this is a minimal representions for node in lists of
** SCLP23(Enum)
** SCLP23(Enum)
******************************************************************/
class EnumNode : public STEPnode {
@@ -564,24 +546,24 @@ class EnumNode : public STEPnode {
SCLP23(Enum) * node;
public:
// INPUT
// INPUT
virtual Severity StrToVal(const char *s, ErrorDescriptor *err);
virtual Severity StrToVal(istream &in, ErrorDescriptor *err);
virtual Severity STEPread(const char *s, ErrorDescriptor *err);
virtual Severity STEPread(istream &in, ErrorDescriptor *err);
// OUTPUT
// OUTPUT
virtual const char *asStr(std::string& s);
virtual const char *STEPwrite (std::string& s, const char * =0);
virtual void STEPwrite (ostream& out =cout);
virtual void STEPwrite (ostream& out =cout);
// CONSTRUCTORS
// CONSTRUCTORS
EnumNode(SCLP23(Enum) * e);
EnumNode();
~EnumNode();
virtual SingleLinkNode * NewNode ();
virtual SingleLinkNode * NewNode ();
};
@@ -590,23 +572,23 @@ class RealNode : public STEPnode {
SCLP23(Real) value; // double
public:
// INPUT
// INPUT
virtual Severity StrToVal(const char *s, ErrorDescriptor *err);
virtual Severity StrToVal(istream &in, ErrorDescriptor *err);
virtual Severity STEPread(const char *s, ErrorDescriptor *err);
virtual Severity STEPread(istream &in, ErrorDescriptor *err);
// OUTPUT
// OUTPUT
virtual const char *asStr(std::string& s);
virtual const char *STEPwrite (std::string& s, const char * =0);
virtual void STEPwrite (ostream& out =cout);
virtual void STEPwrite (ostream& out =cout);
// CONSTRUCTORS
// CONSTRUCTORS
RealNode();
~RealNode();
virtual SingleLinkNode * NewNode ();
virtual SingleLinkNode * NewNode ();
};
@@ -615,52 +597,52 @@ class IntNode : public STEPnode {
SCLP23(Integer) value; // long int
public:
// INPUT
// INPUT
virtual Severity StrToVal(const char *s, ErrorDescriptor *err);
virtual Severity StrToVal(istream &in, ErrorDescriptor *err);
virtual Severity STEPread(const char *s, ErrorDescriptor *err);
virtual Severity STEPread(istream &in, ErrorDescriptor *err);
// OUTPUT
// OUTPUT
virtual const char *asStr(std::string& s);
virtual const char *STEPwrite (std::string& s, const char * =0);
virtual void STEPwrite (ostream& out =cout);
virtual void STEPwrite (ostream& out =cout);
// CONSTRUCTORS
// CONSTRUCTORS
IntNode();
~IntNode();
virtual SingleLinkNode * NewNode ();
virtual SingleLinkNode * NewNode ();
};
/******************************************************************
** The following classes are currently stubs
**
** The following classes are currently stubs
**
**/
/*
class Array : public STEPaggregate {
public:
int lowerBound;
int upperBound;
class Array : public STEPaggregate {
public:
int lowerBound;
int upperBound;
};
class Bag : public STEPaggregate {
public:
int min_ele;
int max_ele;
class Bag : public STEPaggregate {
public:
int min_ele;
int max_ele;
};
class List : public STEPaggregate {
int min_ele;
int max_ele;
List *prev;
class List : public STEPaggregate {
int min_ele;
int max_ele;
List *prev;
};
class Set :
public STEPaggregate {
int cnt;
class Set :
public STEPaggregate {
int cnt;
};
*/
#endif
#endif
+7 -51
View File
@@ -10,12 +10,9 @@
* and is not subject to copyright.
*/
/* $Id: sdaiSelect.cc,v 1.6 1997/11/05 21:59:16 sauderd DP3.1 $ */
#include <stdio.h> // to get the BUFSIZ #define
#include <ExpDict.h>
#include <sstream>
//#include <STEPentity.h>
#include <string>
#include <sdai.h>
#include <STEPattribute.h>
@@ -358,12 +355,6 @@ SCLP23( Select )::STEPread( istream & in, ErrorDescriptor * err,
return SEVERITY_WARNING;
}
}
/* if (!in.good())
{
err->GreaterSeverity( SEVERITY_INPUT_ERROR );
return SEVERITY_INPUT_ERROR;
}
*/
}
// NOTE **** anything that gets read below here is invalid according to the
// Technical Corrigendum for Part 21 (except for reading an entity instance
@@ -372,11 +363,6 @@ SCLP23( Select )::STEPread( istream & in, ErrorDescriptor * err,
// is what it does (for every type but entity instance refs). DAS 2/4/97
else { // case A
// the type can be determined from the value
// if (_type && ! _type -> UniqueElements ()) {
// err->AppendToDetailMsg("Type for value of SELECT is ambiguous.\n" );
// err->GreaterSeverity( SEVERITY_WARNING );
// }
switch( c ) {
case '$':
nullify();
@@ -466,7 +452,6 @@ SCLP23( Select )::STEPread( istream & in, ErrorDescriptor * err,
default:
// ambiguous - ERROR: underlying type should have been set
// STEPread_error ();
err->AppendToDetailMsg(
"type for SELECT could not be determined from value.\n" );
nullify();
@@ -482,10 +467,9 @@ SCLP23( Select )::STEPread( istream & in, ErrorDescriptor * err,
// now the type descriptor should be derivable from the base_type
// if it\'s not issue a warning
// if it's not issue a warning
if( _type && !( IsUnique( base_type ) ) ) {
err->AppendToDetailMsg( "Value for SELECT will be assigned to first possible choice.\n" );
// err->GreaterSeverity( SEVERITY_INCOMPLETE );
err->GreaterSeverity( SEVERITY_USERMSG );
}
@@ -538,7 +522,6 @@ SCLP23( Select )::STEPwrite( ostream & out, const char * currSch ) const {
out << "$";
return;
}
// switch(ValueType()) // This doesn't work DAS 2/4/97
switch( underlying_type->NonRefType() ) {
case sdaiINSTANCE: {
STEPwrite_content( out );
@@ -546,7 +529,6 @@ SCLP23( Select )::STEPwrite( ostream & out, const char * currSch ) const {
}
case sdaiSELECT: { // The name of a select is never written DAS 1/31/97
if( underlying_type->Type() == REFERENCE_TYPE ) {
// if(underlying_type->NonRefType() == sdaiSELECT)
std::string s;
out << StrToUpper( underlying_type->Name( currSch ), s ) << "(";
STEPwrite_content( out, currSch );
@@ -579,52 +561,26 @@ SCLP23( Select )::STEPwrite( ostream & out, const char * currSch ) const {
}
}
void
SCLP23( Select )::STEPwrite_verbose( ostream & out, const char * currSch ) const {
void SCLP23( Select )::STEPwrite_verbose( ostream & out, const char * currSch ) const {
std::string tmp;
out << StrToUpper( CurrentUnderlyingType()->Name( currSch ), tmp ) << "(";
STEPwrite_content( out );
out << ")";
}
const char *
SCLP23( Select )::STEPwrite( std::string & s, const char * currSch ) const {
const char * SCLP23( Select )::STEPwrite( std::string & s, const char * currSch ) const {
ostringstream buf;
STEPwrite( buf, currSch );
buf << ends; // have to add the terminating \0 char
char * tmp;
/*** tmp = buf.str (); ***/
tmp = &( buf.str()[0] );
s = tmp;
delete tmp;
buf << ends; // add the terminating \0 char
s = buf.str();
return const_cast<char *>( s.c_str() );
}
//SCLP23(Select)&
//SCLP23(Select)::operator= (SCLP23(Select)& x)
//{
// return *this;
//}
#ifdef OBSOLETE
char *
SCLP23( Select )::asStr() const {
strstream buf;
STEPwrite( buf );
/* STEPwrite_content (buf);*/
buf << ends; // have to add the terminating \0 char
return buf.str(); // need to delete this space
}
#endif
int
SCLP23( Select )::set_null() {
int SCLP23( Select )::set_null() {
nullify();
return 1;
}
int
SCLP23( Select )::is_null() {
int SCLP23( Select )::is_null() {
return ( !exists() );
}
+3 -2
View File
@@ -193,13 +193,14 @@ bool DirObj::IsADirectory( const char * path ) {
///////////////////////////////////////////////////////////////////////////////
const std::string DirObj::Normalize( const std::string & path ) {
char b[MAX_PATH];
std::string buf;
const char * slash;
#if defined(__WIN32__)
char b[MAX_PATH];
PathCanonicalize(b, path.c_str());
slash = "\\";
#else
char * b;
b = realpath(path.c_str(),0);
slash = "/";
#endif
@@ -214,7 +215,7 @@ const std::string DirObj::Normalize( const std::string & path ) {
buf.append(slash);
// if buf is a path to a directory and doesn't end with '/'
} else if( IsADirectory( buf.c_str() ) && buf[buf.size()] != '/' ) {
} else if( IsADirectory( buf.c_str() ) && buf[buf.size()] != slash[0] ) {
buf.append(slash);
}
return buf;
-12
View File
@@ -1,25 +1,13 @@
#ifndef COMPLEXSUP_H
#define COMPLEXSUP_H
#ifdef HAVE_MEMCPY
# ifdef __CLCC__
void* memcpy(void*, const void*, int);
# endif
#endif
#include <iostream>
#include <fstream>
using namespace std;
extern "C"
{
//#include <stddef.h>
//#include <string.h>
//#include <stdio.h>
//#include <stdlib.h>
#include <string.h>
//#include <ctype.h>
//extern char * strncpy(char *, const char *, size_t);
#include "classes.h"
#include "../express/express.h"
#include "../exppp/exppp.h"
+6 -1
View File
@@ -67,7 +67,12 @@ void ComplexCollect::write( const char * fname )
// First write to os the variables it will need:
complex << " ComplexCollect *cc;\n";
complex << " ComplexList *cl;\n";
//FIXME compstructs.cc:26:50: warning: unused variable ‘next30’ [-Wunused-variable]
/*
* FIXME compstructs.cc:26:50: warning: unused variable ‘next30’ [-Wunused-variable]
* see MultList::write() below, line 169 - level, defined in complexSupport.h,
* records which variable is being used. Perhaps we can track max(level) and only
* write that many variables here.
*/
complex << " EntList *node, *child, *next1, *next2, *next3, *next4,\n"
<< " *next5, *next6, *next7, *next8, *next9, *next10,\n"
<< " *next11, *next12, *next13, *next14, *next15,\n"