From: Jérémie Astor Date: Fri, 6 Dec 2019 19:58:54 +0000 (+0100) Subject: :art: Improve string X-Git-Tag: nightly~2068^2~12 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=95a2f17f5d8c9996460f1679b94e7f311df914fe;p=gwion.git :art: Improve string --- diff --git a/src/lib/string.c b/src/lib/string.c index 654abb75..214f9c89 100644 --- a/src/lib/string.c +++ b/src/lib/string.c @@ -66,7 +66,7 @@ describe_string_assign(Int_, m_int, SZ_INT,, num_digit((m_uint)labs(lhs)) + 1, "%" INT_F "", lhs) describe_string_assign(Float_, m_float, SZ_FLOAT,, - num_digit((m_uint)lhs) + 5, + num_digit((m_uint)lhs) + 6, "%.4f", lhs) describe_string_assign(Complex_, m_complex, SZ_COMPLEX,, num_digit((m_uint)creal(lhs)) + num_digit((m_uint)cimag(lhs)) + 16, @@ -115,10 +115,10 @@ describe_string(Float, m_float, SZ_FLOAT, (num_digit((m_uint)lhs) + 5 + (rhs ? strlen(STRING(rhs)) : 0) + 1),, "%.4f%s", lhs, rhs ? STRING(rhs) : "") describe_string(Complex, m_complex, SZ_COMPLEX, - num_digit((m_uint)creal(lhs)) + num_digit((m_uint)cimag(lhs)) + (rhs ? strlen(STRING(rhs)) : 0) + 12,, + num_digit((m_uint)creal(lhs)) + num_digit((m_uint)cimag(lhs)) + (rhs ? strlen(STRING(rhs)) : 0) + 16,, "#(%.4f, %.4f)%s", creal(lhs), cimag(lhs), rhs ? STRING(rhs) : "") describe_string(Polar, m_complex, SZ_COMPLEX, - num_digit((m_uint)creal(lhs)) + num_digit((m_uint)cimag(lhs) / M_PI) + (rhs ? strlen(STRING(rhs)) : 0) + 12,, + num_digit((m_uint)creal(lhs)) + num_digit((m_uint)cimag(lhs) / M_PI) + (rhs ? strlen(STRING(rhs)) : 0) + 20,, "%%(%.4f, %.4f*pi)%s", creal(lhs), cimag(lhs) / M_PI, rhs ? STRING(rhs) : "") describe_string(Vec3, m_vec3, SZ_VEC3, (rhs ? strlen(STRING(rhs)) : 0) + 23 + num_digit((m_uint)lhs.x) + @@ -158,13 +158,13 @@ describe_string_plus(Polar_, SZ_COMPLEX, m_complex,, num_digit((m_uint)creal(lhs)) + num_digit((m_uint)cimag(lhs)) + 18, "%%(%.4f, %.4f)", creal(lhs), cimag(lhs) / M_PI) describe_string_plus(Vec3_, SZ_VEC3, m_vec3,, - num_digit((m_uint)lhs.x) + num_digit((m_uint)lhs.y) + num_digit((m_uint)lhs.z) + 20, "@(%.4f, %.4f, %.4f)", + num_digit((m_uint)lhs.x) + num_digit((m_uint)lhs.y) + num_digit((m_uint)lhs.z) + 22, "@(%.4f, %.4f, %.4f)", lhs.x, lhs.y, lhs.z) describe_string_plus(Vec4_, SZ_VEC4, m_vec4,, - num_digit((m_uint)lhs.x) + num_digit((m_uint)lhs.y) + num_digit((m_uint)lhs.z) + num_digit((m_uint)lhs.z) + 28, "@(%.4f, %.4f, %.4f, %.4f)", + num_digit((m_uint)lhs.x) + num_digit((m_uint)lhs.y) + num_digit((m_uint)lhs.z) + num_digit((m_uint)lhs.z) + 30, "@(%.4f, %.4f, %.4f, %.4f)", lhs.x, lhs.y, lhs.z, lhs.w) describe_string_plus(Object_, SZ_INT, M_Object, release(lhs, shred), - 11, "%p", (void*)lhs) + 16, "%p", (void*)lhs) static CTOR(string_ctor) { STRING(o) = ""; diff --git a/tests/import/test.log b/tests/import/test.log deleted file mode 100644 index 23d7fa2b..00000000 --- a/tests/import/test.log +++ /dev/null @@ -1,15 +0,0 @@ -op_already_imported.gw ==964533== Memcheck, a memory error detector -==964533== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==964533== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info -==964533== Command: ./../../gwion -p. -m dummy -d dummy op_already_imported.gw -==964533== Parent PID: 963027 -==964533== -==964533== -==964533== HEAP SUMMARY: -==964533== in use at exit: 0 bytes in 0 blocks -==964533== total heap usage: 869 allocs, 869 frees, 17,602,040 bytes allocated -==964533== -==964533== All heap blocks were freed -- no leaks are possible -==964533== -==964533== For lists of detected and suppressed errors, rerun with: -s -==964533== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)