disable warning of vc

dev
MITSUNARI Shigeo 9 years ago
parent 0c5cf035b6
commit cefe990706
  1. 1
      include/mcl/fp.hpp
  2. 9
      include/mcl/fp_generator.hpp
  3. 4
      include/mcl/gmp_util.hpp
  4. 15
      src/fp.cpp

@ -12,6 +12,7 @@
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4127)
#pragma warning(disable : 4458)
#ifndef NOMINMAX
#define NOMINMAX
#endif

@ -18,6 +18,11 @@
#endif
#include <xbyak/xbyak.h>
#include <xbyak/xbyak_util.h>
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4127)
#pragma warning(disable : 4458)
#endif
namespace mcl {
@ -1649,4 +1654,8 @@ private:
} } // mcl::fp
#ifdef _WIN32
#pragma warning(pop)
#endif
#endif

@ -312,12 +312,12 @@ class SquareRoot {
mpz_class s; // s = g^q
public:
SquareRoot() : isPrime(false) {}
void set(const mpz_class& p)
void set(const mpz_class& _p)
{
p = _p;
if (p <= 2) throw cybozu::Exception("SquareRoot:bad p") << p;
isPrime = Gmp::isPrime(p);
if (!isPrime) return; // don't throw until get() is called
this->p = p;
// g is quadratic nonresidue
g = 2;
while (Gmp::legendre(g, p) > 0) {

@ -392,6 +392,11 @@ uint64_t getUint64(bool *pb, const fp::Block& b)
return 0;
}
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4146)
#endif
int64_t getInt64(bool *pb, fp::Block& b, const fp::Op& op)
{
bool isNegative = false;
@ -425,10 +430,14 @@ int64_t getInt64(bool *pb, fp::Block& b, const fp::Op& op)
return 0;
}
void Op::initFp2(int xi_c)
#ifdef _WIN32
#pragma warning(pop)
#endif
void Op::initFp2(int _xi_c)
{
if (N * UnitBitSize != 256) throw cybozu::Exception("Op2:init:not support size") << N;
this->xi_c = xi_c;
this->xi_c = _xi_c;
// if (N * UnitBitSize != 256) throw cybozu::Exception("Op2:init:not support size") << N;
}
} } // mcl::fp

Loading…
Cancel
Save