Skip to content

Commit fdcdace

Browse files
author
Nicholas Reed
committed
remove some dead code
1 parent 6776c95 commit fdcdace

File tree

9 files changed

+5
-1229
lines changed

9 files changed

+5
-1229
lines changed

src/cleditor/STEPfile.cc

Lines changed: 2 additions & 876 deletions
Large diffs are not rendered by default.

src/cleditor/STEPfile.inline.cc

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/*
32
* NIST STEP Core Class Library
43
* cleditor/STEPfile.inline.cc
@@ -52,7 +51,6 @@ STEPfile::STEPfile(Registry& r, InstMgr& i, const char *filename)
5251
SetFileType(VERSION_CURRENT);
5352
SetFileIdIncrement();
5453
_currentDir = new DirObj("");
55-
// _headerRegistry = new Registry(&s_HeaderSchemaInit);
5654
_headerRegistry = new Registry(HeaderSchemaInit);
5755
_headerInstances = new InstMgr;
5856
if (filename) ReadExchangeFile(filename);
@@ -81,12 +79,6 @@ STEPfile::SetFileType(FileTypeCode ft)
8179
ENTITY_NAME_DELIM = '@';
8280
FILE_DELIM = "STEP;";
8381
END_FILE_DELIM = "ENDSTEP;";
84-
/*DAS
85-
if (!_headerRegistryOld)
86-
_headerRegistryOld =
87-
new Registry(& s_Header_Section_Schema_N279Init);
88-
*/
89-
9082
break;
9183
case (VERSION_UNKNOWN):
9284
case (VERSION_CURRENT):
@@ -159,7 +151,6 @@ STEPfile::AppendExchangeFile (const char* filename, int useTechCor)
159151
return rval;
160152
}
161153

162-
/******************************************************/
163154
Severity
164155
STEPfile::ReadWorkingFile(const char* filename, int useTechCor)
165156
{
@@ -201,9 +192,6 @@ STEPfile::AppendWorkingFile(const char* filename, int useTechCor)
201192
return rval;
202193
}
203194

204-
205-
206-
/******************************************************/
207195
istream*
208196
STEPfile::OpenInputFile (const char* filename)
209197
{
@@ -227,8 +215,6 @@ STEPfile::OpenInputFile (const char* filename)
227215
if (strcmp(filename, "-") == 0) {
228216
in = &std::cin;
229217
} else {
230-
// istream* in = new istream(FileName(), io_readonly, a_useonly);
231-
// port 29-Mar-1994 kcm
232218
in = new ifstream(FileName());
233219
}
234220

@@ -243,32 +229,13 @@ STEPfile::OpenInputFile (const char* filename)
243229
return in;
244230
}
245231

246-
/******************************************************/
247232
void
248233
STEPfile::CloseInputFile(istream* in)
249234
{
250235
if (in && *in != std::cin)
251236
delete in;
252237
}
253238

254-
255-
/******************************************************/
256-
257-
/*
258-
void
259-
STEPfile::ReadWhiteSpace (istream& in)
260-
{
261-
262-
char c = ' ';
263-
while ((c == ' ') || (c == '\n') || (c == '\t')) {
264-
in >> c;
265-
}
266-
in.putback (c);
267-
}
268-
*/
269-
270-
/***************************
271-
***************************/
272239
ofstream*
273240
STEPfile::OpenOutputFile(const char* filename)
274241
{
@@ -293,8 +260,7 @@ STEPfile::OpenOutputFile(const char* filename)
293260

294261
if (_currentDir->FileExists(TruncFileName(FileName())))
295262
MakeBackupFile();
296-
// ostream* out = new ostream(FileName(), io_writeonly, a_create);
297-
// - port 29-Mar-1994 kcm
263+
298264
ofstream* out = new ofstream(FileName());
299265
// default for ostream is writeonly and protections are set to 644
300266
if (!out)
@@ -311,9 +277,6 @@ STEPfile::CloseOutputFile(ostream* out)
311277
delete out;
312278
}
313279

