On Windows x64 hosts, "long" (4B) is not large enough to hold
an address.
For this reason, we're updating "test_json_formattable.cc"
to use "long long" instead.
Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
struct struct1 {
- long i;
+ long long i;
string s;
bool b;
struct1() {
void *p = (void *)this;
- i = (long)p;
+ i = (long long)p;
char buf[32];
snprintf(buf, sizeof(buf), "%p", p);
s = buf;
bool compare(const JSONFormattable& jf) const {
bool ret = (s == (string)jf["s"] &&
- i == (long)jf["i"] &&
+ i == (long long)jf["i"] &&
b == (bool)jf["b"]);
if (!ret) {
cout << "failed comparison: s=" << s << " jf[s]=" << (string)jf["s"] <<
- " i=" << i << " jf[i]=" << (long)jf["i"] << " b=" << b << " jf[b]=" << (bool)jf["b"] << std::endl;
+ " i=" << i << " jf[i]=" << (long long)jf["i"] << " b=" << b << " jf[b]=" << (bool)jf["b"] << std::endl;
dumpf(jf);
}
struct2() {
void *p = (void *)this;
- long i = (long)p;
+ long long i = (long long)p;
v.resize((i >> 16) % 16 + 1);
}