Skip to content

Commit

Permalink
Fix build with clang trunk - unqualified call to std::move
Browse files Browse the repository at this point in the history
  • Loading branch information
LebedevRI committed Mar 4, 2022
1 parent 0c854a1 commit 1a1b723
Show file tree
Hide file tree
Showing 27 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion src/librawspeed/decoders/ArwDecoder.cpp
Expand Up @@ -92,7 +92,7 @@ RawImage ArwDecoder::decodeSRF(const TiffIFD* raw) {
SonyDecrypt(reinterpret_cast<const uint32_t*>(image_data),
reinterpret_cast<uint32_t*>(image_decoded.get()), len / 4, key);

Buffer di(move(image_decoded), len);
Buffer di(std::move(image_decoded), len);

// And now decode as a normal 16bit raw
mRaw->dim = iPoint2D(width, height);
Expand Down
2 changes: 1 addition & 1 deletion src/librawspeed/decoders/ArwDecoder.h
Expand Up @@ -40,7 +40,7 @@ class ArwDecoder final : public AbstractTiffDecoder
static bool isAppropriateDecoder(const TiffRootIFD* rootIFD,
const Buffer& file);
ArwDecoder(TiffRootIFDOwner&& root, const Buffer& file)
: AbstractTiffDecoder(move(root), file) {}
: AbstractTiffDecoder(std::move(root), file) {}

RawImage decodeRawInternal() override;
void decodeMetaDataInternal(const CameraMetaData* meta) override;
Expand Down
2 changes: 1 addition & 1 deletion src/librawspeed/decoders/Cr2Decoder.h
Expand Up @@ -37,7 +37,7 @@ class Cr2Decoder final : public AbstractTiffDecoder
static bool isAppropriateDecoder(const TiffRootIFD* rootIFD,
const Buffer& file);
Cr2Decoder(TiffRootIFDOwner&& root, const Buffer& file)
: AbstractTiffDecoder(move(root), file) {}
: AbstractTiffDecoder(std::move(root), file) {}

RawImage decodeRawInternal() override;
void checkSupportInternal(const CameraMetaData* meta) override;
Expand Down
2 changes: 1 addition & 1 deletion src/librawspeed/decoders/CrwDecoder.cpp
Expand Up @@ -58,7 +58,7 @@ bool CrwDecoder::isCRW(const Buffer& input) {

CrwDecoder::CrwDecoder(std::unique_ptr<const CiffIFD> rootIFD,
const Buffer& file)
: RawDecoder(file), mRootIFD(move(rootIFD)) {}
: RawDecoder(file), mRootIFD(std::move(rootIFD)) {}

RawImage CrwDecoder::decodeRawInternal() {
const CiffEntry* rawData = mRootIFD->getEntry(CiffTag::RAWDATA);
Expand Down
2 changes: 1 addition & 1 deletion src/librawspeed/decoders/DcrDecoder.h
Expand Up @@ -39,7 +39,7 @@ class DcrDecoder final : public SimpleTiffDecoder {
static bool isAppropriateDecoder(const TiffRootIFD* rootIFD,
const Buffer& file);
DcrDecoder(TiffRootIFDOwner&& root, const Buffer& file)
: SimpleTiffDecoder(move(root), file) {}
: SimpleTiffDecoder(std::move(root), file) {}

RawImage decodeRawInternal() override;
void decodeMetaDataInternal(const CameraMetaData* meta) override;
Expand Down
2 changes: 1 addition & 1 deletion src/librawspeed/decoders/DcsDecoder.h
Expand Up @@ -39,7 +39,7 @@ class DcsDecoder final : public SimpleTiffDecoder {
static bool __attribute__((pure))
isAppropriateDecoder(const TiffRootIFD* rootIFD, const Buffer& file);
DcsDecoder(TiffRootIFDOwner&& root, const Buffer& file)
: SimpleTiffDecoder(move(root), file) {}
: SimpleTiffDecoder(std::move(root), file) {}

RawImage decodeRawInternal() override;
void decodeMetaDataInternal(const CameraMetaData* meta) override;
Expand Down
2 changes: 1 addition & 1 deletion src/librawspeed/decoders/DngDecoder.cpp
Expand Up @@ -60,7 +60,7 @@ DngDecoder::isAppropriateDecoder(const TiffRootIFD* rootIFD,
}

DngDecoder::DngDecoder(TiffRootIFDOwner&& rootIFD, const Buffer& file)
: AbstractTiffDecoder(move(rootIFD), file) {
: AbstractTiffDecoder(std::move(rootIFD), file) {
if (!mRootIFD->hasEntryRecursive(TiffTag::DNGVERSION))
ThrowRDE("DNG, but version tag is missing. Will not guess.");

Expand Down
2 changes: 1 addition & 1 deletion src/librawspeed/decoders/ErfDecoder.h
Expand Up @@ -39,7 +39,7 @@ class ErfDecoder final : public SimpleTiffDecoder {
static bool isAppropriateDecoder(const TiffRootIFD* rootIFD,
const Buffer& file);
ErfDecoder(TiffRootIFDOwner&& root, const Buffer& file)
: SimpleTiffDecoder(move(root), file) {}
: SimpleTiffDecoder(std::move(root), file) {}

RawImage decodeRawInternal() override;
void decodeMetaDataInternal(const CameraMetaData* meta) override;
Expand Down
2 changes: 1 addition & 1 deletion src/librawspeed/decoders/IiqDecoder.h
Expand Up @@ -54,7 +54,7 @@ class IiqDecoder final : public AbstractTiffDecoder {
const Buffer& file);

IiqDecoder(TiffRootIFDOwner&& rootIFD, const Buffer& file)
: AbstractTiffDecoder(move(rootIFD), file) {}
: AbstractTiffDecoder(std::move(rootIFD), file) {}

RawImage decodeRawInternal() override;
void checkSupportInternal(const CameraMetaData* meta) override;
Expand Down
2 changes: 1 addition & 1 deletion src/librawspeed/decoders/KdcDecoder.h
Expand Up @@ -39,7 +39,7 @@ class KdcDecoder final : public AbstractTiffDecoder
static bool isAppropriateDecoder(const TiffRootIFD* rootIFD,
const Buffer& file);
KdcDecoder(TiffRootIFDOwner&& root, const Buffer& file)
: AbstractTiffDecoder(move(root), file) {}
: AbstractTiffDecoder(std::move(root), file) {}

RawImage decodeRawInternal() override;
void decodeMetaDataInternal(const CameraMetaData* meta) override;
Expand Down
2 changes: 1 addition & 1 deletion src/librawspeed/decoders/MefDecoder.h
Expand Up @@ -38,7 +38,7 @@ class MefDecoder final : public SimpleTiffDecoder {
static bool isAppropriateDecoder(const TiffRootIFD* rootIFD,
const Buffer& file);
MefDecoder(TiffRootIFDOwner&& root, const Buffer& file)
: SimpleTiffDecoder(move(root), file) {}
: SimpleTiffDecoder(std::move(root), file) {}

RawImage decodeRawInternal() override;
void decodeMetaDataInternal(const CameraMetaData* meta) override;
Expand Down
2 changes: 1 addition & 1 deletion src/librawspeed/decoders/MosDecoder.cpp
Expand Up @@ -69,7 +69,7 @@ bool MosDecoder::isAppropriateDecoder(const TiffRootIFD* rootIFD,
}

MosDecoder::MosDecoder(TiffRootIFDOwner&& rootIFD, const Buffer& file)
: AbstractTiffDecoder(move(rootIFD), file) {
: AbstractTiffDecoder(std::move(rootIFD), file) {
if (mRootIFD->getEntryRecursive(TiffTag::MAKE)) {
auto id = mRootIFD->getID();
make = id.make;
Expand Down
2 changes: 1 addition & 1 deletion src/librawspeed/decoders/NefDecoder.h
Expand Up @@ -43,7 +43,7 @@ class NefDecoder final : public AbstractTiffDecoder
static bool isAppropriateDecoder(const TiffRootIFD* rootIFD,
const Buffer& file);
NefDecoder(TiffRootIFDOwner&& root, const Buffer& file)
: AbstractTiffDecoder(move(root), file) {}
: AbstractTiffDecoder(std::move(root), file) {}

RawImage decodeRawInternal() override;
void decodeMetaDataInternal(const CameraMetaData* meta) override;
Expand Down
2 changes: 1 addition & 1 deletion src/librawspeed/decoders/OrfDecoder.h
Expand Up @@ -41,7 +41,7 @@ class OrfDecoder final : public AbstractTiffDecoder
static bool isAppropriateDecoder(const TiffRootIFD* rootIFD,
const Buffer& file);
OrfDecoder(TiffRootIFDOwner&& root, const Buffer& file)
: AbstractTiffDecoder(move(root), file) {}
: AbstractTiffDecoder(std::move(root), file) {}

RawImage decodeRawInternal() override;
void decodeMetaDataInternal(const CameraMetaData* meta) override;
Expand Down
2 changes: 1 addition & 1 deletion src/librawspeed/decoders/PefDecoder.h
Expand Up @@ -36,7 +36,7 @@ class PefDecoder final : public AbstractTiffDecoder
static bool isAppropriateDecoder(const TiffRootIFD* rootIFD,
const Buffer& file);
PefDecoder(TiffRootIFDOwner&& root, const Buffer& file)
: AbstractTiffDecoder(move(root), file) {}
: AbstractTiffDecoder(std::move(root), file) {}

RawImage decodeRawInternal() override;
void decodeMetaDataInternal(const CameraMetaData* meta) override;
Expand Down
2 changes: 1 addition & 1 deletion src/librawspeed/decoders/RafDecoder.h
Expand Up @@ -39,7 +39,7 @@ class RafDecoder final : public AbstractTiffDecoder
static bool isAppropriateDecoder(const TiffRootIFD* rootIFD,
const Buffer& file);
RafDecoder(TiffRootIFDOwner&& root, const Buffer& file)
: AbstractTiffDecoder(move(root), file) {}
: AbstractTiffDecoder(std::move(root), file) {}

RawImage decodeRawInternal() override;
void applyCorrections(const Camera* cam);
Expand Down
2 changes: 1 addition & 1 deletion src/librawspeed/decoders/Rw2Decoder.h
Expand Up @@ -38,7 +38,7 @@ class Rw2Decoder final : public AbstractTiffDecoder
static bool isAppropriateDecoder(const TiffRootIFD* rootIFD,
const Buffer& file);
Rw2Decoder(TiffRootIFDOwner&& root, const Buffer& file)
: AbstractTiffDecoder(move(root), file) {}
: AbstractTiffDecoder(std::move(root), file) {}

RawImage decodeRawInternal() override;
void decodeMetaDataInternal(const CameraMetaData* meta) override;
Expand Down
2 changes: 1 addition & 1 deletion src/librawspeed/decoders/SimpleTiffDecoder.h
Expand Up @@ -36,7 +36,7 @@ class SimpleTiffDecoder : public AbstractTiffDecoder {

public:
SimpleTiffDecoder(TiffRootIFDOwner&& root, const Buffer& file)
: AbstractTiffDecoder(move(root), file) {}
: AbstractTiffDecoder(std::move(root), file) {}

void prepareForRawDecoding();

Expand Down
2 changes: 1 addition & 1 deletion src/librawspeed/decoders/SrwDecoder.h
Expand Up @@ -37,7 +37,7 @@ class SrwDecoder final : public AbstractTiffDecoder
static bool isAppropriateDecoder(const TiffRootIFD* rootIFD,
const Buffer& file);
SrwDecoder(TiffRootIFDOwner&& root, const Buffer& file)
: AbstractTiffDecoder(move(root), file) {}
: AbstractTiffDecoder(std::move(root), file) {}

RawImage decodeRawInternal() override;
void decodeMetaDataInternal(const CameraMetaData* meta) override;
Expand Down
2 changes: 1 addition & 1 deletion src/librawspeed/decoders/ThreefrDecoder.h
Expand Up @@ -37,7 +37,7 @@ class ThreefrDecoder final : public AbstractTiffDecoder
static bool isAppropriateDecoder(const TiffRootIFD* rootIFD,
const Buffer& file);
ThreefrDecoder(TiffRootIFDOwner&& root, const Buffer& file)
: AbstractTiffDecoder(move(root), file) {}
: AbstractTiffDecoder(std::move(root), file) {}

RawImage decodeRawInternal() override;
void decodeMetaDataInternal(const CameraMetaData* meta) override;
Expand Down
2 changes: 1 addition & 1 deletion src/librawspeed/io/FileReader.cpp
Expand Up @@ -114,7 +114,7 @@ std::unique_ptr<const Buffer> FileReader::readFile() {

#endif // __unix__

return std::make_unique<Buffer>(move(dest), fileSize);
return std::make_unique<Buffer>(std::move(dest), fileSize);
}

} // namespace rawspeed
2 changes: 1 addition & 1 deletion src/librawspeed/parsers/CiffParser.cpp
Expand Up @@ -71,7 +71,7 @@ std::unique_ptr<RawDecoder> CiffParser::getDecoder(const CameraMetaData* meta) {
const std::string make = trimSpaces(mm->getString());

if (make == "Canon")
return std::make_unique<CrwDecoder>(move(mRootIFD), mInput);
return std::make_unique<CrwDecoder>(std::move(mRootIFD), mInput);
}

ThrowCPE("No decoder found. Sorry.");
Expand Down
2 changes: 1 addition & 1 deletion src/librawspeed/parsers/FiffParser.cpp
Expand Up @@ -117,7 +117,7 @@ void FiffParser::parseData() {
}
}

rootIFD->add(move(subIFD));
rootIFD->add(std::move(subIFD));
}

std::unique_ptr<RawDecoder> FiffParser::getDecoder(const CameraMetaData* meta) {
Expand Down
2 changes: 1 addition & 1 deletion src/librawspeed/parsers/TiffParser.cpp
Expand Up @@ -101,7 +101,7 @@ std::unique_ptr<RawDecoder> TiffParser::makeDecoder(TiffRootIFDOwner root,
if (!dChecker(root.get(), data))
continue;

return dConstructor(move(root), data);
return dConstructor(std::move(root), data);
}

ThrowTPE("No decoder found. Sorry.");
Expand Down
6 changes: 3 additions & 3 deletions src/librawspeed/tiff/CiffIFD.cpp
Expand Up @@ -60,7 +60,7 @@ void CiffIFD::parseIFDEntry(NORangesSet<Buffer>* valueDatas,
// Will we ever look for this entry?
if (!isIn(t->tag, CiffTagsWeCareAbout))
return;
add(move(t));
add(std::move(t));
}
}

Expand Down Expand Up @@ -154,12 +154,12 @@ void CiffIFD::add(std::unique_ptr<CiffIFD> subIFD) {
// We are good, and actually can add this sub-IFD, right?
subIFD->recursivelyCheckSubIFDs(0);

mSubIFD.push_back(move(subIFD));
mSubIFD.push_back(std::move(subIFD));
}

void CiffIFD::add(std::unique_ptr<CiffEntry> entry) {
assert(isIn(entry->tag, CiffTagsWeCareAbout));
mEntry[entry->tag] = move(entry);
mEntry[entry->tag] = std::move(entry);
assert(mEntry.size() <= CiffTagsWeCareAbout.size());
}

Expand Down
10 changes: 5 additions & 5 deletions src/librawspeed/tiff/TiffIFD.cpp
Expand Up @@ -64,7 +64,7 @@ void TiffIFD::parseIFDEntry(NORangesSet<Buffer>* ifds, ByteStream& bs) {
// used anywhere right now, let's not
// add(parseDngPrivateData(ifds, t.get()));
// but just add them as entries. (e.g. ArwDecoder uses WB from them)
add(move(t));
add(std::move(t));
break;

case TiffTag::MAKERNOTE:
Expand All @@ -80,11 +80,11 @@ void TiffIFD::parseIFDEntry(NORangesSet<Buffer>* ifds, ByteStream& bs) {
break;

default:
add(move(t));
add(std::move(t));
}
} catch (const RawspeedException&) { // Unparsable private data are added as
// entries
add(move(t));
add(std::move(t));
}
}

Expand Down Expand Up @@ -281,12 +281,12 @@ void TiffIFD::add(TiffIFDOwner subIFD) {
// We are good, and actually can add this sub-IFD, right?
subIFD->recursivelyCheckSubIFDs(0);

subIFDs.push_back(move(subIFD));
subIFDs.push_back(std::move(subIFD));
}

void TiffIFD::add(TiffEntryOwner entry) {
entry->parent = this;
entries[entry->tag] = move(entry);
entries[entry->tag] = std::move(entry);
}

TiffEntry* TiffIFD::getEntry(TiffTag tag) const {
Expand Down
8 changes: 4 additions & 4 deletions test/librawspeed/common/PointTest.cpp
Expand Up @@ -80,13 +80,13 @@ TEST(PointTest, Constructor) {
});
ASSERT_NO_THROW({
const iPoint2D a(x, y);
iPoint2D b(move(a));
iPoint2D b(std::move(a));
ASSERT_EQ(b.x, x);
ASSERT_EQ(b.y, y);
});
ASSERT_NO_THROW({
iPoint2D a(x, y);
iPoint2D b(move(a));
iPoint2D b(std::move(a));
ASSERT_EQ(b.x, x);
ASSERT_EQ(b.y, y);
});
Expand All @@ -111,14 +111,14 @@ TEST(PointTest, AssignmentConstructor) {
ASSERT_NO_THROW({
iPoint2D a(x, y);
iPoint2D b(666, 777);
b = move(a);
b = std::move(a);
ASSERT_EQ(b.x, x);
ASSERT_EQ(b.y, y);
});
ASSERT_NO_THROW({
const iPoint2D a(x, y);
iPoint2D b(666, 777);
b = move(a);
b = std::move(a);
ASSERT_EQ(b.x, x);
ASSERT_EQ(b.y, y);
});
Expand Down

0 comments on commit 1a1b723

Please sign in to comment.