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:
Mrmaxmeier
2024-11-24 11:41:26 +01:00
committed by GitHub
parent 221fa70a67
commit c533017d0b
116 changed files with 866 additions and 865 deletions

View File

@@ -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