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:
parent
2627b0bdd7
commit
bc1e41eef4
@ -484,11 +484,10 @@ real& real::operator /= (const real & b)
|
||||
#ifdef DBG
|
||||
if (dst == GM_NULL)
|
||||
{
|
||||
TString& tmp = get_tmp_string();
|
||||
char * __string = tmp.get_buffer(256);
|
||||
char * s = get_tmp_string().get_buffer(256);
|
||||
errname (s, gmec ());
|
||||
error_box ("Division error: %s", s);
|
||||
|
||||
errname (__string, gmec ());
|
||||
error_box ("Division error: %s", __string);
|
||||
}
|
||||
#endif
|
||||
trail( );
|
||||
@ -557,22 +556,21 @@ const char *real::string (
|
||||
else
|
||||
__tmp_real.trail();
|
||||
|
||||
TString& tmp = get_tmp_string();
|
||||
char* __string = tmp.get_buffer(len);
|
||||
char * s = get_tmp_string().get_buffer(80);
|
||||
dtoa (s, __tmp_real.ptr ());
|
||||
int lun = strlen (s);
|
||||
|
||||
dtoa (__string, __tmp_real.ptr ());
|
||||
int lun = strlen (__string);
|
||||
|
||||
if (lun < len)
|
||||
{
|
||||
const int delta = len - lun;
|
||||
for (int i = lun; i >= 0; i--)
|
||||
__string[i + delta] = __string[i];
|
||||
s[i + delta] = s[i];
|
||||
for (i = 0; i < delta; i++)
|
||||
__string[i] = pad;
|
||||
s[i] = pad;
|
||||
}
|
||||
|
||||
return __string;
|
||||
return s;
|
||||
}
|
||||
|
||||
// @doc EXTERNAL
|
||||
@ -599,10 +597,10 @@ istream & operator >> (
|
||||
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();
|
||||
return in;
|
||||
}
|
||||
@ -1811,4 +1809,4 @@ bool TImporto::is_zero() const
|
||||
#else
|
||||
return _valore.is_zero();
|
||||
#endif
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user