void MemoryState::downsample(const MemoryState &state) { const int shift = myIgnoreBits - state.myIgnoreBits; const uint64 scale = 1 << shift; // Copy time first for the display to work correctly myTime = state.myTime; myTotalEvents = state.myTotalEvents; for (DisplayIterator it(const_cast<MemoryState &>(state)); !it.atEnd(); it.advance()) { DisplayPage page(it.page()); uint64 myaddr = page.addr() >> shift; myTopExists[myaddr >> theBottomBits] = true; myExists[myaddr >> theDisplayBits] = true; for (uint64 i = 0; i < page.size(); i += scale) { uint &mystate = myState[myaddr].uval; State *arr = page.stateArray(); uint64 n = SYSmin(i+scale, page.size()); for (uint64 j = i; j < n; j++) { mystate = SYSmax(mystate, arr[j].uval); } myaddr++; } } }
std::string GusdGetErrors(UT_ErrorManager* mgr, UT_ErrorSeverity sev) { std::string err; if(mgr && mgr->getSeverity() >= SYSmin(sev, UT_ERROR_MESSAGE)) { UT_String msg; mgr->getErrorMessages(msg, sev, /*headerflag*/ 0); err = msg.toStdString(); } return err; }