aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2017-05-06 20:59:46 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2017-05-06 20:59:46 +0800
commit7ad2f9a9c3ceb82f8dbcd23c9d0743a1f5e18419 (patch)
tree78517ed15ee2c94a6e943b66ead4c29a1687eb0a
parent332c8cc5b6562bcf81121126d7a9607e6c6b5f5a (diff)
downloaddexon-mcl-7ad2f9a9c3ceb82f8dbcd23c9d0743a1f5e18419.tar.gz
dexon-mcl-7ad2f9a9c3ceb82f8dbcd23c9d0743a1f5e18419.tar.zst
dexon-mcl-7ad2f9a9c3ceb82f8dbcd23c9d0743a1f5e18419.zip
remove warning of vc2015
-rw-r--r--include/mcl/util.hpp6
-rw-r--r--src/fp.cpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/include/mcl/util.hpp b/include/mcl/util.hpp
index 0d3876d..1be9b7d 100644
--- a/include/mcl/util.hpp
+++ b/include/mcl/util.hpp
@@ -223,16 +223,16 @@ void powGeneric(G& out, const G& x, const T *y, size_t n, void mul(G&, const G&,
}
}
G tbl[4]; // tbl = { discard, x, x^2, x^3 }
- if (normalize) {
+ if (normalize != 0) {
normalize(tbl[0], x);
} else {
tbl[0] = x;
}
tbl[1] = tbl[0];
sqr(tbl[2], tbl[1]);
- if (normalize) { normalize(tbl[2], tbl[2]); }
+ if (normalize != 0) { normalize(tbl[2], tbl[2]); }
mul(tbl[3], tbl[2], x);
- if (normalize) { normalize(tbl[3], tbl[3]); }
+ if (normalize != 0) { normalize(tbl[3], tbl[3]); }
T v = y[n - 1];
int m = cybozu::bsr<T>(v);
if (m & 1) {
diff --git a/src/fp.cpp b/src/fp.cpp
index ff3e349..a8015fd 100644
--- a/src/fp.cpp
+++ b/src/fp.cpp
@@ -465,7 +465,7 @@ void Op::init(const std::string& mstr, size_t maxBitSize, Mode mode)
void arrayToStr(std::string& str, const Unit *x, size_t n, int ioMode)
{
int base = ioMode & ~IoPrefix;
- bool withPrefix = ioMode & IoPrefix;
+ bool withPrefix = (ioMode & IoPrefix) != 0;
switch (base) {
case 0:
case 10: