Skip to content

Commit

Permalink
IWYU pass
Browse files Browse the repository at this point in the history
  • Loading branch information
LebedevRI committed Mar 21, 2023
1 parent 0ea827f commit a02d62e
Show file tree
Hide file tree
Showing 89 changed files with 241 additions and 210 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "adt/DefaultInitAllocatorAdaptor.h" // for DefaultInitAllocator...
#include "adt/DefaultInitAllocatorAdaptor.h" // for DefaultInitAllocatorAda...
#include "bench/Common.h" // for benchmarkDryRun
#include <cstddef> // for byte
#include <map> // for map<>::mapped_type
#include <vector> // for allocator, vector
#include <benchmark/benchmark.h> // for State, Benchmark
#include <benchmark/benchmark.h> // for State, Benchmark, BENCH...

using Type = std::byte;

Expand Down
5 changes: 3 additions & 2 deletions bench/librawspeed/bench/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@

#pragma once

#include "adt/Point.h" // for iPoint2D
#include <cstddef> // for size_t
#include "rawspeedconfig.h" // for RAWSPEED_READNONE
#include "adt/Point.h" // for iPoint2D
#include <cstddef> // for size_t

bool RAWSPEED_READNONE benchmarkDryRun();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@

#include "decompressors/DeflateDecompressor.h" // for DeflateDecompressor
#include "adt/Point.h" // for iPoint2D
#include "bench/Common.h" // for areaToRectangle
#include "bench/Common.h" // for areaToRectangle, benc...
#include "common/Common.h" // for isAligned
#include "common/RawImage.h" // for RawImage, RawImageData
#include "io/Buffer.h" // for Buffer, DataBuffer
#include "io/ByteStream.h" // for ByteStream
#include "io/Endianness.h" // for Endianness, Endiannes...
#include "io/Buffer.h" // for Buffer
#include <algorithm> // for fill_n
#include <cassert> // for assert
#include <cstddef> // for size_t
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,22 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "decompressors/UncompressedDecompressor.h" // for UncompressedDecom...
#include "adt/Point.h" // for iPoint2D
#include "decompressors/UncompressedDecompressor.h" // for UncompressedDeco...
#include "adt/Point.h" // for iPoint2D, iRecta...
#include "bench/Common.h" // for areaToRectangle
#include "common/Common.h" // for isAligned
#include "common/RawImage.h" // for RawImage, RawImageData
#include "io/Buffer.h" // for Buffer, DataBuffer
#include "io/ByteStream.h" // for ByteStream
#include "io/Endianness.h" // for Endianness, Endiannes...
#include <algorithm> // for fill_n
#include <cassert> // for assert
#include <cstddef> // for size_t
#include <cstdint> // for uint8_t
#include <memory> // for unique_ptr
#include <numeric> // for lcm
#include <type_traits> // for integral_constant
#include <vector> // for vector
#include <benchmark/benchmark.h> // for State, Benchmark, BEN...
#include "common/Common.h" // for BitOrder, BitOrd...
#include "common/RawImage.h" // for RawImageType
#include "io/Buffer.h" // for Buffer, DataBuffer
#include "io/ByteStream.h" // for ByteStream
#include "io/Endianness.h" // for Endianness, Endi...
#include <algorithm> // for fill_n
#include <cassert> // for assert
#include <cstddef> // for size_t
#include <cstdint> // for uint16_t, uint8_t
#include <numeric> // for lcm
#include <type_traits> // for integral_constant
#include <vector> // for vector
#include <benchmark/benchmark.h> // for State, Benchmark

using rawspeed::BitOrder;
using rawspeed::Buffer;
Expand Down
7 changes: 3 additions & 4 deletions bench/librawspeed/io/BitStreamBenchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,21 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "io/BitStream.h" // for BitStream
#include "bench/Common.h"
#include "io/BitStream.h" // for BitStream
#include "bench/Common.h" // for benchmarkDryRun
#include "io/BitPumpJPEG.h" // for BitPumpJPEG, BitStream<>::fillCache
#include "io/BitPumpLSB.h" // for BitPumpLSB, BitStream<>::fillCache
#include "io/BitPumpMSB.h" // for BitPumpMSB, BitStream<>::fillCache
#include "io/BitPumpMSB16.h" // for BitPumpMSB16, BitStream<>::fillCache
#include "io/BitPumpMSB32.h" // for BitPumpMSB32, BitStream<>::fillCache
#include "io/Buffer.h" // for Buffer, DataBuffer
#include "io/ByteStream.h" // for ByteStream
#include "io/Endianness.h" // for Endianness, Endianness::big, Endian...
#include "io/Endianness.h" // for Endianness, Endianness::unknown
#include <algorithm> // for fill_n
#include <cassert> // for assert
#include <cstddef> // for size_t
#include <cstdint> // for uint8_t
#include <string> // for string, to_string, allocator
#include <type_traits> // for integral_constant
#include <vector> // for vector
#include <benchmark/benchmark.h> // for State, Benchmark, Initialize, RunSp...

