Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uncompressed: update generic compression to current DAM 2 #1270

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

bradh
Copy link
Contributor

@bradh bradh commented Aug 13, 2024

The big change is that offsets are now relative to the start of the data, not the start of the file. That requires new test data.

The box name also changes.

@farindk farindk merged commit bd770ba into strukturag:master Aug 13, 2024
32 of 36 checks passed
@farindk
Copy link
Contributor

farindk commented Aug 13, 2024

Thanks.

If you have larger changes in the coming days, can you please develop them against the file-layout branch? I did a major refactorization there and it is difficult to merge changes into it.

I cannot merge file-layout into master yet, because it still lacks full functionality.

can_use_implied_offsets = false;
}
implied_offset += unit_info.unit_size;
while (unit_info.unit_offset >= (1ULL << unit_offset_nbbits)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy says:

uncompressed_box.cc:476:43: error: The result of the left shift is undefined due to shifting by '64', which is greater or equal to the width of type 'unsigned long long' [clang-analyzer-core.UndefinedBinaryOperatorResult,-warnings-as-errors]
    while (unit_info.unit_offset >= (1ULL << unit_offset_nbbits))

I think this is a false positive, but you may want to check too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I see why this is wrong. The computation of unit_offset_nbbits is in a for-loop and leads to the error when it has reached 64bit in a previous iteration.
Please check the computation. Maybe it has to be outside the for-loop.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have an idea for a cleaner approach. Will update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants