Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/cleditor/STEPfile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ STEPfile::ReadData1( istream & in ) {
std::string tmpbuf;

SCLP23( Application_instance ) * obj = ENTITY_NULL;
stateEnum inst_state; // used if reading working file
stateEnum inst_state = noStateSE; // used if reading working file

ErrorDescriptor e;

Expand All @@ -583,7 +583,6 @@ STEPfile::ReadData1( istream & in ) {
in >> c;

if( _fileType == WORKING_SESSION ) {
inst_state = noStateSE;
if( strchr( "CIND", c ) ) { // if there is a valid char
inst_state = EntityWfState( c );
ReadTokenSeparator( in );
Expand Down Expand Up @@ -974,7 +973,7 @@ STEPfile::ReadData2( istream & in, int useTechCor ) {

int total_instances = 0;
int valid_insts = 0; // used for exchange file only
stateEnum inst_state; // used if reading working file
stateEnum inst_state = noStateSE; // used if reading working file

_errorCount = 0; // reset error count
_warningCount = 0; // reset error count
Expand All @@ -997,7 +996,6 @@ STEPfile::ReadData2( istream & in, int useTechCor ) {
in >> c;

if( _fileType == WORKING_SESSION ) {
inst_state = noStateSE;
if( strchr( "CIND", c ) ) { // if there is a valid char
inst_state = EntityWfState( c );
ReadTokenSeparator( in, &cmtStr );
Expand Down Expand Up @@ -1642,7 +1640,8 @@ STEPfile::CreateScopeInstances( istream & in, SCLP23( Application_instance_ptr )
in.putback( c );
*scopelist = new SCLP23( Application_instance_ptr ) [i];
while( i > 0 ) {
*scopelist [--i] = inscope [i];
*scopelist [i-1] = inscope [i];
i--;
}

//check for "ENDSCOPE"
Expand Down
2 changes: 1 addition & 1 deletion src/cleditor/mgrnodearray.cc
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ int MgrNodeArraySorted::MgrNodeIndex( int fileId ) {
}
int low = 0;
int high = _count - 1;
int mid;
int mid = 0;
int found = 0;
int curFileId;

Expand Down
2 changes: 2 additions & 0 deletions src/clstepcore/STEPattributeList.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ STEPattribute & STEPattributeList::operator []( int n ) {
// else
cerr << "\nERROR in STEP Core library: " << __FILE__ << ":"
<< __LINE__ << "\n" << _POC_ << "\n\n";
abort();
return *(STEPattribute*) 0; //will never get here, but gcc produces warning
}

int STEPattributeList::list_length() {
Expand Down
29 changes: 8 additions & 21 deletions src/clstepcore/STEPcomplex.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <STEPcomplex.h>
#include <complexSupport.h>
#include <STEPattribute.h>
#include <sstream>

extern const char *
ReadStdKeyword( istream & in, std::string & buf, int skipInitWS );
Expand Down Expand Up @@ -554,27 +555,13 @@ const char *
STEPcomplex::STEPwrite( std::string & buf, const char * currSch ) {
buf.clear();

buf.append( "#" );
buf.append( ( char * )STEPfile_id );
buf.append( "=" );
buf.append( "(" );
/*
char instanceInfo[BUFSIZ];
sprintf(instanceInfo, "#%d=", STEPfile_id );
*/
/*
strstream ss;
ss << "#" << STEPfile_id << "=(";
WriteExtMapEntities(ss, currSch);
ss << ");";
ss << ends;

char *tmpstr = ss.str();
buf.Append(tmpstr);
delete tmpstr;
*/
WriteExtMapEntities( buf, currSch );
buf.append( ");" );
stringstream ss;
ss << "#" << STEPfile_id << "=(";
WriteExtMapEntities(ss, currSch);
ss << ");";
ss << ends;

buf.append(ss.str());

return const_cast<char *>( buf.c_str() );
}
Expand Down
2 changes: 1 addition & 1 deletion src/clstepcore/collect.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ int ComplexCollect::supports( EntNode * ents ) const
*/
{
EntNode * node = ents, *nextnode;
AndList * alist;
AndList * alist = 0;
ComplexList * clist = clists, *cl = NULL, *current;
int retval;
EntList * elist, *next;
Expand Down
2 changes: 1 addition & 1 deletion src/clstepcore/complexlist.cc
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void ComplexList::addChildren( EntList * ent )
EntList * child;
char * nm;
EntNode * prev = list, *prev2 = NULL, *newnode;
int comp;
int comp = 0;

if( ent->multiple() ) {
child = ( ( MultList * )ent )->childList;
Expand Down
2 changes: 1 addition & 1 deletion src/clstepcore/match-ors.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ MatchType OrList::matchORs( EntNode * ents )
{
int count;
EntList * child = childList;
MatchType retval;
MatchType retval = UNKNOWN;

for( count = 0; count < numchildren; count++, child = child->next ) {

Expand Down
2 changes: 1 addition & 1 deletion src/clstepcore/multlist.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ EntList * MultList::copyList( EntList * ent )
* to the end of our list.
*/
{
EntList * newlist, *child;
EntList * newlist = 0, *child;

switch( ent->join ) {
case SIMPLE:
Expand Down
2 changes: 1 addition & 1 deletion src/clstepcore/print.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ ostream & operator << ( ostream & os, MultList & mlist )
*/
{
char jointype[7];
int k, lastSimple;
int k, lastSimple = 0;
// lastSimple - is the last child simple? If so, we need to print another
// line at the end. If not, the children of last child did already.
EntList * child = mlist.childList;
Expand Down
2 changes: 1 addition & 1 deletion src/exppp/exppp.c
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ LOOPout( struct Loop_ *loop, int level ) {

void
CASEout( struct Case_Statement_ *c, int level ) {
int len;
int len = 0;
int max_indent;

raw( "%*sCASE ", level, "" );
Expand Down
11 changes: 9 additions & 2 deletions src/express/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
IF ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
add_definitions( -DYYDEBUG ) #-Ddebugging
message("Bison will create a graph of the scanner flow at ${SCL_BINARY_DIR}/expparse.dot")
set( YACC_FLAGS "-t --graph=${SCL_BINARY_DIR}/expparse.dot" )
#set( EXTRA_YACC_FLAGS "-Wall" ) #-Wall introduced somewhere between bison v2.3 and v2.4.1

#This graph is HUGE! dot takes a very long time, so does loading it in a viewer
#enable with -DBISON_GRAPH=TRUE
if( BISON_GRAPH )
message("Bison will create a graph of the scanner flow at ${SCL_BINARY_DIR}/expparse.dot")
set( EXTRA_YACC_FLAGS "${EXTRA_YACC_FLAGS} --graph=${SCL_BINARY_DIR}/expparse.dot" )
endif( BISON_GRAPH )
set( YACC_FLAGS "-t ${EXTRA_YACC_FLAGS}" )
set( LEX_FLAGS "-d" )
ELSE()
set( LEX_FLAGS " " )
Expand Down
14 changes: 9 additions & 5 deletions src/express/expscan.l
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ static int nesting_level;
/* can't imagine this will ever be more than 2 or 3 - DEL */
#define MAX_NESTED_COMMENTS 20
static struct Symbol_ open_comment[MAX_NESTED_COMMENTS];
#define YY_NO_INPUT //warning: ‘input’ defined but not used [-Wunused-function]

#undef yywrap
static int
yywrap()
{
#define YY_SKIP_YYWRAP //warning: prototype for ‘yywrap’ follows non-prototype definition
static int yywrap() {
int i;

for (i=0;i<nesting_level && i<MAX_NESTED_COMMENTS;i++) {
Expand Down Expand Up @@ -398,8 +398,12 @@ if (first_time) {
<code>"*)" {
ERRORreport_with_line(ERROR_unmatched_close_comment,yylineno);
}

<comment>\n { NEWLINE; }
%{
/*
** expscan.l:402: warning, rule cannot be matched
** <comment>\n { NEWLINE; }
*/
%}
<comment>[^*()\n]* ;
<comment>[*()] ;

Expand Down
2 changes: 0 additions & 2 deletions src/express/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ Symbol *
UNK_get_symbol( Generic x ) {
fprintf( stderr, "OBJget_symbol called on object of unknown type\n" );
ERRORabort( 0 );
#if defined(lint) || defined(CENTERLINE)
return 0;
#endif
}

/*
Expand Down
2 changes: 1 addition & 1 deletion src/express/resolve.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ RESOLVEinitialize( void ) {

void
EXP_resolve( Expression expr, Scope scope, Type typecheck ) {
Function f;
Function f = 0;
Symbol * sym;
Generic x;
Entity e;
Expand Down
10 changes: 5 additions & 5 deletions src/fedex_plus/classes.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ generate_attribute_name( Variable a, char * out ) {
}
/* copy p to out */
/* DAR - fixed so that '\n's removed */
for( j = 0, q = out; p, j < BUFSIZ; p++ ) {
for( j = 0, q = out; j < BUFSIZ; p++ ) {
/* copy p to out, 1 char at time. Skip \n's and spaces, convert */
/* '.' to '_', and convert to lowercase. */
if( ( *p != '\n' ) && ( *p != ' ' ) ) {
Expand Down Expand Up @@ -492,7 +492,7 @@ generate_dict_attr_name( Variable a, char * out ) {
/* copy p to out */
strncpy( out, StrToLower( p ), BUFSIZ );
/* DAR - fixed so that '\n's removed */
for( j = 0, q = out; p, j < BUFSIZ; p++ ) {
for( j = 0, q = out; j < BUFSIZ; p++ ) {
/* copy p to out, 1 char at time. Skip \n's, and convert to lc. */
if( *p != '\n' ) {
*q = tolower( *p );
Expand Down Expand Up @@ -3105,7 +3105,7 @@ print_typechain( FILE * f, const Type t, char * buf, Schema schema ) {
/* the type_count variable is there for debugging purposes */

const char * ctype = TYPEget_ctype( t );
Type base;
Type base = 0;
int count = type_count++;
char typename_buf[MAX_LEN];

Expand Down Expand Up @@ -3663,7 +3663,7 @@ ENTITYprint_new( Entity entity, FILES * files, Schema schema, int externMap ) {
const char * n;
Linked_List wheres;
/* char buf[BUFSIZ],buf2[BUFSIZ]; */
char * whereRule, *whereRule_formatted;
char * whereRule, *whereRule_formatted = "";
int whereRule_formatted_size = 0;
char * ptr, *ptr2;
char * uniqRule, *uniqRule_formatted;
Expand Down Expand Up @@ -4749,7 +4749,7 @@ if( TYPEget_head( type ) ) {
void
TYPEprint_new( const Type type, FILE * create, Schema schema ) {
Linked_List wheres;
char * whereRule, *whereRule_formatted;
char * whereRule, *whereRule_formatted = "";
int whereRule_formatted_size = 0;
char * ptr, *ptr2;

Expand Down
2 changes: 1 addition & 1 deletion src/fedex_plus/classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ struct EntityTag_ {
Entity ENTITYget_superclass (Entity entity);
Entity ENTITYput_superclass (Entity entity);
int ENTITYhas_explicit_attributes (Entity e);
Linked_List ENTITYget_first_attribs(Entity entity, Linked_List result);
void ENTITYget_first_attribs(Entity entity, Linked_List result);

typedef struct SelectTag_ *SelectTag;
struct SelectTag_ {
Expand Down
15 changes: 7 additions & 8 deletions src/fedex_plus/classes_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -761,8 +761,7 @@ ENTITYget_superclass( Entity entity ) {
return ( tag ? tag -> superclass : 0 );
}

Linked_List
ENTITYget_first_attribs( Entity entity, Linked_List result ) {
void ENTITYget_first_attribs( Entity entity, Linked_List result ) {
Linked_List supers;

LISTdo( ENTITYget_attributes( entity ), attr, Generic )
Expand All @@ -777,13 +776,13 @@ ENTITYget_first_attribs( Entity entity, Linked_List result ) {
/* Attributes are divided into four categories:
** these are not exclusive as far as I can tell! I added defs below DAS
**
** . simple explicit
** . simple explicit
** . type shifters // not DERIVEd - redefines type in ancestor
// VARget_initializer(v) returns null

** . simple derived // DERIVEd - is calculated - VARget_initializer(v)
// returns non-zero, VARis_derived(v) is non-zero

** // VARget_initializer(v) returns null
**
** . simple derived // DERIVEd - is calculated - VARget_initializer(v)
** // returns non-zero, VARis_derived(v) is non-zero
**
** . overriding // includes type shifters and derived
**
** All of them are added to the dictionary.
Expand Down
2 changes: 1 addition & 1 deletion src/fedex_plus/collect.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ int ComplexCollect::supports( EntNode * ents )
*/
{
EntNode * node = ents, *nextnode;
AndList * alist;
AndList * alist = 0;
ComplexList * clist = clists, *cl = NULL, *current;
int retval;
EntList * elist, *next;
Expand Down
2 changes: 1 addition & 1 deletion src/fedex_plus/complexlist.cc
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void ComplexList::addChildren( EntList * ent )
EntList * child;
char * nm;
EntNode * prev = list, *prev2 = NULL, *newnode;
int comp;
int comp = 0;

if( ent->multiple() ) {
child = ( ( MultList * )ent )->childList;
Expand Down
2 changes: 1 addition & 1 deletion src/fedex_plus/expressbuild.cc
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ void ComplexList::addImplicitSubs( Linked_List subs, ComplexCollect * col )
EntNode node((char *)"");
// Temp var - used to check if this already contains certain values.
int none_yet = TRUE;
AndOrList * ao;
AndOrList * ao = 0;

LISTdo( subs, subEnt, Entity )
strcpy( node.name, ENTITYget_name( subEnt ) );
Expand Down
2 changes: 1 addition & 1 deletion src/fedex_plus/match-ors.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ MatchType OrList::matchORs( EntNode * ents )
{
int count;
EntList * child = childList;
MatchType retval;
MatchType retval = UNKNOWN;

for( count = 0; count < numchildren; count++, child = child->next ) {

Expand Down
2 changes: 1 addition & 1 deletion src/fedex_plus/multlist.cc
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ EntList * MultList::copyList( EntList * ent )
* to the end of our list.
*/
{
EntList * newlist, *child;
EntList * newlist = 0, *child;

switch( ent->join ) {
case SIMPLE:
Expand Down
2 changes: 1 addition & 1 deletion src/fedex_plus/print.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ ostream & operator << ( ostream & os, MultList & mlist )
*/
{
char jointype[7];
int k, lastSimple;
int k, lastSimple = 0;
// lastSimple - is the last child simple? If so, we need to print another
// line at the end. If not, the children of last child did already.
EntList * child = mlist.childList;
Expand Down