Skip to content

Commit becb840

Browse files
committed
Merge pull request #135 from mpictor/review/gcc_incomplete_type
Fix the incomplete type errors in AP210, AP235, AP242
2 parents f12e16b + dca5e0c commit becb840

17 files changed

Lines changed: 119696 additions & 465 deletions

data/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ FUNCTION(BUILD_A_SCHEMA SCHEMA_FILE)
7676
add_dependencies( ${PROJECT_NAME} generate_cpp_${SCHEMA_SHORT_NAME} )
7777
set_target_properties( ${PROJECT_NAME} PROPERTIES COMPILE_FLAGS
7878
${${PROJECT_NAME}_COMPILE_FLAGS} )
79+
if(APPLE)
80+
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
81+
endif(APPLE)
7982
TESTABLE_TARGET( ${PROJECT_NAME} )
8083

8184
add_test( NAME generate_cpp_${SCHEMA_SHORT_NAME}

data/ap210e2/Cable_db.stp

Lines changed: 41619 additions & 0 deletions
Large diffs are not rendered by default.

data/ap210e2/FlasherThruHole.stp

Lines changed: 9112 additions & 0 deletions
Large diffs are not rendered by default.

data/ap210e2/PDES-181.stp

Lines changed: 45184 additions & 0 deletions
Large diffs are not rendered by default.

data/ap210e2/SurfaceMountFlasher.stp

Lines changed: 23481 additions & 0 deletions
Large diffs are not rendered by default.

src/clstepcore/ExpDict.cc

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -321,11 +321,8 @@ Interface_spec::~Interface_spec() {
321321

322322
//////////////////////////////////////////////////////////////////////////////
323323

324-
void Schema::AddFunction( const char * f ) {
325-
if( _function_list == 0 ) {
326-
_function_list = new scl_char_str__list;
327-
}
328-
_function_list->Append( ( char * )f );
324+
void Schema::AddFunction( const std::string & f ) {
325+
_function_list.push_back( f );
329326
}
330327

331328
void Schema::AddGlobal_rule( Global_rule_ptr gr ) {
@@ -339,11 +336,8 @@ void Schema::AddGlobal_rule( Global_rule_ptr gr ) {
339336
void Schema::global_rules_( Global_rule__set_var & grs ) {
340337
}
341338

342-
void Schema::AddProcedure( const char * p ) {
343-
if( _procedure_list == 0 ) {
344-
_procedure_list = new scl_char_str__list;
345-
}
346-
_procedure_list->Append( ( char * )p );
339+
void Schema::AddProcedure( const std::string & p ) {
340+
_procedure_list.push_back( p );
347341
}
348342

349343
/// the whole schema
@@ -368,18 +362,18 @@ void Schema::GenerateExpress( ostream & out ) const {
368362
out << endl << ( *_global_rules )[i]->rule_text_() << endl;
369363
}
370364
}
371-
if( _function_list != 0 ) {
365+
if( !_function_list.empty() ) {
372366
out << "(* *************FUNCTIONS************* *)" << endl;
373-
count = _function_list->Count();
367+
count = _function_list.size();
374368
for( i = 0; i < count; i++ ) {
375-
out << endl << ( *_function_list )[i] << endl;
369+
out << endl << _function_list[i] << endl;
376370
}
377371
}
378-
if( _procedure_list != 0 ) {
372+
if( !_procedure_list.empty() ) {
379373
out << "(* *************PROCEDURES************* *)" << endl;
380-
count = _procedure_list->Count();
374+
count = _procedure_list.size();
381375
for( i = 0; i < count; i++ ) {
382-
out << endl << ( *_procedure_list )[i] << endl;
376+
out << endl << _procedure_list[i] << endl;
383377
}
384378
}
385379
out << endl << "END_SCHEMA;" << endl;
@@ -1221,7 +1215,7 @@ Global_rule::Global_rule()
12211215
: _entities( 0 ), _where_rules( 0 ), _parent_schema( 0 ) {
12221216
}
12231217

1224-
Global_rule::Global_rule( const char * n, Schema_ptr parent_sch, const char * rt )
1218+
Global_rule::Global_rule( const char * n, Schema_ptr parent_sch, const std::string & rt )
12251219
: _name( n ), _entities( 0 ), _where_rules( 0 ), _parent_schema( parent_sch ),
12261220
_rule_text( rt ) {
12271221
}

src/clstepcore/ExpDict.h

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
#include <scl_export.h>
1616
#include <sdai.h>
1717

18+
#include <deque>
19+
#include <string>
20+
1821
typedef SDAI_Application_instance * ( * Creator )() ;
1922

2023
enum AttrType_Enum {
@@ -29,7 +32,6 @@ enum AttrType_Enum {
2932
#include <baseType.h>
3033
#include <dictdefs.h>
3134
#include <Str.h>
32-
#include <scl_char_str_list.h>
3335

3436
// defined and created in Registry.inline.cc
3537
extern SCL_CORE_EXPORT const TypeDescriptor * t_sdaiINTEGER;
@@ -520,7 +522,7 @@ class SCL_CORE_EXPORT Global_rule : public Dictionary_instance {
520522
std::string _rule_text; // non-SDAI
521523

522524
Global_rule();
523-
Global_rule( const char * n, Schema_ptr parent_sch, const char * rt );
525+
Global_rule( const char * n, Schema_ptr parent_sch, const std::string & rt );
524526
Global_rule( Global_rule & ); // not fully implemented
525527
virtual ~Global_rule();
526528

@@ -660,8 +662,8 @@ class SCL_CORE_EXPORT Schema : public Dictionary_instance {
660662
// non-SDAI lists
661663
Interface_spec__set_var _use_interface_list; // list of USE interfaces
662664
Interface_spec__set_var _ref_interface_list; // list of REFERENCE interfaces
663-
scl_char_str__list_var _function_list; // of EXPRESS functions
664-
scl_char_str__list_var _procedure_list; // of EXPRESS procedures
665+
std::deque< std::string > _function_list; // of EXPRESS functions
666+
std::deque< std::string > _procedure_list; // of EXPRESS procedures
665667

666668
Global_rule__set_var _global_rules;
667669

@@ -695,11 +697,11 @@ class SCL_CORE_EXPORT Schema : public Dictionary_instance {
695697
return _ref_interface_list;
696698
}
697699

698-
scl_char_str__list_var function_list_() {
700+
std::deque< std::string > function_list_() {
699701
return _function_list;
700702
}
701703

702-
void AddFunction( const char * f );
704+
void AddFunction( const std::string & f );
703705

704706
Global_rule__set_var global_rules_() { // const
705707
return _global_rules;
@@ -709,11 +711,11 @@ class SCL_CORE_EXPORT Schema : public Dictionary_instance {
709711

710712
void global_rules_( Global_rule__set_var & grs ); // not implemented
711713

712-
scl_char_str__list_var procedure_list_() {
714+
std::deque< std::string > procedure_list_() {
713715
return _procedure_list;
714716
}
715717

716-
void AddProcedure( const char * p );
718+
void AddProcedure( const std::string & p );
717719

718720
EntityDescLinkNode * AddEntity( EntityDescriptor * ed ) {
719721
return _entList.AddNode( ed );
@@ -1544,7 +1546,7 @@ class SCL_CORE_EXPORT EntityDescriptor : public TypeDescriptor {
15441546
void AddSubtype( EntityDescriptor * ed ) {
15451547
_subtypes.AddNode( ed );
15461548
}
1547-
void AddSupertype_Stmt( const char * s ) {
1549+
void AddSupertype_Stmt( const std::string & s ) {
15481550
_supertype_stmt = s;
15491551
}
15501552
const char * Supertype_Stmt() {

src/clstepcore/ExpDict.inline.cc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@ Schema::~Schema() {
3030
if( _ref_interface_list != 0 ) {
3131
delete _ref_interface_list;
3232
}
33-
if( _function_list != 0 ) {
34-
delete _function_list;
35-
}
36-
if( _procedure_list != 0 ) {
37-
delete _procedure_list;
38-
}
3933
if( _global_rules != 0 ) {
4034
delete _global_rules;
4135
}

src/clutils/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ set(LIBSTEPUTILS_SRCS
77
gennodearray.cc
88
scl_hash.cc
99
errordesc.cc
10-
scl_char_str_list.cc
1110
)
1211

1312
SET(LIBSTEPUTILS_PRIVATE_HDRS
@@ -16,7 +15,6 @@ SET(LIBSTEPUTILS_PRIVATE_HDRS
1615
gennodearray.h
1716
gennode.h
1817
gennodelist.h
19-
scl_char_str_list.h
2018
scldir.h
2119
scl_hash.h
2220
stat.h

src/clutils/scl_char_str_list.cc

Lines changed: 0 additions & 108 deletions
This file was deleted.

0 commit comments

Comments
 (0)