From bc1e41eef4fe3969a3dfb9a6b060f00055103af6 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 20 Mar 2003 10:56:21 +0000 Subject: [PATCH] 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 --- include/real.cpp | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/include/real.cpp b/include/real.cpp index 3127541d3..0c0c75ebe 100755 --- a/include/real.cpp +++ b/include/real.cpp @@ -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 -} +} \ No newline at end of file