diff options
author | daurnimator <quae@daurnimator.com> | 2015-12-18 22:46:15 +1100 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2015-12-21 19:32:54 +1100 |
commit | 2fa327bd7c95f797100bfe45fba956b290c309aa (patch) | |
tree | d14050b991e054617b256f3b80e3420ae213f425 | |
parent | dce3be261d53b6148e9f599e1a18aeae63e26ff4 (diff) | |
download | luaossl-2fa327bd7c95f797100bfe45fba956b290c309aa.tar.gz luaossl-2fa327bd7c95f797100bfe45fba956b290c309aa.tar.bz2 luaossl-2fa327bd7c95f797100bfe45fba956b290c309aa.zip |
bignum: Move div operator to idiv operator (breaks API)
-rw-r--r-- | src/openssl.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/openssl.c b/src/openssl.c index d6bec90..f03c129 100644 --- a/src/openssl.c +++ b/src/openssl.c | |||
@@ -1814,16 +1814,16 @@ static int bn__mul(lua_State *L) { | |||
1814 | } /* bn__mul() */ | 1814 | } /* bn__mul() */ |
1815 | 1815 | ||
1816 | 1816 | ||
1817 | static int bn__div(lua_State *L) { | 1817 | static int bn__idiv(lua_State *L) { |
1818 | BIGNUM *r, *a, *b; | 1818 | BIGNUM *dv, *a, *b; |
1819 | 1819 | ||
1820 | bn_prepops(L, &r, &a, &b, 0); | 1820 | bn_prepops(L, &dv, &a, &b, 0); |
1821 | 1821 | ||
1822 | if (!BN_div(r, NULL, a, b, getctx(L))) | 1822 | if (!BN_div(dv, NULL, a, b, getctx(L))) |
1823 | return auxL_error(L, auxL_EOPENSSL, "bignum:__div"); | 1823 | return auxL_error(L, auxL_EOPENSSL, "bignum:__idiv"); |
1824 | 1824 | ||
1825 | return 1; | 1825 | return 1; |
1826 | } /* bn__div() */ | 1826 | } /* bn__idiv() */ |
1827 | 1827 | ||
1828 | 1828 | ||
1829 | static int bn__mod(lua_State *L) { | 1829 | static int bn__mod(lua_State *L) { |
@@ -2003,7 +2003,7 @@ static const luaL_Reg bn_methods[] = { | |||
2003 | { "add", &bn__add }, | 2003 | { "add", &bn__add }, |
2004 | { "sub", &bn__sub }, | 2004 | { "sub", &bn__sub }, |
2005 | { "mul", &bn__mul }, | 2005 | { "mul", &bn__mul }, |
2006 | { "div", &bn__div }, | 2006 | { "idiv", &bn__idiv }, |
2007 | { "mod", &bn__mod }, | 2007 | { "mod", &bn__mod }, |
2008 | { "pow", &bn__pow }, | 2008 | { "pow", &bn__pow }, |
2009 | { "shl", &bn__shl }, | 2009 | { "shl", &bn__shl }, |
@@ -2018,7 +2018,7 @@ static const luaL_Reg bn_metatable[] = { | |||
2018 | { "__add", &bn__add }, | 2018 | { "__add", &bn__add }, |
2019 | { "__sub", &bn__sub }, | 2019 | { "__sub", &bn__sub }, |
2020 | { "__mul", &bn__mul }, | 2020 | { "__mul", &bn__mul }, |
2021 | { "__div", &bn__div }, | 2021 | { "__idiv", &bn__idiv }, |
2022 | { "__mod", &bn__mod }, | 2022 | { "__mod", &bn__mod }, |
2023 | { "__pow", &bn__pow }, | 2023 | { "__pow", &bn__pow }, |
2024 | { "__unm", &bn__unm }, | 2024 | { "__unm", &bn__unm }, |