Skip to content

Commit f7c0818

Browse files
authored
Merge pull request #751 from LebedevRI/clang-19
Clang 19 build fixes
2 parents 0332dd1 + e06790f commit f7c0818

36 files changed

+71
-71
lines changed

fuzz/librawspeed/decompressors/UncompressedDecompressor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size) {
5757
case static_cast<int>(rawspeed::BitOrder::JPEG):
5858
return rawspeed::BitOrder(val);
5959
default:
60-
ThrowRSE("Unknown bit order: %u", val);
60+
ThrowRSE("Unknown bit order: %i", val);
6161
}
6262
__builtin_unreachable();
6363
}();

src/librawspeed/codes/AbstractPrefixCodeTranscoder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ template <typename CodeTag> class AbstractPrefixCodeTranscoder {
9393

9494
bool operator==(const AbstractPrefixCodeTranscoder& other) const {
9595
return code.symbols == other.code.symbols &&
96-
code.Base::codeValues == other.codeValues;
96+
code.Base::codeValues == other.code.Base::codeValues;
9797
}
9898
};
9999

src/librawspeed/common/DngOpcodes.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ class DngOpcodes::ROIOpcode : public DngOpcodes::DngOpcode {
212212
if (!(subImage.isPointInsideInclusive(topLeft) &&
213213
subImage.isPointInsideInclusive(bottomRight) &&
214214
bottomRight >= topLeft)) {
215-
ThrowRDE("Rectangle (%u, %u, %u, %u) not inside image (%u, %u, %u, %u).",
215+
ThrowRDE("Rectangle (%d, %d, %d, %d) not inside image (%d, %d, %d, %d).",
216216
topLeft.x, topLeft.y, bottomRight.x, bottomRight.y,
217217
subImage.getTopLeft().x, subImage.getTopLeft().y,
218218
subImage.getBottomRight().x, subImage.getBottomRight().y);
@@ -702,7 +702,7 @@ DngOpcodes::DngOpcodes(const RawImage& ri, ByteStream bs) {
702702
if (auto Op = Map(code))
703703
std::tie(opName, opConstructor) = *Op;
704704
else
705-
ThrowRDE("Unknown unhandled Opcode: %d", code);
705+
ThrowRDE("Unknown unhandled Opcode: %u", code);
706706

707707
if (opConstructor != nullptr)
708708
opcodes.emplace_back(opConstructor(ri, opcode_bs, integrated_subimg));
@@ -711,7 +711,7 @@ DngOpcodes::DngOpcodes(const RawImage& ri, ByteStream bs) {
711711
// Throw Error if not marked as optional
712712
if (!(flags & 1))
713713
#endif
714-
ThrowRDE("Unsupported Opcode: %d (%s)", code, opName);
714+
ThrowRDE("Unsupported Opcode: %u (%s)", code, opName);
715715
}
716716

717717
if (opcode_bs.getRemainSize() != 0)

src/librawspeed/common/RawImage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ void RawImageData::setCpp(uint32_t val) {
155155
ThrowRDE("Attempted to set Components per pixel after data allocation");
156156
if (val > 4) {
157157
ThrowRDE(
158-
"Only up to 4 components per pixel is support - attempted to set: %d",
158+
"Only up to 4 components per pixel is support - attempted to set: %u",
159159
val);
160160
}
161161

src/librawspeed/decoders/ArwDecoder.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -613,14 +613,14 @@ void ArwDecoder::GetWB() const {
613613
if (encryptedIFD.hasEntry(TiffTag::SONYGRBGLEVELS)) {
614614
const TiffEntry* wb = encryptedIFD.getEntry(TiffTag::SONYGRBGLEVELS);
615615
if (wb->count != 4)
616-
ThrowRDE("WB has %d entries instead of 4", wb->count);
616+
ThrowRDE("WB has %u entries instead of 4", wb->count);
617617
mRaw->metadata.wbCoeffs[0] = wb->getFloat(1);
618618
mRaw->metadata.wbCoeffs[1] = wb->getFloat(0);
619619
mRaw->metadata.wbCoeffs[2] = wb->getFloat(2);
620620
} else if (encryptedIFD.hasEntry(TiffTag::SONYRGGBLEVELS)) {
621621
const TiffEntry* wb = encryptedIFD.getEntry(TiffTag::SONYRGGBLEVELS);
622622
if (wb->count != 4)
623-
ThrowRDE("WB has %d entries instead of 4", wb->count);
623+
ThrowRDE("WB has %u entries instead of 4", wb->count);
624624
mRaw->metadata.wbCoeffs[0] = wb->getFloat(0);
625625
mRaw->metadata.wbCoeffs[1] = wb->getFloat(1);
626626
mRaw->metadata.wbCoeffs[2] = wb->getFloat(3);
@@ -629,7 +629,7 @@ void ArwDecoder::GetWB() const {
629629
if (encryptedIFD.hasEntry(TiffTag::SONYBLACKLEVEL)) {
630630
const TiffEntry* bl = encryptedIFD.getEntry(TiffTag::SONYBLACKLEVEL);
631631
if (bl->count != 4)
632-
ThrowRDE("Black Level has %d entries instead of 4", bl->count);
632+
ThrowRDE("Black Level has %u entries instead of 4", bl->count);
633633
mRaw->blackLevelSeparate =
634634
Array2DRef(mRaw->blackLevelSeparateStorage.data(), 2, 2);
635635
auto blackLevelSeparate1D = *mRaw->blackLevelSeparate->getAsArray1DRef();
@@ -640,7 +640,7 @@ void ArwDecoder::GetWB() const {
640640
if (encryptedIFD.hasEntry(TiffTag::SONYWHITELEVEL)) {
641641
const TiffEntry* wl = encryptedIFD.getEntry(TiffTag::SONYWHITELEVEL);
642642
if (wl->count != 1 && wl->count != 3)
643-
ThrowRDE("White Level has %d entries instead of 1 or 3", wl->count);
643+
ThrowRDE("White Level has %u entries instead of 1 or 3", wl->count);
644644
mRaw->whitePoint = wl->getU16(0) >> mShiftDownScaleForExif;
645645
}
646646
}

src/librawspeed/decoders/Cr2Decoder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ RawImage Cr2Decoder::decodeNewFormat() {
170170
raw->getEntryRecursive(TiffTag::CANONCR2SLICE);
171171
cr2SliceEntry) {
172172
if (cr2SliceEntry->count != 3) {
173-
ThrowRDE("Found RawImageSegmentation tag with %d elements, should be 3.",
173+
ThrowRDE("Found RawImageSegmentation tag with %u elements, should be 3.",
174174
cr2SliceEntry->count);
175175
}
176176

src/librawspeed/decoders/DngDecoder.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ DngDecoder::DngDecoder(TiffRootIFDOwner&& rootIFD, Buffer file)
7272
mRootIFD->getEntryRecursive(TiffTag::DNGVERSION)->getData().getBuffer(4);
7373

7474
if (v[0] != 1) {
75-
ThrowRDE("Not a supported DNG image format: v%u.%u.%u.%u",
75+
ThrowRDE("Not a supported DNG image format: v%i.%i.%i.%i",
7676
static_cast<int>(v[0]), static_cast<int>(v[1]),
7777
static_cast<int>(v[2]), static_cast<int>(v[3]));
7878
}
@@ -159,7 +159,7 @@ Optional<iRectangle2D> DngDecoder::parseACTIVEAREA(const TiffIFD* raw) const {
159159

160160
const TiffEntry* active_area = raw->getEntry(TiffTag::ACTIVEAREA);
161161
if (active_area->count != 4)
162-
ThrowRDE("active area has %d values instead of 4", active_area->count);
162+
ThrowRDE("active area has %u values instead of 4", active_area->count);
163163

164164
const iRectangle2D fullImage(0, 0, mRaw->dim.x, mRaw->dim.y);
165165

@@ -172,7 +172,7 @@ Optional<iRectangle2D> DngDecoder::parseACTIVEAREA(const TiffIFD* raw) const {
172172
if (!(fullImage.isPointInsideInclusive(topLeft) &&
173173
fullImage.isPointInsideInclusive(bottomRight) &&
174174
bottomRight >= topLeft)) {
175-
ThrowRDE("Rectangle (%u, %u, %u, %u) not inside image (%u, %u, %u, %u).",
175+
ThrowRDE("Rectangle (%i, %i, %i, %i) not inside image (%i, %i, %i, %i).",
176176
topLeft.x, topLeft.y, bottomRight.x, bottomRight.y,
177177
fullImage.getTopLeft().x, fullImage.getTopLeft().y,
178178
fullImage.getBottomRight().x, fullImage.getBottomRight().y);
@@ -229,7 +229,7 @@ void DngDecoder::parseCFA(const TiffIFD* raw) const {
229229
iPoint2D cfaSize(cfadim->getU32(1), cfadim->getU32(0));
230230
if (!cfaSize.hasPositiveArea() || cfaSize.area() != cPat->count) {
231231
ThrowRDE("CFA pattern dimension and pattern count does not "
232-
"match: %d.",
232+
"match: %u.",
233233
cPat->count);
234234
}
235235

@@ -351,7 +351,7 @@ DngDecoder::getTilingDescription(const TiffIFD* raw) const {
351351

352352
if (yPerSlice == 0 ||
353353
roundUpDivisionSafe(mRaw->dim.y, yPerSlice) != counts->count) {
354-
ThrowRDE("Invalid y per slice %u or strip count %u (height = %u)",
354+
ThrowRDE("Invalid y per slice %u or strip count %u (height = %i)",
355355
yPerSlice, counts->count, mRaw->dim.y);
356356
}
357357

@@ -465,7 +465,7 @@ RawImage DngDecoder::decodeRawInternal() {
465465

466466
bps = raw->getEntry(TiffTag::BITSPERSAMPLE)->getU32();
467467
if (*bps < 1 || *bps > 32)
468-
ThrowRDE("Unsupported bit per sample count: %u.", *bps);
468+
ThrowRDE("Unsupported bit per sample count: %i.", *bps);
469469

470470
uint32_t sample_format = 1;
471471
if (raw->hasEntry(TiffTag::SAMPLEFORMAT))

src/librawspeed/decoders/KdcDecoder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ RawImage KdcDecoder::decodeRawInternal() {
7979
if (auto compression =
8080
mRootIFD->getEntryRecursive(TiffTag::COMPRESSION)->getU32();
8181
7 != compression)
82-
ThrowRDE("Unsupported compression %d", compression);
82+
ThrowRDE("Unsupported compression %u", compression);
8383

8484
const TiffEntry* ifdoffset = mRootIFD->getEntryRecursive(TiffTag::KODAK_IFD2);
8585
if (!ifdoffset)
@@ -104,7 +104,7 @@ RawImage KdcDecoder::decodeRawInternal() {
104104
mRaw->dim = iPoint2D(width, height);
105105

106106
if (!mRaw->dim.hasPositiveArea() || !(mRaw->dim <= iPoint2D(4304, 3221)))
107-
ThrowRDE("Unexpected image dimensions found: (%u; %u)", mRaw->dim.x,
107+
ThrowRDE("Unexpected image dimensions found: (%d; %d)", mRaw->dim.x,
108108
mRaw->dim.y);
109109

110110
const Buffer inputBuffer = KdcDecoder::getInputBuffer();

src/librawspeed/decoders/NefDecoder.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ void NefDecoder::DecodeUncompressed() const {
230230

231231
if (yPerSlice == 0 || yPerSlice > static_cast<uint32_t>(mRaw->dim.y) ||
232232
roundUpDivisionSafe(mRaw->dim.y, yPerSlice) != counts->count) {
233-
ThrowRDE("Invalid y per slice %u or strip count %u (height = %u)",
233+
ThrowRDE("Invalid y per slice %u or strip count %u (height = %i)",
234234
yPerSlice, counts->count, mRaw->dim.y);
235235
}
236236

@@ -630,10 +630,10 @@ void NefDecoder::decodeMetaDataInternal(const CameraMetaData* meta) {
630630
const TiffEntry* bl =
631631
mRootIFD->getEntryRecursive(TiffTag::NIKON_BLACKLEVEL);
632632
if (bl->count != 4)
633-
ThrowRDE("BlackLevel has %d entries instead of 4", bl->count);
633+
ThrowRDE("BlackLevel has %u entries instead of 4", bl->count);
634634
uint32_t bitPerPixel = getBitPerSample();
635635
if (bitPerPixel != 12 && bitPerPixel != 14)
636-
ThrowRDE("Bad bit per pixel: %i", bitPerPixel);
636+
ThrowRDE("Bad bit per pixel: %u", bitPerPixel);
637637
const int sh = 14 - bitPerPixel;
638638
mRaw->blackLevelSeparate =
639639
Array2DRef(mRaw->blackLevelSeparateStorage.data(), 2, 2);
@@ -664,7 +664,7 @@ void NefDecoder::decodeMetaDataInternal(const CameraMetaData* meta) {
664664
// trivial to run this multithreaded.
665665
void NefDecoder::DecodeNikonSNef(ByteStream input) const {
666666
if (mRaw->dim.x < 6)
667-
ThrowIOE("got a %u wide sNEF, aborting", mRaw->dim.x);
667+
ThrowIOE("got a %i wide sNEF, aborting", mRaw->dim.x);
668668

669669
// We need to read the applied whitebalance, since we should return
670670
// data before whitebalance, so we "unapply" it.

src/librawspeed/decoders/RafDecoder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ void RafDecoder::decodeMetaDataInternal(const CameraMetaData* meta) {
285285
unsigned bps =
286286
mRootIFD->getEntryRecursive(TiffTag::FUJI_BITSPERSAMPLE)->getU32();
287287
if (bps > 16)
288-
ThrowRDE("Unexpected bit depth: %i", bps);
288+
ThrowRDE("Unexpected bit depth: %u", bps);
289289
mRaw->whitePoint = implicit_cast<int>((1UL << bps) - 1UL);
290290
}
291291

0 commit comments

Comments
 (0)