void *ChangeElementSize( ElementTypePtr Element ) { int eax; int ecx; int ebx; int esi; int edi; BDimension value; Boolean changed; if ( PCB->ElementOn ) EraseElement( Element ); { Cardinal n; LineTypePtr line; changed = 0; n = Element->LineN + -1; if ( Element->LineN + -1 != -1 ) { line = ( line * 88 ) + -88; n = n; do { if ( value + -1 <= 0x98967f && line->Thickness != value ) { AddObjectToSizeUndoList( 8192, (void*)Element, (void*)line, (void*)Element ); changed = 1; line->Thickness = value; } n += -1; } while ( n + -1 != -1 ); Element = Element; } { Cardinal n = Element->ArcN + -1; ArcTypePtr arc; if ( Element->ArcN + -1 != -1 ) { arc = ( arc * 68 ) + -68; do { if ( value + -1 <= 0x98967f && arc->Thickness != value ) { AddObjectToSizeUndoList( 32768, (void*)Element, (void*)arc, (void*)Element ); changed = 1; arc->Thickness = value; } n += -1; } while ( n + -1 != -1 ); Element = Element; } if ( PCB->ElementOn ) DrawElement( Element, 0 ); return 0; } } }
int ZSetCache::Add(const ValueData& score, const ValueData& value, const ValueData& attr, bool thread_safe) { Buffer buf1, buf2; value.Encode(buf1); attr.Encode(buf2); std::string v, a; ZSetCaheElement e; e.score = score.NumberValue(); e.value.assign(buf1.GetRawReadBuffer(), buf1.ReadableBytes()); e.attr.assign(buf2.GetRawReadBuffer(), buf2.ReadableBytes()); int ret = 0; uint32 delta = 0; CacheWriteLockGuard guard(m_lock, thread_safe); ZSetCacheScoreMap::iterator sit = m_cache_score_dict.find(e.value); if (sit != m_cache_score_dict.end()) { e.score = sit->second; if (sit->second == score.NumberValue()) { ZSetCacheElementSet::iterator cit = m_cache.find(e); if (cit->attr == e.attr) { return ZSET_CACHE_NONEW_ELEMENT; } else { SubEstimateMemSize(cit->attr.size()); AddEstimateMemSize(e.attr.size()); cit->attr = e.attr; return ZSET_CACHE_ATTR_CHANGED; } } EraseElement(e); sit->second = score.NumberValue(); e.score = score.NumberValue(); ret = ZSET_CACHE_SCORE_CHANGED; } else { m_cache_score_dict[e.value] = score.NumberValue(); delta += e.value.size(); delta += sizeof(double); delta += (uint32) (ZSetCacheScoreMap::average_bytes_per_value() + 0.5); ret = ZSET_CACHE_NEW_ELEMENT; } m_cache.insert(e); delta += sizeof(ZSetCaheElement); delta += e.value.size(); delta += e.attr.size(); delta += (uint32) (ZSetCacheElementSet::average_bytes_per_value() + 0.5); AddEstimateMemSize(delta); return ret; }
/* --------------------------------------------------------------------------- * removes an element */ void * RemoveElement (ElementTypePtr Element) { /* erase from screen */ if ((PCB->ElementOn || PCB->PinOn) && (FRONT (Element) || PCB->InvisibleObjectsOn)) { EraseElement (Element); if (!Bulk) Draw (); } MoveObjectToRemoveUndoList (ELEMENT_TYPE, Element, Element, Element); return NULL; }
int ZSetCache::Rem(ValueData& v) { CacheWriteLockGuard guard(m_lock); Buffer buf1, buf2; v.Encode(buf1); ZSetCaheElement e; e.value.assign(buf1.GetRawReadBuffer(), buf1.ReadableBytes()); ZSetCacheScoreMap::iterator sit = m_cache_score_dict.find(e.value); if (sit != m_cache_score_dict.end()) { e.score = sit->second; EraseElement(e); uint32 delta = 0; delta += e.value.size(); delta += sizeof(double); delta += (uint32) (ZSetCacheElementSet::average_bytes_per_value() + 0.5); delta += (uint32) (ZSetCacheScoreMap::average_bytes_per_value() + 0.5); SubEstimateMemSize(delta); m_cache_score_dict.erase(sit); return 0; } return -1; }