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

1 #2212

Merged
merged 6 commits into from
Apr 19, 2022
Merged

1 #2212

merged 6 commits into from
Apr 19, 2022

Conversation

neheb
Copy link
Collaborator

@neheb neheb commented Apr 15, 2022

No description provided.

@codecov
Copy link

codecov bot commented Apr 15, 2022

Codecov Report

Merging #2212 (bd1758c) into main (d466c1e) will increase coverage by 0.00%.
The diff coverage is 87.75%.

@@           Coverage Diff           @@
##             main    #2212   +/-   ##
=======================================
  Coverage   63.30%   63.30%           
=======================================
  Files         116      116           
  Lines       19597    19599    +2     
  Branches     9545     9545           
=======================================
+ Hits        12405    12407    +2     
  Misses       5117     5117           
  Partials     2075     2075           
Impacted Files Coverage Δ
app/actions.hpp 100.00% <ø> (ø)
include/exiv2/bmffimage.hpp 100.00% <ø> (ø)
src/bmffimage.cpp 76.00% <ø> (ø)
src/makernote_int.hpp 92.30% <ø> (ø)
src/preview.cpp 46.75% <0.00%> (ø)
src/tiffcomposite_int.hpp 92.66% <0.00%> (ø)
src/tiffimage_int.hpp 87.50% <ø> (ø)
src/tiffvisitor_int.hpp 100.00% <ø> (ø)
src/tiffvisitor_int.cpp 79.52% <77.77%> (+0.04%) ⬆️
src/makernote_int.cpp 64.62% <88.88%> (ø)
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d466c1e...bd1758c. Read the comment docs.

Copy link
Collaborator

@piponazo piponazo left a comment

Choose a reason for hiding this comment

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

2nd commit is nice 👏

In the 1st one, I do not have a strong opinion about removing the const keyword in parameters passed by value. However, with variables passed by pointer, I do not like to have different signatures in the header/cpp files. I think it might trigger unnecessary mental load for the code reader.

@@ -47,16 +47,16 @@ struct EXIV2API Photoshop {
/// @return 0 if successful;<BR>
/// 3 if no data for psTag was found in pPsData;<BR>
/// -2 if the pPsData buffer does not contain valid data.
static int locateIrb(const byte* pPsData, size_t sizePsData, uint16_t psTag, const byte** record,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Two comments here:

  1. Why to change the signature only in the header and not in the .cpp too?
  2. After looking at the code, I think it would even make more sense to pass the 2 last parameters by reference instead of by pointer. Then we do not need to check if those variables are nullptr or not.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@@ -622,7 +622,7 @@ TiffComponent* newCasio2Mn2(uint16_t tag, IfdId group, IfdId mnGroup);
@param pRoot Pointer to the root component of the TIFF tree.
@return An index into the array set, -1 if no match was found.
*/
int sonyCsSelector(uint16_t tag, const byte* pData, size_t size, TiffComponent* const pRoot);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same comment in all these functions insider makernote_int. I feel unconfortable having different signatures in the declaration and definitions. It might add unnecessary complexity for the code reader without much benefit.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Found with readability-avoid-const-params-in-decls

Signed-off-by: Rosen Penev <rosenp@gmail.com>
There's no nullptr here.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
std::move is used.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Copy link
Collaborator

@piponazo piponazo left a comment

Choose a reason for hiding this comment

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

Thanks for taking the extra steps suggested. LGTM 👏

@piponazo piponazo merged commit 6438305 into Exiv2:main Apr 19, 2022
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