314-
315-
316-
/******************************************************/
317280
int
318281
STEPfile::IncrementFileId (int fileid)
319282
{
@@ -325,9 +288,7 @@ void
325288
STEPfile::SetFileIdIncrement()
326289
{
327290
if (instances ().MaxFileId() < 0) _fileIdIncr = 0;
328-
else _fileIdIncr = // (int)((ceil((instances ().MaxFileId() + 99)/1000) + 1) * 1000);
329-
(int)((ceil((double) ((instances ().MaxFileId() + 99)/1000) ) + 1) * 1000);
330-
// FIXME: Is this correct? Why put an integer expression into ceil()?
291+
else _fileIdIncr = (int)((ceil((instances().MaxFileId() + 99.0) / 1000.0) + 1.0) * 1000.0);
331292
}
332293

333294
char *STEPfile::schemaName( char *schName )
@@ -351,7 +312,7 @@ char *STEPfile::schemaName( char *schName )
351312
if ( n == NULL ) return NULL;
352313
n->STEPwrite(tmp);
353314
if ( *tmp.c_str() == '\0' || *tmp.c_str() == '$' ) return NULL;
354-
// tmp.chars() returns the string we want plus a beginning and ending
315+
// tmp returns the string we want plus a beginning and ending
355316
// quote mark ('). We remove these below.
356317
strncpy( schName, tmp.c_str()+1, BUFSIZ-1 );
357318
// "+1" to remove beginning '.

src/clstepcore/ExpDict.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,8 +521,6 @@ Schema::GenerateUseRefExpress(ostream& out) const
521521

522522
if(count > 0)
523523
{
524-
525-
// out << " REFERENCE FROM " << (*(is->explicit_items_()))[0]->foreign_schema_().chars() << endl;
526524
out << endl << " REFERENCE FROM "
527525
<< StrToLower(is->foreign_schema_id_().c_str(),tmp) << endl;
528526
out << " (";

src/clstepcore/STEPaggregate.cc

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/*
32
* NIST STEP Core Class Library
43
* clstepcore/STEPaggregate.cc
@@ -199,23 +198,6 @@ STEPaggregate::ReadValue(istream &in, ErrorDescriptor *err,
199198
// cannot recover so give up and let STEPattribute recover
200199
err->GreaterSeverity(SEVERITY_INPUT_ERROR);
201200
return SEVERITY_INPUT_ERROR;
202-
/*
203-
// error read until you find a delimiter
204-
std::string tmp;
205-
while(in.good() && !strchr(",)", c) )
206-
{
207-
in.get(c);
208-
tmp.Append(c);
209-
}
210-
// BUG could overwrite the error message buffer
211-
sprintf(errmsg, "ERROR aggr. elem. followed by \'%s\' garbage.\n",
212-
tmp.chars());
213-
err->AppendToDetailMsg(errmsg);
214-
err->AppendToUserMsg(errmsg);
215-
err->GreaterSeverity(SEVERITY_WARNING);
216-
if(!in.good())
217-
return err->severity();
218-
*/
219201
}
220202
}
221203
if(c == ')')
@@ -659,23 +641,6 @@ EntityAggregate::ReadValue(istream &in, ErrorDescriptor *err,
659641
// cannot recover so give up and let STEPattribute recover
660642
err->GreaterSeverity(SEVERITY_INPUT_ERROR);
661643
return SEVERITY_INPUT_ERROR;
662-
/*
663-
// error read until you find a delimiter
664-
std::string tmp;
665-
while(in.good() && !strchr(",)", c) )
666-
{
667-
in.get(c);
668-
tmp.Append(c);
669-
}
670-
// BUG could overwrite the error message buffer
671-
sprintf(errmsg, "ERROR aggr. elem. followed by \'%s\' garbage.\n",
672-
tmp.chars());
673-
err->AppendToDetailMsg(errmsg);
674-
err->AppendToUserMsg(errmsg);
675-
err->GreaterSeverity(SEVERITY_WARNING);
676-
if(!in.good())
677-
return err->severity();
678-
*/
679644
}
680645
}
681646
if(c == ')')

src/clstepcore/STEPattribute.cc

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -458,18 +458,6 @@ STEPattribute::asStr (std::string& str, const char *currSch) const
458458
// The attribute has been derived by a subtype's attribute
459459
if (IsDerived ()) { str = "*"; return const_cast<char *>(str.c_str()); }
460460

