Skip to content

Commit 6467f06

Browse files
committed
clazy: trivial types to value
Signed-off-by: Rosen Penev <[email protected]>
1 parent 174c759 commit 6467f06

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

src/convert.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ bool convertStringCharsetWindows(std::string& str, std::string_view from, std::s
6262
exactly one entry, \em value is set to this entry, without the qualifier.
6363
The return code indicates if the operation was successful.
6464
*/
65-
bool getTextValue(std::string& value, const Exiv2::XmpData::iterator& pos);
65+
bool getTextValue(std::string& value, Exiv2::XmpData::iterator pos);
6666
} // namespace
6767

6868
// *****************************************************************************
@@ -1589,7 +1589,7 @@ bool convertStringCharsetWindows(std::string& str, std::string_view from, std::s
15891589
}
15901590

15911591
#endif // EXV_HAVE_ICONV
1592-
bool getTextValue(std::string& value, const XmpData::iterator& pos) {
1592+
bool getTextValue(std::string& value, XmpData::iterator pos) {
15931593
if (pos->typeId() == langAlt) {
15941594
// get the default language entry without x-default qualifier
15951595
value = pos->toString(0);

src/makernote_int.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ namespace fs = std::filesystem;
4141
namespace {
4242
// Todo: Can be generalized further - get any tag as a string/long/...
4343
//! Get the Value for a tag within a particular group
44-
const Exiv2::Value* getExifValue(Exiv2::Internal::TiffComponent* pRoot, const uint16_t& tag, const Exiv2::IfdId& group);
44+
const Exiv2::Value* getExifValue(Exiv2::Internal::TiffComponent* pRoot, uint16_t tag, Exiv2::IfdId group);
4545
//! Get the model name from tag Exif.Image.Model
4646
std::string getExifModel(Exiv2::Internal::TiffComponent* pRoot);
4747

@@ -1036,8 +1036,7 @@ int sonyMisc3cSelector(uint16_t /*tag*/, const byte* /*pData*/, size_t /*size*/,
10361036
// *****************************************************************************
10371037
// local definitions
10381038
namespace {
1039-
const Exiv2::Value* getExifValue(Exiv2::Internal::TiffComponent* pRoot, const uint16_t& tag,
1040-
const Exiv2::IfdId& group) {
1039+
const Exiv2::Value* getExifValue(Exiv2::Internal::TiffComponent* pRoot, uint16_t tag, Exiv2::IfdId group) {
10411040
Exiv2::Internal::TiffFinder finder(tag, group);
10421041
if (!pRoot)
10431042
return nullptr;

src/tiffimage_int.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class TiffHeader : public TiffHeaderBase {
139139
using TiffGroupKey = std::pair<uint32_t, IfdId>;
140140

141141
struct TiffGroupKey_hash {
142-
std::size_t operator()(const TiffGroupKey& pair) const noexcept {
142+
std::size_t operator()(TiffGroupKey pair) const noexcept {
143143
return std::hash<uint64_t>{}(static_cast<uint64_t>(pair.first) << 32 | static_cast<uint64_t>(pair.second));
144144
}
145145
};

src/xmp.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -206,16 +206,16 @@ class FindXmpdatum {
206206

207207
#ifdef EXV_HAVE_XMP_TOOLKIT
208208
//! Convert XMP Toolkit struct option bit to Value::XmpStruct
209-
Exiv2::XmpValue::XmpStruct xmpStruct(const XMP_OptionBits& opt);
209+
Exiv2::XmpValue::XmpStruct xmpStruct(XMP_OptionBits opt);
210210

211211
//! Convert Value::XmpStruct to XMP Toolkit array option bits
212212
XMP_OptionBits xmpArrayOptionBits(Exiv2::XmpValue::XmpStruct xs);
213213

214214
//! Convert XMP Toolkit array option bits to array TypeId
215-
Exiv2::TypeId arrayValueTypeId(const XMP_OptionBits& opt);
215+
Exiv2::TypeId arrayValueTypeId(XMP_OptionBits opt);
216216

217217
//! Convert XMP Toolkit array option bits to Value::XmpArrayType
218-
Exiv2::XmpValue::XmpArrayType xmpArrayType(const XMP_OptionBits& opt);
218+
Exiv2::XmpValue::XmpArrayType xmpArrayType(XMP_OptionBits opt);
219219

220220
//! Convert Value::XmpArrayType to XMP Toolkit array option bits
221221
XMP_OptionBits xmpArrayOptionBits(Exiv2::XmpValue::XmpArrayType xat);
@@ -225,7 +225,7 @@ XMP_OptionBits xmpFormatOptionBits(Exiv2::XmpParser::XmpFormatFlags flags);
225225

226226
//! Print information about a parsed XMP node
227227
void printNode(const std::string& schemaNs, const std::string& propPath, const std::string& propValue,
228-
const XMP_OptionBits& opt);
228+
XMP_OptionBits opt);
229229

230230
//! Make an XMP key from a schema namespace and property path
231231
Exiv2::XmpKey::UniquePtr makeXmpKey(const std::string& schemaNs, const std::string& propPath);
@@ -904,7 +904,7 @@ int XmpParser::encode(std::string& /*xmpPacket*/, const XmpData& xmpData, uint16
904904
// local definitions
905905
namespace {
906906
#ifdef EXV_HAVE_XMP_TOOLKIT
907-
Exiv2::XmpValue::XmpStruct xmpStruct(const XMP_OptionBits& opt) {
907+
Exiv2::XmpValue::XmpStruct xmpStruct(XMP_OptionBits opt) {
908908
Exiv2::XmpValue::XmpStruct var(Exiv2::XmpValue::xsNone);
909909
if (XMP_PropIsStruct(opt)) {
910910
var = Exiv2::XmpValue::xsStruct;
@@ -924,7 +924,7 @@ XMP_OptionBits xmpArrayOptionBits(Exiv2::XmpValue::XmpStruct xs) {
924924
return var;
925925
}
926926

927-
Exiv2::TypeId arrayValueTypeId(const XMP_OptionBits& opt) {
927+
Exiv2::TypeId arrayValueTypeId(XMP_OptionBits opt) {
928928
Exiv2::TypeId typeId(Exiv2::invalidTypeId);
929929
if (XMP_PropIsArray(opt)) {
930930
if (XMP_ArrayIsAlternate(opt))
@@ -937,7 +937,7 @@ Exiv2::TypeId arrayValueTypeId(const XMP_OptionBits& opt) {
937937
return typeId;
938938
}
939939

940-
Exiv2::XmpValue::XmpArrayType xmpArrayType(const XMP_OptionBits& opt) {
940+
Exiv2::XmpValue::XmpArrayType xmpArrayType(XMP_OptionBits opt) {
941941
return Exiv2::XmpValue::xmpArrayType(arrayValueTypeId(opt));
942942
}
943943

@@ -986,7 +986,7 @@ XMP_OptionBits xmpFormatOptionBits(Exiv2::XmpParser::XmpFormatFlags flags) {
986986

987987
#ifdef EXIV2_DEBUG_MESSAGES
988988
void printNode(const std::string& schemaNs, const std::string& propPath, const std::string& propValue,
989-
const XMP_OptionBits& opt) {
989+
XMP_OptionBits opt) {
990990
static bool first = true;
991991
if (first) {
992992
first = false;
@@ -1041,7 +1041,7 @@ void printNode(const std::string& schemaNs, const std::string& propPath, const s
10411041
std::cout << '\n';
10421042
}
10431043
#else
1044-
void printNode(const std::string&, const std::string&, const std::string&, const XMP_OptionBits&) {
1044+
void printNode(const std::string&, const std::string&, const std::string&, XMP_OptionBits) {
10451045
}
10461046
#endif // EXIV2_DEBUG_MESSAGES
10471047

0 commit comments

Comments
 (0)