summaryrefslogtreecommitdiff
path: root/src/mp-convert.c
diff options
context:
space:
mode:
authormbkma <[email protected]>2020-10-25 14:54:31 +0100
committerRobert Antoni Buj Gelonch <[email protected]>2020-11-09 21:49:49 +0100
commit869de6d8e3833932ee8b0e8e70c13a2e5d4ceb82 (patch)
treeb6f47012ec040a66c907987db21af42cd0fb39a9 /src/mp-convert.c
parent3ff75b9a3e85a4d7723b0de1f69345f3943070dd (diff)
downloadmate-calc-869de6d8e3833932ee8b0e8e70c13a2e5d4ceb82.tar.bz2
mate-calc-869de6d8e3833932ee8b0e8e70c13a2e5d4ceb82.tar.xz
Fix most conversion warnings.
Diffstat (limited to 'src/mp-convert.c')
-rw-r--r--src/mp-convert.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mp-convert.c b/src/mp-convert.c
index ef1a770..c0a88c1 100644
--- a/src/mp-convert.c
+++ b/src/mp-convert.c
@@ -33,21 +33,21 @@ mp_set_from_double(double dx, MPNumber *z)
void
-mp_set_from_integer(int64_t x, MPNumber *z)
+mp_set_from_integer(long x, MPNumber *z)
{
mpc_set_si(z->num, x, MPC_RNDNN);
}
void
-mp_set_from_unsigned_integer(uint64_t x, MPNumber *z)
+mp_set_from_unsigned_integer(ulong x, MPNumber *z)
{
mpc_set_ui(z->num, x, MPC_RNDNN);
}
void
-mp_set_from_fraction(int64_t numerator, int64_t denominator, MPNumber *z)
+mp_set_from_fraction(long numerator, long denominator, MPNumber *z)
{
if (denominator < 0) {
numerator = -numerator;
@@ -88,14 +88,14 @@ mp_set_from_random(MPNumber *z)
mp_set_from_double(drand48(), z);
}
-int64_t
+long
mp_to_integer(const MPNumber *x)
{
return mpfr_get_si(mpc_realref(x->num), MPFR_RNDN);
}
-uint64_t
+ulong
mp_to_unsigned_integer(const MPNumber *x)
{
return mpfr_get_ui(mpc_realref(x->num), MPFR_RNDN);
@@ -116,7 +116,8 @@ mp_to_double(const MPNumber *x)
static int
char_val(char **c, int base)
{
- int i, j, value, offset;
+ int i, j, value;
+ size_t offset;
const char *digits[][10] = {{"٠", "١", "٢", "٣", "٤", "٥", "٦", "٧", "٨", "٩"},
{"〇", "〡", "〢", "〣", "〤", "〥", "〦", "〧", "〨", "〩"},
{"۰", "۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹"},