Expand Down
10 changes: 5 additions & 5 deletions fuzz/librawspeed/decompressors/HasselbladDecompressor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@
#include "HuffmanTable/Common.h" // for createHuffmanTable
#include "MemorySanitizer.h" // for MSan
#include "common/RawImage.h" // for RawImage, RawImageData
#include "common/RawspeedException.h" // for ThrowException, Rawsp...
#include "common/RawspeedException.h" // for RawspeedException
#include "decompressors/HuffmanTable.h" // for HuffmanTable
#include "fuzz/Common.h" // for CreateRawImage
#include "io/Buffer.h" // for Buffer, DataBuffer
#include "io/ByteStream.h" // for ByteStream
#include "io/Endianness.h" // for Endianness, Endiannes...
#include <algorithm> // for generate_n, copy
#include "io/Endianness.h" // for Endianness, Endianness::little
#include <algorithm> // for fill, copy, fill_n, generate_n
#include <cassert> // for assert
#include <cstddef> // for size_t
#include <cstdint> // for uint16_t, uint8_t
#include <initializer_list> // for initializer_list
#include <iterator> // for back_insert_iterator
#include <vector> // for vector

extern "C" int LLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size);

Expand Down
11 changes: 6 additions & 5 deletions fuzz/librawspeed/decompressors/HuffmanTable/Dual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,15 @@
#include "decompressors/HuffmanTable/Common.h" // for createHuffmanTable
#include "decompressors/HuffmanTableLUT.h" // IWYU pragma: keep
#include "decompressors/HuffmanTableLookup.h" // IWYU pragma: keep
#include "decompressors/HuffmanTableTree.h" // for HuffmanTableTree
#include "decompressors/HuffmanTableVector.h" // for HuffmanTableVector
#include "decompressors/HuffmanTableVector.h" // IWYU pragma: keep
#include "io/BitPumpJPEG.h" // for BitStream<>::fillCache
#include "io/BitPumpMSB.h" // IWYU pragma: keep
#include "io/BitPumpMSB32.h" // IWYU pragma: keep
#include "io/BitStream.h" // for BitStream
#include "io/BitPumpMSB.h" // for BitStream<>::fillCache
#include "io/BitPumpMSB32.h" // for BitStream<>::fillCache
#include "io/Buffer.h" // for Buffer, DataBuffer
#include "io/ByteStream.h" // for ByteStream
#include "io/Endianness.h" // for Endianness, Endiannes...
#include "io/IOException.h" // for RawspeedException
#include <algorithm> // for generate_n, max
#include <cassert> // for assert
#include <cstdint> // for uint8_t
#include <cstdio> // for size_t
Expand All @@ -48,6 +47,8 @@

namespace rawspeed {
struct BaselineHuffmanTableTag;
struct VC5HuffmanTableTag;
template <typename HuffmanTableTag> class HuffmanTableTree;
} // namespace rawspeed

template <typename Pump, bool IsFullDecode, typename HT0, typename HT1>
Expand Down
11 changes: 5 additions & 6 deletions fuzz/librawspeed/decompressors/HuffmanTable/Solo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,20 @@
#error IMPL must be defined to one of rawspeeds huffman table implementations
#endif

