Commit Graph

2350 Commits

Author SHA1 Message Date
ee8124ed7a Replace unnecessary loop (#1105)
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-08-05 09:45:32 -05:00
965260e3cb Add a note about how I generated list of classes 2023-07-30 06:55:23 +02:00
f903e1ad71 Add checks for the expected sizes of all public classes
This ensures that d-pointers exist where they're expected, and that
classes are virtual that we expect to be virtual, as well as ensuring
that we get a failure if the class size changes when it shouldn't.

This also fixes the issues that were discovered by adding these tests.
2023-07-30 06:31:48 +02:00
a1bdb0171d Remove virtual destructors from POD toolkit types
This one's been haunting me for a couple decades.  "Make all the things
virtual!" was kind of a strategy I had for forward compatibility when I
wrote this code when I was 20 or so and didn't know better.
2023-07-30 02:47:00 +02:00
9bcba812af Use C++11 atomics for RefCounter (#1097) 2023-07-29 06:58:50 +02:00
271bd05afa Improve FrameFactory subclassing
Change the ID3v2 frame factory so it is possible to subclass it for
implementing own frames.  Additionally it splits up the createFrame()
method to make its usage in subclasses a bit more easy.
2023-07-26 07:39:31 +02:00
c54c924333 Use static_cast instead of C-style casts 2023-07-22 07:09:58 +02:00
d314bfa06a Make sure that own header file is included first
Each header corresponding to a .cpp file must be self-contained,
and can be #included without prerequisites.
2023-07-22 07:09:58 +02:00
cc7d23cdf5 Consistently use quote form when including our own headers 2023-07-22 07:09:58 +02:00
2a1fb27735 clang-tidy: Replace C headers with C++ alternatives
run-clang-tidy -header-filter='.*' -checks='-*,modernize-deprecated-headers'

Fixed manually as automatic fix would shuffle headers around.
2023-07-22 07:09:58 +02:00
b5516c9718 clang-tidy: Use default function declarations
run-clang-tidy -header-filter='.*' -checks='-*,modernize-use-equals-default' -fix
2023-07-22 07:09:58 +02:00
231772b2ad clang-tidy: Delete unimplemented private constructors
run-clang-tidy -header-filter='.*' -checks='-*,modernize-use-equals-delete' -fix
2023-07-22 07:09:58 +02:00
77ab5e9689 Narrow the scope of iterators
Also make sure that it is visible at first glance that iterators are
not taken from temporaries.
2023-07-22 07:09:58 +02:00
c2c9e8989c clang-tidy: Use auto where it improves the readability
run-clang-tidy -header-filter='.*' -checks='-*,modernize-use-auto' \
-config="{CheckOptions: [{key: modernize-use-auto.RemoveStars, value: '1'}]}" \
-fix

Manually fixed some wrong `const auto` replacements and verified
that all types are deduced correctly.
2023-07-22 07:09:58 +02:00
63922f2676 Avoid unnecessary detaching of containers
If only a constant iterator is needed, make the container const if
possible, otherwise use cbegin() and cend() to get a constant iterator
without detaching the container.

These fixes are needed so that `auto` can deduce the correct
iterator type.
2023-07-22 07:09:58 +02:00
b273505c28 clang-tidy: static accessed through instance.
run-clang-tidy -header-filter='.*' -checks='-*,readability-static-accessed-through-instance' -fix
2023-07-22 07:09:58 +02:00
abc6c31890 clang-tidy: Use nullptr instead of 0
run-clang-tidy -header-filter='.*' -checks='-*,modernize-use-nullptr' -fix
2023-07-22 07:09:58 +02:00
9867bc947e clang-tidy: Use override keyword
run-clang-tidy -header-filter='.*' -checks='-*,modernize-use-override' -fix
2023-07-22 07:09:58 +02:00
e20a53afbb C bindings - properties i/f (#1091)
Support properties in C bindings

---------

Co-authored-by: whatdoineed2do/Ray <whatdoineed2do@nospam.gmail.com>
Co-authored-by: Urs Fleisch <ufleisch@users.sourceforge.net>
2023-07-09 19:48:27 +02:00
ceb142c9bd Remove functions documented (but not marked) as deprecated
Clean up other stuff with comments about binary incompatibility,
but only as far as to mostly keep source compatibility.
2023-07-09 07:01:37 +02:00
322085f90e Windows: Remove unused FileName member, disable two warnings 2023-07-09 07:01:37 +02:00
250dece2ab Fix warnings about missing virtual destructors 2023-07-09 07:01:37 +02:00
a33cc0635a Remove deprecated stuff 2023-07-09 07:01:37 +02:00
ca8c2e07ec Support large files over 2GB on Windows (#1089)
Backport of 4dcf0b41c6
b01f45e141
https://github.com/taglib/taglib/pull/77

Tested with files larger than 2GB which have been created using

sox -n -r 44100 -C 320 large.mp3 synth 58916 sine 440 channels 2
sox -n -r 44100 -C 0 large.flac synth 25459 sine 440 channels 2
sox -n -r 44100 -C 10 large.ogg synth 229806 sine 440 channels 2
sox -n -r 44100 large.wav synth 6692 sine 440 channels 2
ffmpeg -f lavfi -i "sine=frequency=440:duration=244676" -y large.m4a

The only file which was readable with the tagreader example
before this commit was large.ogg. The problem is that long on
Windows is only 32-bit (also in LLP64 data model of 64-bit
compilation target) and all the file offsets using long are
too small for large files. Now long is replaced by offset_t
(defined to be long long on Windows and off_t on UNIX) for such
cases and some unsigned long are now size_t, which has the
correct size even on Windows.
2023-07-09 07:01:37 +02:00
bc915f5dc8 Use C++17 2023-07-09 07:01:37 +02:00
e5cf30e1e9 Set version and date for TagLib 2.0, simplify SO versioning 2023-07-09 07:01:37 +02:00
c840222a39 Version 1.13.1 v1.13.1 2023-07-01 07:43:27 +02:00
39e712796f ID3v2: Map "TSST" to "DISCSUBTITLE" property (#1087) (#1088) 2023-05-26 13:12:19 +02:00
97203503b0 Do not miss frames when an extended header is present (#1081) 2023-03-18 08:08:37 +01:00
e21640bf10 MP4: Detect atoms with invalid length or type (#1077) 2023-03-18 08:07:46 +01:00
a31356e330 Update FindCppUnit.cmake (#1076)
* Update FindCppUnit.cmake

Require a more modern cppunit to fix tagib build breakage.

* Update FindCppUnit.cmake
2022-12-21 14:14:35 +01:00
9ef9514bfa clang: remove const return (#1074)
Found with readability-const-return-type

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

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-12-10 11:30:21 +01:00
967c0eefed cmake: generate pc files with the use of prefix (#1071) 2022-12-04 13:27:58 +01:00
abbf880872 clang-tidy: use member initializer
Found with cppcoreguidelines-prefer-member-initializer

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-11-28 07:04:42 +01:00
e49724ae5f clang-tidy: remove unused declaration
Found with bugprone-forward-declaration-namespace

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-11-28 07:04:42 +01:00
9427d8f3ba clang-tidy: use patentheses in macros
Found with bugprone-macro-parentheses

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-11-28 07:04:42 +01:00
f40290dcaf clang-tidy: don't assign in if
Found with bugprone-assignment-in-if-condition

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-11-28 07:04:42 +01:00
983a35f5ae clang-tidy: avoid C casting
Found with google-readability-casting

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-11-28 07:04:42 +01:00
4dc6bdcd28 clang-tidy: add ending namespace comments
Found with google-readability-namespace-comments

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-11-28 07:04:42 +01:00
c963d1189a clang-tidy: no else after return
Found with readability-else-after-return

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-11-27 06:35:33 +01:00
1ac61ffe19 clang-tidy: remove pointless return in void func
Found with readability-redundant-control-flow

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-11-27 06:35:33 +01:00
a564d743f8 clang-tidy: remove duplicate include
Found with readability-duplicate-include

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-11-27 06:35:33 +01:00
8c4d663393 clang-tidy: simplify booleans
Found with readability-simplify-boolean-expr

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-11-27 06:35:33 +01:00
bc5e56d3eb Fix parsing of TXXX frame without description (#1069) 2022-11-21 21:42:01 +01:00
8aa7dd81d8 Fix macOS dylib install name to be absolute path
Closes #1065
2022-10-28 18:04:34 +02:00
15ff32b685 Version 1.13 v1.13 2022-10-26 15:44:33 +02:00
084108a908 Document replacements for deprecated functions (#1001) 2022-10-26 15:42:49 +02:00
decc0fa50a Fix Doxygen API documentation
Since the Doxygen output changed quite a bit since the styling was adapted for
TagLib, the API documentation generated with Doxygen 1.9.1 has several problems:

- In the namespaces and classes lists, the nodes cannot be expanded,
  'N' and 'C' characters are prepended to the namespaces and classes instead
  of displaying icons.
- Class members are only accessible for the letter 'a'.
- No "Deprecated" sections are displayed (only the "TAGLIB_DEPRECATED"
  definition in the signature).
- Some things are strangely styled (e.g. an empty box on the left of the
  "Introduction" title).

Now most of the custom styling is removed to get it running again and to avoid
nasty surprises with doxygen changes.
2022-10-24 07:06:23 +02:00
02c7e34681 MSVC: Disable warnings for internal invocations of API functions
https://raw.githubusercontent.com/microsoft/vcpkg/master/ports/taglib/msvc-disable-deprecated-warnings.patch
from Uwe Klotz (uklotzde)
2022-10-23 15:37:06 +02:00
5f079d6992 Use GitHub Actions instead of Travis CI 2022-10-23 11:01:26 +02:00