Lines Matching full:if

25     if (partition == nullptr) {  in load()
36 if (rc != ESP_OK) { in load()
40 if (header.mState == PageState::UNINITIALIZED) { in load()
42 // check if the whole page is really empty in load()
47 if (!block) return ESP_ERR_NO_MEM; in load()
51 if (rc != ESP_OK) { in load()
56if (std::any_of(block, block + BLOCK_SIZE, [](uint32_t val) -> bool { return val != 0xffffffff; })… in load()
63 } else if (header.mCrc32 != header.calculateCrc32()) { in load()
68 if(header.mVersion < NVS_VERSION) { in load()
99 if (err != ESP_OK) { in writeEntry()
105 if (err != ESP_OK) { in writeEntry()
109 if (mFirstUsedEntry == INVALID_ENTRY) { in writeEntry()
128 #if !defined LINUX_TARGET in writeEntryData()
131 * function. To work around this, we copy the data to heap if it came from DROM. in writeEntryData()
137 if ((uint32_t) data < 0x3ff00000) { in writeEntryData()
139 if (!buf) { in writeEntryData()
148 #if !defined LINUX_TARGET in writeEntryData()
149 if (buf != data) { in writeEntryData()
153 if (rc != ESP_OK) { in writeEntryData()
158 if (err != ESP_OK) { in writeEntryData()
171 if (mState == PageState::INVALID) { in writeItem()
175 if (mState == PageState::UNINITIALIZED) { in writeItem()
177 if (err != ESP_OK) { in writeItem()
182 if (mState == PageState::FULL) { in writeItem()
187 if (keySize > Item::MAX_KEY_LENGTH) { in writeItem()
191 if (dataSize > Page::CHUNK_MAX_SIZE) { in writeItem()
195 if ((!isVariableLengthType(datatype)) && dataSize > 8) { in writeItem()
201 if (isVariableLengthType(datatype)) { in writeItem()
211 if (mNextFreeEntry == INVALID_ENTRY || mNextFreeEntry + entriesCount > ENTRY_COUNT) { in writeItem()
221 if (err != ESP_OK) { in writeItem()
225 if (!isVariableLengthType(datatype)) { in writeItem()
229 if (err != ESP_OK) { in writeItem()
239 if (err != ESP_OK) { in writeItem()
245 if (left > 0) { in writeItem()
247 if (err != ESP_OK) { in writeItem()
253 if (tail > 0) { in writeItem()
257 if (err != ESP_OK) { in writeItem()
271 if (mState == PageState::INVALID) { in readItem()
276 if (rc != ESP_OK) { in readItem()
280 if (!isVariableLengthType(datatype)) { in readItem()
281 if (dataSize != getAlignmentForType(datatype)) { in readItem()
289 if (dataSize < static_cast<size_t>(item.varLength.dataSize)) { in readItem()
298 if (rc != ESP_OK) { in readItem()
307if (Item::calculateCrc32(reinterpret_cast<uint8_t*>(data), item.varLength.dataSize) != item.varLen… in readItem()
309 if (rc != ESP_OK) { in readItem()
322 if (mState == PageState::INVALID) { in cmpItem()
327 if (rc != ESP_OK) { in cmpItem()
331 if (!isVariableLengthType(datatype)) { in cmpItem()
332 if (dataSize != getAlignmentForType(datatype)) { in cmpItem()
336 if (memcmp(data, item.data, dataSize)) { in cmpItem()
342 if (dataSize < static_cast<size_t>(item.varLength.dataSize)) { in cmpItem()
351 if (rc != ESP_OK) { in cmpItem()
356 if (memcmp(dst, ditem.rawData, willCopy)) { in cmpItem()
362if (Item::calculateCrc32(reinterpret_cast<const uint8_t*>(data), item.varLength.dataSize) != item.… in cmpItem()
374 if (rc != ESP_OK) { in eraseItem()
394 if (state == EntryState::WRITTEN) { in eraseEntryAndSpan()
397 if (rc != ESP_OK) { in eraseEntryAndSpan()
400 if (item.calculateCrc32() != item.crc32) { in eraseEntryAndSpan()
405 if (rc != ESP_OK) { in eraseEntryAndSpan()
412 if (mEntryTable.get(i) == EntryState::WRITTEN) { in eraseEntryAndSpan()
417 if (span == 1) { in eraseEntryAndSpan()
422 if (rc != ESP_OK) { in eraseEntryAndSpan()
428 if (rc != ESP_OK) { in eraseEntryAndSpan()
433 if (index == mFirstUsedEntry) { in eraseEntryAndSpan()
437 if (index + span > mNextFreeEntry) { in eraseEntryAndSpan()
449 if (end > ENTRY_COUNT) { in updateFirstUsedEntry()
453 if (mEntryTable.get(i) == EntryState::WRITTEN) { in updateFirstUsedEntry()
462 if (mFirstUsedEntry == INVALID_ENTRY) { in copyItems()
466 if (other.mState == PageState::UNINITIALIZED) { in copyItems()
468 if (err != ESP_OK) { in copyItems()
478 if (mEntryTable.get(readEntryIndex) != EntryState::WRITTEN) { in copyItems()
484 if (err != ESP_OK) { in copyItems()
489 if (err != ESP_OK) { in copyItems()
494 if (err != ESP_OK) { in copyItems()
505 if (err != ESP_OK) { in copyItems()
518 if (mState == PageState::ACTIVE || in mLoadEntryTable()
523 if (rc != ESP_OK) { in mLoadEntryTable()
533 if (s == EntryState::WRITTEN) { in mLoadEntryTable()
534 if (mFirstUsedEntry == INVALID_ENTRY) { in mLoadEntryTable()
538 } else if (s == EntryState::ERASED) { in mLoadEntryTable()
545 if (mState == PageState::ACTIVE) { in mLoadEntryTable()
547 if (mEntryTable.get(i) == EntryState::EMPTY) { in mLoadEntryTable()
553 // however, if power failed after some data was written into the entry. in mLoadEntryTable()
561 if (rc != ESP_OK) { in mLoadEntryTable()
565 if (header != 0xffffffff) { in mLoadEntryTable()
568 if (err != ESP_OK) { in mLoadEntryTable()
573 if (oldState == EntryState::WRITTEN) { in mLoadEntryTable()
587 if (end > ENTRY_COUNT) { in mLoadEntryTable()
593 if (mEntryTable.get(i) == EntryState::ERASED) { in mLoadEntryTable()
598 if (mEntryTable.get(i) == EntryState::ILLEGAL) { in mLoadEntryTable()
601 if (err != ESP_OK) { in mLoadEntryTable()
611 if (err != ESP_OK) { in mLoadEntryTable()
616 if (item.crc32 != item.calculateCrc32()) { in mLoadEntryTable()
618 if (err != ESP_OK) { in mLoadEntryTable()
626 if (err != ESP_OK) { in mLoadEntryTable()
634 if (isVariableLengthType(item.datatype)) { in mLoadEntryTable()
638 if (mEntryTable.get(j) != EntryState::WRITTEN) { in mLoadEntryTable()
644 if (needErase) { in mLoadEntryTable()
654 if (duplicateIndex < i) { in mLoadEntryTable()
660 if (lastItemIndex != INVALID_ENTRY) { in mLoadEntryTable()
663 if (findItem(item.nsIndex, item.datatype, item.key, findItemIndex, dupItem) == ESP_OK) { in mLoadEntryTable()
664 if (findItemIndex < lastItemIndex) { in mLoadEntryTable()
666 if (err != ESP_OK) { in mLoadEntryTable()
673 } else if (mState == PageState::FULL || mState == PageState::FREEING) { in mLoadEntryTable()
678 if (mEntryTable.get(i) != EntryState::WRITTEN) { in mLoadEntryTable()
683 if (err != ESP_OK) { in mLoadEntryTable()
688 if (item.crc32 != item.calculateCrc32()) { in mLoadEntryTable()
690 if (err != ESP_OK) { in mLoadEntryTable()
700 if (err != ESP_OK) { in mLoadEntryTable()
707 if (isVariableLengthType(item.datatype)) { in mLoadEntryTable()
709 if (mEntryTable.get(j) != EntryState::WRITTEN) { in mLoadEntryTable()
736 if (rc != ESP_OK) { in initialize()
754 if (rc != ESP_OK) { in alterEntryState()
769 if (i == static_cast<ptrdiff_t>(begin)) { in alterEntryRangeState()
774 if (nextWordIndex != wordIndex) { in alterEntryRangeState()
778 if (rc != ESP_OK) { in alterEntryRangeState()
791 if (rc != ESP_OK) { in alterPageState()
802 if (rc != ESP_OK) { in readEntry()
810if (mState == PageState::CORRUPT || mState == PageState::INVALID || mState == PageState::UNINITIAL… in findItem()
815 if (findBeginIndex >= ENTRY_COUNT) { in findItem()
820 if (findBeginIndex > mFirstUsedEntry && findBeginIndex < ENTRY_COUNT) { in findItem()
825 if (end > ENTRY_COUNT) { in findItem()
829 if (nsIndex != NS_ANY && datatype != ItemType::ANY && key != NULL) { in findItem()
831 if (cachedIndex < ENTRY_COUNT) { in findItem()
841 if (mEntryTable.get(i) != EntryState::WRITTEN) { in findItem()
846 if (rc != ESP_OK) { in findItem()
852 if (item.crc32 != crc32) { in findItem()
854 if (rc != ESP_OK) { in findItem()
861 if (isVariableLengthType(item.datatype)) { in findItem()
865 if (nsIndex != NS_ANY && item.nsIndex != nsIndex) { in findItem()
869 if (key != nullptr && strncmp(key, item.key, Item::MAX_KEY_LENGTH) != 0) { in findItem()
873 if (chunkIdx != CHUNK_ANY in findItem()
880 if (datatype == ItemType::BLOB_IDX in findItem()
885 if (datatype == ItemType::BLOB_IDX in findItem()
892 if (datatype != ItemType::ANY && item.datatype != datatype) { in findItem()
893 if (key == nullptr && nsIndex == NS_ANY && chunkIdx == CHUNK_ANY) { in findItem()
910if (mState != PageState::UNINITIALIZED && mState != PageState::INVALID && mState != PageState::COR… in getSeqNumber()
920 if (mState != PageState::UNINITIALIZED) { in setSeqNumber()
929 if (mState != PageState::UNINITIALIZED) { in setVersion()
939 if (rc != ESP_OK) { in erase()
954 if (mState != PageState::FULL && mState != PageState::ACTIVE) { in markFreeing()
962 if (mState != PageState::ACTIVE) { in markFull()
970 if (mState == PageState::UNINITIALIZED) { in getVarDataTailroom()
972 } else if (mState == PageState::FULL) { in getVarDataTailroom()
1013 if (state == EntryState::EMPTY) { in debugDump()
1015 } else if (state == EntryState::ERASED) { in debugDump()
1017 } else if (state == EntryState::WRITTEN) { in debugDump()
1020 if (skip == 0) { in debugDump()
1022 if (item.span > 0 && item.span <= ENTRY_COUNT - i) { in debugDump()