summaryrefslogtreecommitdiff
path: root/src/math-converter.c
diff options
context:
space:
mode:
authormbkma <[email protected]>2020-03-05 13:06:45 +0100
committerraveit65 <[email protected]>2020-03-08 21:40:41 +0100
commitb0117b1d5ae73916c6f0d289be1f693bb5f46824 (patch)
tree4751c73751ed9951ae5a1c5b93f04c84593c6974 /src/math-converter.c
parent91962719d06ce16d8bc3523872b83fae4d151e10 (diff)
downloadmate-calc-b0117b1d5ae73916c6f0d289be1f693bb5f46824.tar.bz2
mate-calc-b0117b1d5ae73916c6f0d289be1f693bb5f46824.tar.xz
Port to GNU MPFR/MPC Library
For further information please visit: https://www.mpfr.org/ http://www.multiprecision.org/mpc
Diffstat (limited to 'src/math-converter.c')
-rw-r--r--src/math-converter.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/math-converter.c b/src/math-converter.c
index fa06a09..1d3e274 100644
--- a/src/math-converter.c
+++ b/src/math-converter.c
@@ -81,7 +81,8 @@ convert_equation(MathConverter *converter, const MPNumber *x, MPNumber *z)
static void
update_result_label(MathConverter *converter)
{
- MPNumber x, z;
+ MPNumber x = mp_new();
+ MPNumber z = mp_new();
gboolean enabled;
if (!converter->priv->result_label)
@@ -111,6 +112,8 @@ update_result_label(MathConverter *converter)
g_object_unref(source_unit);
g_object_unref(target_unit);
}
+ mp_clear(&x);
+ mp_clear(&z);
}
@@ -363,7 +366,8 @@ static void
swap_button_clicked_cb(GtkButton *button, MathConverter *converter)
{
Unit *from_unit, *to_unit;
- MPNumber x, z;
+ MPNumber x = mp_new();
+ MPNumber z = mp_new();
if (math_equation_get_number(converter->priv->equation, &x) &&
convert_equation(converter, &x, &z))
@@ -377,6 +381,8 @@ swap_button_clicked_cb(GtkButton *button, MathConverter *converter)
g_object_unref(from_unit);
g_object_unref(to_unit);
+ mp_clear(&x);
+ mp_clear(&z);
}
static void