Patch level : 07.4

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :
MIgliorato l'uso delle stringe temporanee


git-svn-id: svn://10.65.10.50/trunk@10935 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2003-03-20 10:56:21 +00:00
parent 2627b0bdd7
commit bc1e41eef4

View File

@ -484,11 +484,10 @@ real& real::operator /= (const real & b)
#ifdef DBG #ifdef DBG
if (dst == GM_NULL) if (dst == GM_NULL)
{ {
TString& tmp = get_tmp_string(); char * s = get_tmp_string().get_buffer(256);
char * __string = tmp.get_buffer(256); errname (s, gmec ());
error_box ("Division error: %s", s);
errname (__string, gmec ());
error_box ("Division error: %s", __string);
} }
#endif #endif
trail( ); trail( );
@ -557,22 +556,21 @@ const char *real::string (
else else
__tmp_real.trail(); __tmp_real.trail();
TString& tmp = get_tmp_string(); char * s = get_tmp_string().get_buffer(80);
char* __string = tmp.get_buffer(len); dtoa (s, __tmp_real.ptr ());
int lun = strlen (s);
dtoa (__string, __tmp_real.ptr ());
int lun = strlen (__string);
if (lun < len) if (lun < len)
{ {
const int delta = len - lun; const int delta = len - lun;
for (int i = lun; i >= 0; i--) for (int i = lun; i >= 0; i--)
__string[i + delta] = __string[i]; s[i + delta] = s[i];
for (i = 0; i < delta; i++) for (i = 0; i < delta; i++)
__string[i] = pad; s[i] = pad;
} }
return __string; return s;
} }
// @doc EXTERNAL // @doc EXTERNAL
@ -599,10 +597,10 @@ istream & operator >> (
real & a) // @parm Indirizzo in cui posizionare il numero real & a) // @parm Indirizzo in cui posizionare il numero
{ {
char __string[80]; TString80 s;
in >> s;
atod (a.ptr (), s.get_buffer());
in >> __string;
atod (a.ptr (), __string);
a.trail(); a.trail();
return in; return in;
} }