Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conversions to make_unique #2129

Merged
merged 1 commit into from
Mar 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions src/tiffcomposite_int.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1510,14 +1510,14 @@ namespace Exiv2 {
template<IfdId newGroup>
TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/)
{
return TiffComponent::UniquePtr(new TiffDirectory(tag, newGroup));
return std::make_unique<TiffDirectory>(tag, newGroup);
}

//! Function to create and initialize a new TIFF sub-directory
template<IfdId newGroup>
TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group)
{
return TiffComponent::UniquePtr(new TiffSubIfd(tag, group, newGroup));
return std::make_unique<TiffSubIfd>(tag, group, newGroup);
}

//! Function to create and initialize a new binary array entry
Expand Down Expand Up @@ -1549,33 +1549,29 @@ namespace Exiv2 {
template<uint16_t szTag, IfdId szGroup>
TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group)
{
return TiffComponent::UniquePtr(
new TiffDataEntry(tag, group, szTag, szGroup));
return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
}

//! Function to create and initialize a new TIFF entry for a thumbnail (size)
template<uint16_t dtTag, IfdId dtGroup>
TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group)
{
return TiffComponent::UniquePtr(
new TiffSizeEntry(tag, group, dtTag, dtGroup));
return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
}

//! Function to create and initialize a new TIFF entry for image data
template<uint16_t szTag, IfdId szGroup>
TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group)
{
return TiffComponent::UniquePtr(
new TiffImageEntry(tag, group, szTag, szGroup));
return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
}

//! Function to create and initialize a new TIFF entry for image data (size)
template<uint16_t dtTag, IfdId dtGroup>
TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group)
{
// Todo: Same as newTiffThumbSize - consolidate (rename)?
return TiffComponent::UniquePtr(
new TiffSizeEntry(tag, group, dtTag, dtGroup));
return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
}

}} // namespace Internal, Exiv2
Expand Down