Skip to content

Commit

Permalink
Misc Cache improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Werni2A committed Jun 19, 2024
1 parent bfc6c74 commit d01a2ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion repos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1575,7 +1575,7 @@ repositories:
- errors: 0
options: null
path: ./orcad capture/unsorted/_archive/pspice/fairchild.olb
- errors: 14
- errors: 13
options: null
path: ./orcad capture/unsorted/_archive/pspice/filtsub.olb
- errors: 0
Expand Down
14 changes: 11 additions & 3 deletions src/Streams/StreamCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ void StreamCache::read(FileFormatVersion /* aVersion */)
// Early out for empty caches
if(parser.tryRead([&](){ ds.readBytes(10U); ds.sanitizeEoF(); }))
{
ds.printUnknownData(10U, getMethodName(this, __func__) + ": 0");
// 10 zero bytes
ds.assumeData({0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, getMethodName(this, __func__) + ": 0");
}
else
{
ds.printUnknownData(4, getMethodName(this, __func__) + ": 1");

for(std::size_t i{0U}; !ds.isEoF(); ++i)
std::size_t i{0U};
for(i = 0U; !ds.isEoF(); ++i)
{
mCtx.mLogger.trace("iteration i = {}", i);

Expand All @@ -42,7 +44,11 @@ void StreamCache::read(FileFormatVersion /* aVersion */)
{
if(hasStrAfter8Byte)
{
ds.printUnknownData(8U, getMethodName(this, __func__) + ": 11");
ds.printUnknownData(2U, getMethodName(this, __func__) + ": 11");

// Some 3 letter descriptions like: "LED", "VDC", "POT", "USB", "BUF", ...
const std::string someRefDes = ds.readStringLenZeroTerm();
mCtx.mLogger.trace("someRefDes = {}", someRefDes);
}

if(hasStrAfter2Byte)
Expand Down Expand Up @@ -112,6 +118,8 @@ void StreamCache::read(FileFormatVersion /* aVersion */)

parser.readStructure();
}

mCtx.mLogger.trace("unknownLen5176 = {}", i);
}

ds.sanitizeEoF();
Expand Down

0 comments on commit d01a2ed

Please sign in to comment.