#include "common/RawspeedException.h" // for RawspeedException
#include "common/RawspeedException.h" // for ThrowException, ThrowRSE
#include "decompressors/BinaryHuffmanTree.h" // for BinaryHuffmanTree<>::...
#include "decompressors/HuffmanTable.h" // IWYU pragma: keep
#include "decompressors/HuffmanTable/Common.h" // for createHuffmanTable
#include "decompressors/HuffmanTableLUT.h" // IWYU pragma: keep
#include "decompressors/HuffmanTableLookup.h" // IWYU pragma: keep
#include "decompressors/HuffmanTableTree.h" // for HuffmanTableTree
#include "decompressors/HuffmanTableVector.h" // for HuffmanTableVector
#include "decompressors/HuffmanTableVector.h" // IWYU pragma: keep
#include "io/BitPumpJPEG.h" // for BitStream<>::fillCache
#include "io/BitPumpMSB.h" // IWYU pragma: keep
#include "io/BitPumpMSB32.h" // IWYU pragma: keep
#include "io/BitStream.h" // for BitStream
#include "io/BitPumpMSB.h" // for BitStream<>::fillCache
#include "io/BitPumpMSB32.h" // for BitStream<>::fillCache
#include "io/Buffer.h" // for Buffer, DataBuffer
#include "io/ByteStream.h" // for ByteStream
#include "io/Endianness.h" // for Endianness, Endiannes...
#include <algorithm> // for generate_n
#include <cassert> // for assert
#include <cstdint> // for uint8_t
#include <cstdio> // for size_t
Expand Down
9 changes: 4 additions & 5 deletions fuzz/librawspeed/decompressors/LJpegDecompressor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,16 @@
#include "HuffmanTable/Common.h" // for createHuffmanTable
#include "MemorySanitizer.h" // for MSan
#include "common/RawImage.h" // for RawImage, RawImageData
#include "common/RawspeedException.h" // for ThrowException, Rawsp...
#include "common/RawspeedException.h" // for ThrowException, RawspeedExce...
#include "decompressors/HuffmanTable.h" // for HuffmanTable
#include "fuzz/Common.h" // for CreateRawImage
#include "io/Buffer.h" // for Buffer, DataBuffer
#include "io/ByteStream.h" // for ByteStream
#include "io/Endianness.h" // for Endianness, Endiannes...
#include <algorithm> // for generate_n, copy
#include "io/Endianness.h" // for Endianness, Endianness::little
#include <algorithm> // for generate_n, copy, fill, fill_n
#include <cassert> // for assert
#include <cstdint> // for uint16_t, uint8_t
#include <initializer_list> // for initializer_list
#include <iterator> // for back_insert_iterator
#include <iterator> // for back_insert_iterator, back_i...

extern "C" int LLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size);

Expand Down
23 changes: 10 additions & 13 deletions fuzz/librawspeed/decompressors/UncompressedDecompressor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,16 @@
*/

#include "decompressors/UncompressedDecompressor.h"
#include "MemorySanitizer.h" // for MSan
#include "common/RawImage.h" // for RawImage, RawImageData
#include "common/RawspeedException.h" // for ThrowException, Rawsp...
#include "decompressors/HuffmanTable.h" // for HuffmanTable
#include "fuzz/Common.h" // for CreateRawImage
#include "io/Buffer.h" // for Buffer, DataBuffer
#include "io/ByteStream.h" // for ByteStream
#include "io/Endianness.h" // for Endianness, Endiannes...
#include <algorithm> // for generate_n, copy
#include <cassert> // for assert
#include <cstdint> // for uint16_t, uint8_t
#include <initializer_list> // for initializer_list
#include <iterator> // for back_insert_iterator
#include "MemorySanitizer.h" // for MSan
#include "common/RawImage.h" // for RawImage, RawImageData
#include "common/RawspeedException.h" // for ThrowException, RawspeedException
#include "fuzz/Common.h" // for CreateRawImage
#include "io/Buffer.h" // for Buffer, DataBuffer
#include "io/ByteStream.h" // for ByteStream
#include "io/Endianness.h" // for Endianness, Endianness::little
#include <cassert> // for assert
#include <cstddef> // for size_t
#include <cstdint> // for uint8_t

extern "C" int LLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size);

Expand Down
3 changes: 2 additions & 1 deletion fuzz/librawspeed/fuzz/RawSpeed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "common/Common.h" // for rawspeed_get_number_of_processor_cores
#include "rawspeedconfig.h" // for RAWSPEED_READNONE
#include "common/Common.h" // for rawspeed_get_number_of_processor_cores

// define this function, it is only declared in rawspeed:
// for fuzzing, do not want any threading.
Expand Down
3 changes: 2 additions & 1 deletion src/librawspeed/common/DngOpcodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "rawspeedconfig.h" // for RAWSPEED_READONLY
#include "common/DngOpcodes.h"
#include "adt/CroppedArray1DRef.h" // for CroppedArray1DRef
#include "adt/CroppedArray2DRef.h" // for CroppedArray2DRef
Expand All @@ -32,7 +33,7 @@
#include "io/Endianness.h" // for Endianness, Endianness::big
#include <algorithm> // for generate_n, clamp, fill_n
#include <cassert> // for assert
#include <cmath> // for abs, isfinite, pow
#include <cmath> // for isfinite, pow
#include <cstdlib> // for abs
#include <initializer_list> // for initializer_list
#include <iterator> // for back_insert_iterator, back...
Expand Down
3 changes: 2 additions & 1 deletion src/librawspeed/common/RawImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "rawspeedconfig.h" // for HAVE_OPENMP
#include "rawspeedconfig.h" // for RAWSPEED_READONLY, HAVE_OP...
#include "common/RawImage.h"
#include "adt/CroppedArray1DRef.h" // for CroppedArray1DRef
#include "decoders/RawDecoderException.h" // for ThrowException, ThrowRDE
#include "io/IOException.h" // for IOException
#include "parsers/TiffParserException.h" // for TiffParserException
Expand Down
2 changes: 1 addition & 1 deletion src/librawspeed/common/RawImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#pragma once

