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

use actual array instead of C string #3214

Merged
merged 2 commits into from
Mar 16, 2025
Merged

use actual array instead of C string #3214

merged 2 commits into from
Mar 16, 2025

Conversation

neheb
Copy link
Collaborator

@neheb neheb commented Mar 14, 2025

C strings in C++ have an extra member for NULL termination. replacing copy_n with copy like this will allow eventual conversion to std::ranges.

Missed changes from last PR.

@neheb neheb requested a review from kevinbackhouse March 14, 2025 22:15
@neheb neheb force-pushed the 3 branch 2 times, most recently from 1933024 to 809a0d5 Compare March 14, 2025 23:25
Copy link

codecov bot commented Mar 14, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 63.91%. Comparing base (ba0d5ea) to head (809a0d5).
Report is 21 commits behind head on main.

Files with missing lines Patch % Lines
src/jpgimage.cpp 66.66% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3214      +/-   ##
==========================================
- Coverage   63.93%   63.91%   -0.02%     
==========================================
  Files         104      104              
  Lines       21755    21752       -3     
  Branches    10636    10636              
==========================================
- Hits        13908    13903       -5     
- Misses       5639     5641       +2     
  Partials     2208     2208              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@neheb neheb force-pushed the 3 branch 3 times, most recently from e3403fd to 55778b8 Compare March 15, 2025 21:10
src/jpgimage.cpp Outdated
Comment on lines 78 to 84
constexpr std::array<byte, 6> exifId_{
0x45, 0x78, 0x69, 0x66, 0x00, 0x00,
}; //!< Exif identifier
constexpr std::array<byte, 29> xmpId_{
0x68, 0x74, 0x74, 0x70, 0x3A, 0x2F, 0x2F, 0x6E, 0x73, 0x2E, 0x61, 0x64, 0x6F, 0x62, 0x65,
0x2E, 0x63, 0x6F, 0x6D, 0x2F, 0x78, 0x61, 0x70, 0x2F, 0x31, 0x2E, 0x30, 0x2F, 0x00,
}; //!< XMP packet identifier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this change. These were readable strings before, but now they look like binary data.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about switching to '' notation?

neheb added 2 commits March 15, 2025 15:42
C strings in C++ have an extra member for NULL termination. replacing
copy_n with copy like this will allow eventual conversion to
std::ranges.

Signed-off-by: Rosen Penev <[email protected]>
Signed-off-by: Rosen Penev <[email protected]>
@neheb neheb merged commit c4e7503 into Exiv2:main Mar 16, 2025
61 checks passed
@neheb neheb deleted the 3 branch March 17, 2025 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants