mirror of
https://github.com/WerWolv/ImHex-Patterns.git
synced 2026-03-27 23:37:04 -05:00
git: Various style fixes everywhere, removing whitespaces (#321)
* repo-wide: trim trailing spaces Note: This doesn't touch the .tbl files in encodings/ since they include meaningful trailing spaces (`20= `) * patterns: clean up duplicate semicolons * ELF: add header magic check * glTF: use type::Magic for magic value * glTF: check that the file size in the header matches * xgstexture: fix generics syntax for magic value * JPEG: define hex enum with 0x00 instead of 0X00 * CI: update deprecated actions --------- Co-authored-by: Nik <werwolv98@gmail.com>
This commit is contained in:
@@ -22,7 +22,7 @@ if (data_len > (HEADER_SIZE + CSUM_SIZE)) {
|
||||
/// Compression method; only Deflate is used
|
||||
enum CM: u8 {
|
||||
Deflate = 8,
|
||||
Reserved = 15,
|
||||
Reserved = 15,
|
||||
};
|
||||
|
||||
/// Compression level
|
||||
@@ -43,7 +43,7 @@ bitfield Header {
|
||||
} [[bitfield_order(BitfieldOrder::LeastToMostSignificant, 16)]];
|
||||
|
||||
|
||||
/// Validate the header's checksum
|
||||
/// Validate the header's checksum
|
||||
fn validate_hdr_checksum(Header hdr) {
|
||||
// Reassemble as a 2-byte big endian value
|
||||
u16 value = (
|
||||
@@ -53,7 +53,7 @@ fn validate_hdr_checksum(Header hdr) {
|
||||
(hdr.fdict << 5) +
|
||||
(u8(hdr.flevel) << 6)
|
||||
);
|
||||
|
||||
|
||||
if (value % 31 == 0) {
|
||||
std::print("Zlib header checksum OK. Value: {}", value);
|
||||
} else {
|
||||
@@ -65,12 +65,12 @@ fn validate_hdr_checksum(Header hdr) {
|
||||
struct Zlib {
|
||||
/// Configuration
|
||||
Header header;
|
||||
|
||||
|
||||
if (header.fdict) {
|
||||
/// Adler checksum of the optional dictionary
|
||||
u32 dict;
|
||||
}
|
||||
|
||||
|
||||
/// Compressed data
|
||||
u8 data[data_len];
|
||||
/// Adler-32 checksum of uncompressed data
|
||||
|
||||
Reference in New Issue
Block a user