#include "rawspeedconfig.h" // for WITH_SSE2
#include "rawspeedconfig.h" // for RAWSPEED_READONLY, WITH...
#include "ThreadSafetyAnalysis.h" // for GUARDED_BY, REQUIRES
#include "adt/AlignedAllocator.h" // for AlignedAllocator
#include "adt/Array2DRef.h" // for Array2DRef
Expand Down
3 changes: 2 additions & 1 deletion src/librawspeed/decoders/CrwDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "rawspeedconfig.h" // for RAWSPEED_READNONE
#include "decoders/CrwDecoder.h"
#include "adt/Point.h" // for iPoint2D
#include "decoders/RawDecoderException.h" // for ThrowException, ThrowRDE
Expand All @@ -32,7 +33,7 @@
#include "tiff/CiffTag.h" // for CiffTag, CiffTag::MAKEMODEL
#include <array> // for array
#include <cassert> // for assert
#include <cmath> // for abs, copysignf, expf, logf
#include <cmath> // for copysignf, expf, logf
#include <cstdlib> // for abs, size_t
#include <cstring> // for memcmp
#include <memory> // for unique_ptr, allocator
Expand Down
2 changes: 2 additions & 0 deletions src/librawspeed/decoders/DcsDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
*/

#include "decoders/DcsDecoder.h"
#include "adt/Point.h" // for iPoint2D, iRecta...
#include "common/Common.h" // for BitOrder, BitOrd...
#include "decoders/RawDecoderException.h" // for ThrowException
#include "decompressors/UncompressedDecompressor.h" // for UncompressedDeco...
#include "io/Buffer.h" // for Buffer, DataBuffer
Expand Down
1 change: 1 addition & 0 deletions src/librawspeed/decoders/DcsDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#pragma once

#include "rawspeedconfig.h" // for RAWSPEED_READONLY
#include "common/RawImage.h" // for RawImage
#include "decoders/SimpleTiffDecoder.h" // for SimpleTiffDecoder
#include "io/Buffer.h" // for Buffer
Expand Down
4 changes: 3 additions & 1 deletion src/librawspeed/decoders/ErfDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
*/

#include "decoders/ErfDecoder.h"
#include "adt/Point.h" // for iPoint2D, iRecta...
#include "common/Common.h" // for BitOrder, BitOrd...
#include "decoders/RawDecoderException.h" // for ThrowException
#include "decompressors/UncompressedDecompressor.h" // for UncompressedDeco...
#include "io/Buffer.h" // for Buffer, DataBuffer
Expand All @@ -29,7 +31,7 @@
#include "tiff/TiffIFD.h" // for TiffRootIFD, TiffID
#include "tiff/TiffTag.h" // for TiffTag, TiffTag...
#include <array> // for array
#include <memory> // for unique_ptr, allo...
#include <memory> // for allocator, uniqu...
#include <string> // for operator==, string

namespace rawspeed {
Expand Down
10 changes: 5 additions & 5 deletions src/librawspeed/decoders/IiqDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@
#include <array> // for array, array<>::valu...
#include <cassert> // for assert
#include <cinttypes> // for PRIu64
#include <cmath> // for abs, lround
#include <cmath> // for lround
#include <cstdlib> // for abs
#include <functional> // for greater_equal
#include <iterator> // for advance, next, begin
#include <memory> // for unique_ptr
#include <optional>
#include <string> // for operator==, string
#include <utility> // for move
#include <vector> // for vector, allocator
#include <optional> // for optional, nullopt
#include <string> // for operator==, string
#include <utility> // for move
#include <vector> // for vector, allocator

namespace rawspeed {

Expand Down
3 changes: 2 additions & 1 deletion src/librawspeed/decoders/KdcDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

#include "decoders/KdcDecoder.h"
#include "adt/NORangesSet.h" // for NORangesSet
#include "adt/Point.h" // for iPoint2D
#include "adt/Point.h" // for iPoint2D, iRecta...
#include "common/Common.h" // for BitOrder, BitOrd...
#include "decoders/RawDecoderException.h" // for ThrowRDE
#include "decompressors/UncompressedDecompressor.h" // for UncompressedDeco...
#include "io/Buffer.h" // for Buffer, DataBuffer
Expand Down

0 comments on commit a02d62e

Please sign in to comment.