]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Tweak passing of magic bytes to please GitHub CodeQL
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 17 Feb 2021 19:27:50 +0000 (20:27 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 17 Feb 2021 19:27:50 +0000 (20:27 +0100)
src/CacheEntryReader.cpp
src/CacheEntryReader.hpp
src/CacheEntryWriter.cpp
src/CacheEntryWriter.hpp

index c6964ad67ed9cc12d2a96fc9f0b4e6f2bbf07c3d..36dd3931ee210d9d62438d6b50c7a1f913ea3d0c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2019-2020 Joel Rosdahl and other contributors
+// Copyright (C) 2019-2021 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -25,7 +25,7 @@
 #include "third_party/fmt/core.h"
 
 CacheEntryReader::CacheEntryReader(FILE* stream,
-                                   const uint8_t expected_magic[4],
+                                   const uint8_t* expected_magic,
                                    uint8_t expected_version)
 {
   uint8_t header_bytes[15];
index 8ee73023235d81aeb4ac8834b48d3ca2e87d8629..37db80f5e62ba54f98917d57f0e27ab26900e524 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2019-2020 Joel Rosdahl and other contributors
+// Copyright (C) 2019-2021 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -36,10 +36,11 @@ public:
   //
   // Parameters:
   // - stream: Stream to read header and payload from.
-  // - expected_magic: Expected magic bytes (first four bytes of the file).
+  // - expected_magic: Expected file format magic (first four bytes of the
+  //   file).
   // - expected_version: Expected file format version.
   CacheEntryReader(FILE* stream,
-                   const uint8_t expected_magic[4],
+                   const uint8_t* expected_magic,
                    uint8_t expected_version);
 
   // Dump header information in text format.
index 6636bf556027120398c32c230415b84ecba9cd5b..8f45adfa9eebf5df101d0d3f4274abe0f3d7c0d5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2019-2020 Joel Rosdahl and other contributors
+// Copyright (C) 2019-2021 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -19,7 +19,7 @@
 #include "CacheEntryWriter.hpp"
 
 CacheEntryWriter::CacheEntryWriter(FILE* stream,
-                                   const uint8_t magic[4],
+                                   const uint8_t* magic,
                                    uint8_t version,
                                    Compression::Type compression_type,
                                    int8_t compression_level,
index 14c0d19e6e63e73059c6889eb88a2aec0c1e2c56..dc9226f61ac3452eaa33870c2782612d1abb8c0e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2019-2020 Joel Rosdahl and other contributors
+// Copyright (C) 2019-2021 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -36,13 +36,13 @@ public:
   //
   // Parameters:
   // - stream: Stream to write header + payload to.
-  // - magic: File format magic bytes.
+  // - magic: File format magic (first four bytes of the file).
   // - version: File format version.
   // - compression_type: Compression type to use.
   // - compression_level: Compression level to use.
   // - payload_size: Payload size.
   CacheEntryWriter(FILE* stream,
-                   const uint8_t magic[4],
+                   const uint8_t* magic,
                    uint8_t version,
                    Compression::Type compression_type,
                    int8_t compression_level,