Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@sbooth
Copy link
Contributor

@sbooth sbooth commented Dec 8, 2024

Closes #1256

@sbooth sbooth requested a review from ufleisch December 8, 2024 01:37
@scotchi
Copy link
Member

scotchi commented Dec 8, 2024

  • Probably preferable to use Shorten for the namespace name rather than SHN.
  • The coding style / naming for shnfile is very different from TagLib's style. Was that code pasted from somewhere else? There's no copyright statement indicating such.
  • String literals obviously can't be in single quotes.

In shnfile there are quite a few things that could be cleaned up a bit (e.g. using TagLib's ByteVector instead of arrays that are created with new. Quite a few things could be constexpr instead of const, etc., but I thought I'd wait to hear where that code's actually from before going into too much detail.

@sbooth
Copy link
Contributor Author

sbooth commented Dec 8, 2024

  • Probably preferable to use Shorten for the namespace name rather than SHN.

I went back and forth on this. I couldn't find a clear standard in TagLib for the naming. File extensions seemed to be common for namespace names- Monkey's Audio uses APE, Musepack uses MPC, but True Audio uses TrueAudio.

  • The coding style / naming for shnfile is very different from TagLib's style. Was that code pasted from somewhere else? There's no copyright statement indicating such.

The code is modified from a Shorten decoder I wrote in Objective-C++ a few years ago. The naming conventions are a bit of a mishmash as I've ported portions back and forth to different languages several times including this pared-down port to C++. I was generally inspired by the original shorten written by Tony Robinson as the reference for the Shorten format.

  • String literals obviously can't be in single quotes.

Those are four-character codes (integers masquerading), not string literals, but they can easily be changed to integers.

In shnfile there are quite a few things that could be cleaned up a bit (e.g. using TagLib's ByteVector instead of arrays that are created with new. Quite a few things could be constexpr instead of const, etc., but I thought I'd wait to hear where that code's actually from before going into too much detail.

sbooth and others added 17 commits December 7, 2024 23:22
cppcheck --enable=all --inline-suppr \
  --suppress=noExplicitConstructor --suppress=unusedFunction \
  --suppress=missingIncludeSystem --project=compile_commands.json
Reason for these changes: getRiceGolombCode(k, uInt32CodeSize) was
called with int k for uint32_t& argument.
There was also a warning from MSVC for line 299:
warning C4267: 'argument': conversion from 'size_t' to 'int'
@ufleisch
Copy link
Contributor

It looks good to me. I just added a few commit with stylistic changes, you can still remove them if you do not agree.

@sbooth
Copy link
Contributor Author

sbooth commented Dec 17, 2024

Thanks for the review- I am fine with those changes. I pushed another commit with some additional explicit types in an attempt to further standardize and group constants.

What is your opinion on SHN vs. Shorten for the namespace name?

@ufleisch
Copy link
Contributor

What is your opinion on SHN vs. Shorten for the namespace name?

Probably, Shorten would be more consistent with most (but not all) of the other namespace names.

Also rename files to match
@sbooth
Copy link
Contributor Author

sbooth commented Dec 22, 2024

If there are no further review comments or objections in the next few days I will squash and merge this into master.

@sbooth sbooth merged commit 648f5e5 into taglib:master Dec 30, 2024
3 checks passed
@sbooth sbooth deleted the shn branch December 30, 2024 13:23
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.

Shorten (SHN) support

3 participants