@@ -287,15 +287,15 @@ namespace osuCrypto
287
287
288
288
Arena<Address> mArena ;
289
289
std::vector<Gate> mGates ;
290
- u64 mPrevPrintIdx = - 1 ;
290
+ u64 mPrevPrintIdx = ~ 0ull ;
291
291
292
292
void addPrint (span<const Bit*> elems,
293
293
std::function<std::string(const BitVector& b)>&& p)
294
294
{
295
295
Gate g;
296
296
g.mType = OpType::Print;
297
297
298
- u64 s = (mPrevPrintIdx != - 1 );
298
+ u64 s = (mPrevPrintIdx != ~ 0ull );
299
299
for (u64 i = 0 ; i < elems.size (); ++i)
300
300
s += elems[i]->isConst () == false ;
301
301
@@ -311,9 +311,9 @@ namespace osuCrypto
311
311
consts[i] = elems[i]->constValue ();
312
312
}
313
313
314
- if (mPrevPrintIdx != - 1 )
314
+ if (mPrevPrintIdx != ~ 0ull )
315
315
{
316
- g.mInput [j++] = Address (mPrevPrintIdx , - 1 );
316
+ g.mInput [j++] = Address (mPrevPrintIdx , ~ 0ull );
317
317
}
318
318
319
319
assert (j == s);
@@ -418,13 +418,13 @@ namespace osuCrypto
418
418
throw std::runtime_error (" MxCircuit::evaluate(...), number of inputs provided is not correct. " LOCATION);
419
419
out.resize (mOutputs .size ());
420
420
421
- std::vector<u64> map (mGates .size (), - 1 );
421
+ std::vector<u64> map (mGates .size (), ~ 0ull );
422
422
u64 nc = std::accumulate (mGates .begin (), mGates .end (), 0ull , [](auto && c, auto && g) {
423
423
return g.mNumOutputs + c;
424
424
});
425
425
std::unique_ptr<u8[]>vals_ (new u8[nc]);
426
426
auto vals = [&](const Address& a) -> auto & {
427
- assert (map[a.gate ()] != - 1 );
427
+ assert (map[a.gate ()] != ~ 0ull );
428
428
return vals_[map[a.gate ()] + a.offset ()];
429
429
};
430
430
@@ -489,7 +489,7 @@ namespace osuCrypto
489
489
Print* p = dynamic_cast <Print*>(gate.mData .get ());
490
490
491
491
auto s = gate.mInput .size ();
492
- if (s && gate.mInput .back ().offset () == - 1 )
492
+ if (s && gate.mInput .back ().offset () == ~ 0ull )
493
493
--s;
494
494
BitVector v (s);
495
495
for (u64 j = 0 ; j < v.size (); ++j)
0 commit comments