Although the header size is fixed, this change provides an explicit indication of what the size is being used for.
Details
Details
Diff Detail
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Comment Actions
- update with _Static_assert and use %jd / intmax_t as suggested by @kib
- add an offset variable that we increment by the header / bzctrllen / bzdatalen to avoid repeating the same expression
Comment Actions
I looked at this stuff again, and having the construct char header[32] and static_assert(sizeof(header) == 32) feels weird. Might be, instead use a #define HEADER_SIZE 32 and then char header[HEADER_SIZE]; and use HEADER_SIZE.
Sorry for bike-shedding, but this is weird when seen completed.
Comment Actions
Commit summary will be use #define for header size instead of magic number Also note that the update includes a change to keep an increasing offset rather than repeating the same expression in several places.