change writeReal func prototype

This commit is contained in:
Mark Pictor 2011-09-24 21:34:23 -04:00
parent 70a8382db6
commit 07d8791829
3 changed files with 7 additions and 11 deletions

View file

@ -1397,11 +1397,11 @@ const char * RealNode::asStr( std::string & s ) {
const char * RealNode::STEPwrite( std::string & s, const char * ) {
if( value != S_REAL_NULL ) {
WriteReal( value, s );
s = WriteReal( value );
} else {
s.clear();
}
return const_cast<char *>( s.c_str() );
return s.c_str();
}
void RealNode::STEPwrite( ostream & out ) {

View file

@ -149,10 +149,9 @@ IntValidLevel( const char * attrValue, ErrorDescriptor * err,
return err->severity();
}
char *
WriteReal( SCLP23( Real ) val, std::string & s ) {
std::string WriteReal( SCLP23( Real ) val ) {
char rbuf[64];
std::string s;
// out << form("%.*G", (int) Real_Num_Precision,tmp);
// replace the above line with this code so that writing the '.' is
@ -186,14 +185,12 @@ WriteReal( SCLP23( Real ) val, std::string & s ) {
} else {
s = rbuf;
}
return const_cast<char *>( s.c_str() );
return s;
}
void
WriteReal( SCLP23( Real ) val, ostream & out ) {
std::string s;
out << WriteReal( val, s );
out << WriteReal( val );
}
///////////////////////////////////////////////////////////////////////////////

View file

@ -23,8 +23,7 @@ extern Severity
IntValidLevel (const char *attrValue, ErrorDescriptor *err,
int clearError, int optional, char *tokenList);
extern char *
WriteReal(SCLP23(Real) val, std::string &s);
extern std::string WriteReal(SCLP23(Real) val );
extern void
WriteReal(SCLP23(Real) val, ostream &out);