461-
/*
462-
// The attribute is redefining the type of a parent's attribute so...
463-
// If explicitly directed to write the attribute value by the
464-
// redefined attribute then write it - indicated by writeRedefined param.
465-
// If not explicitly directed to write value, write asterisk - see Part 21.
466-
// got rid of param writeRedefined
467-
// see technical corrigendum for Part 21
468-
if (!writeRedefined && (aDesc->AttrType() == AttrType_Redefining) ) {
469-
str = "*";
470-
return str.chars();
471-
}
472-
*/
473461
// The attribute has been redefined by the attribute pointed
474462
// to by _redefAttr so write the redefined value.
475463
if ( _redefAttr ) {
@@ -499,14 +487,12 @@ STEPattribute::asStr (std::string& str, const char *currSch) const
499487
else
500488
{
501489
(*(ptr.c))->STEPwrite_reference (str);
502-
// strncpy(attrVal, str.chars(), str.Length()+1);
503490
}
504491
break;
505492

506493
case BINARY_TYPE:
507494
if( !( (ptr.b)->empty() ) )
508495
(ptr.b) -> STEPwrite (str);
509-
// strncpy(attrVal, str.chars(), str.Length()+1);
510496
break;
511497

512498
case STRING_TYPE:
@@ -531,7 +517,6 @@ STEPattribute::asStr (std::string& str, const char *currSch) const
531517
case SELECT_TYPE:
532518
ptr.sh -> STEPwrite ( str, currSch );
533519
return const_cast<char *>(str.c_str());
534-
// strncpy (attrVal, tmp.chars(), BUFSIZ);
535520

536521
case REFERENCE_TYPE:
537522
case GENERIC_TYPE:

src/clstepcore/read_func.cc

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -215,49 +215,6 @@ WriteReal(SCLP23(Real) val, ostream &out)
215215
std::string s;
216216

217217
out << WriteReal(val,s);
218-
#if 0
219-
char rbuf[64];
220-
221-
// out << form("%.*G", (int) Real_Num_Precision,tmp);
222-
// replace the above line with this code so that writing the '.' is
223-
// guaranteed for reals. If you use e or E then you get many
224-
// unnecessary trailing zeros. g and G truncates all trailing zeros
225-
// to save space but when no non-zero precision exists it also
226-
// truncates the decimal. The decimal is required by Part 21.
227-
// Also use G instead of g since G writes uppercase E (E instead of e
228-
// is also required by Part 21) when scientific notation is used - DAS
229-
230-
sprintf(rbuf, "%.*G", (int) RealNumPrecision,val);
231-
if(!strchr(rbuf, '.'))
232-
{
233-
if(strchr(rbuf, 'E') || strchr(rbuf, 'e'))
234-
{
235-
char *expon = strchr(rbuf, 'E');
236-
237-
if( !expon)
238-
{
239-
expon = strchr(rbuf, 'e');
240-
}
241-
*expon = '\0';
242-
s = rbuf;
243-
s.Append('.');
244-
s.Append('E');
245-
expon++;
246-
s.Append(expon);
247-
}
248-
else
249-
{
250-
int rindex = strlen(rbuf);
251-
rbuf[rindex] = '.';
252-
rbuf[rindex+1] = '\0';
253-
s = rbuf;
254-
}
255-
}
256-
else
257-
s = rbuf;
258-
259-
out << (char *)(s.chars());
260-
#endif
261218
}
262219

263220
///////////////////////////////////////////////////////////////////////////////
@@ -785,9 +742,6 @@ FindStartOfInstance(istream& in, std::string& inst)
785742
in.putback (c);
786743
tmp.STEPread (in, &errs);
787744
inst.append (tmp);
788-
789-
// PushPastString(in, tmp, &errs);
790-
// inst.Append( tmp->chars() );
791745
break;
792746

793747
case '\0': // problem in input ?
@@ -824,9 +778,6 @@ SkipInstance(istream& in, std::string& inst)
824778
in.putback (c);
825779
tmp.STEPread (in, &errs);
826780
inst.append (tmp);
827-
828-
// PushPastString(in, tmp, &errs);
829-
// inst.Append( tmp->chars() );
830781
break;
831782

832783
case '\0': // problem in input ?

src/clstepcore/sdaiApplication_instance.cc

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -578,36 +578,6 @@ SCLP23(Application_instance)::STEPread_error(char c, int i, istream& in)
578578
// cerr << " ERROR Trying to find the end of the ENTITY to recover...\n";
579579
// cerr << " skipping the following input:\n";
580580

581-
#ifdef OBSOLETE
582-
in.clear();
583-
int foundEnd = 0;
584-
tmp = "";
585-
586-
// Search until a close paren is found followed by (skipping optional
587-
// whitespace) a semicolon
588-
while( in.good() && !foundEnd )
589-
{
590-
while ( in.good() && (c != ')') )
591-
{
592-
in.get(c);
593-
tmp.Append(c);
594-
// cerr << c;
595-
}
596-
if(in.good() && (c == ')') )
597-
{
598-
in >> ws; // skip whitespace
599-
in.get(c);
600-
tmp.Append(c);
601-
// cerr << c;
602-
// cerr << "\n";
603-
if(c == ';')
604-
{
605-
foundEnd = 1;
606-
}
607-
}
608-
}
609-
_error.AppendToDetailMsg( tmp.chars() );
610-
#endif
611581
sprintf (errStr, "\nfinished reading #%d\n", STEPfile_id);
612582
_error.AppendToDetailMsg(errStr);
613583
return;

0 commit comments

Comments
 (0)