Rosen Penev
513b0e8bbd
constexpr some constructors
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years ago
Rosen Penev
0aed79ff57
remove several constructors
...
Just direct initialize
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years ago
Rosen Penev
024e026bbb
clang: small fixes
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years ago
Rosen Penev
d29001f2a4
clang-tidy: don't use non const refs
...
Found with: google-runtime-references
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years ago
Kevin Backhouse
5d11208aa0
Minor refactorings to stop UBSAN from complaining.
2 years ago
Rosen Penev
725875497b
SonarLint cleanups
2 years ago
Rosen Penev
4e3a63d9b7
replace std::pair and tuple with C structs
...
fixes internal MSVC libc++ warnings
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years ago
Rosen Penev
7aaf6414f2
move initialization up
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years ago
Rosen Penev
f981c51eea
get rid of -fanalyzer memory leaks
...
Don't use make_shared inside a function. Instead, change constructor to
value to have std::move.
Also move shared_ptrs everywhere. It's fairly expensive to copy.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years ago
Kevin Backhouse
abd817d181
Use size_t for sizes and offsets.
3 years ago
Kevin Backhouse
62705a6615
Use Safe::add() in tiffvisitor_int.cpp
3 years ago
Kevin Backhouse
56249bb1a0
Use getULong to read unsigned numbers.
3 years ago
Rosen Penev
fc840405cc
revert std::function back to function pointers
...
The former has too much overhead. No point in it.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Rosen Penev
d4f04296e4
remove explicit constructor
...
No need.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Rosen Penev
e74feff4d8
strcmp to == conversions
...
Does the same thing.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Rosen Penev
1d0530f04d
misc sonarlint changes
...
Mostly const changes.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Rosen Penev
e34395e095
replace shared_ptr with make_shared
...
The former creates a nullptr. The latter actually allocates.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Kevin Backhouse
3ef783e02a
Convert IfdId and SectionId to enum classes.
3 years ago
Kevin Backhouse
3f7cb78a3b
Move enums from tags_int.hpp to tags.hpp
3 years ago
Rosen Penev
bae7da19ca
clang-tidy: use default member init
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Rosen Penev
b4c90b5e16
clang-tidy: replace pointer magic with data()
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Rosen Penev
65c5b772c9
fix misplaced const
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Rosen Penev
a86bc386da
reference conversions
...
There's no nullptr here.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Rosen Penev
48f848f5bb
clang-tidy: remove const params in decls
...
Found with readability-avoid-const-params-in-decls
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Rosen Penev
2e721a716e
std::function conversions
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Luis Díaz Más
f942ba89bd
Move Photoshopb class to internal namespace
3 years ago
Rosen Penev
9cb1fcef5c
std::array conversions
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Luis Díaz Más
d7f35e33f0
Remove useless static_casts
3 years ago
Luis Díaz Más
ae4df71233
Remove DataBuf::copyBytes and use std::copy instead
3 years ago
Luis Díaz Más
b05573fadc
Remove most of the asserts from codebase
3 years ago
Luis Díaz Más
30bf563f4d
Update .clang-format file & apply clang-format to whole project
3 years ago
Rosen Penev
b2b6d834ba
some std::array conversions ( #2148 )
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Luis Diaz
7576a2757b
More size_t for sizes
3 years ago
Luis Diaz
137ea080b5
Change Metadatum::size() return value from long to size_t
3 years ago
Luis Diaz
62aad98d0b
Change Metadatum::copy return value from long to size_t
3 years ago
Luis Díaz Más
96f7f2e4c5
Convert Exiv2::ErrorCode into an enum class
3 years ago
Luis Díaz Más
c115d4daf7
Merge pull request #2131 from Exiv2/mainCleanups
...
Include what you use + more SPDX identifiers + few other cleanups
3 years ago
Rosen Penev
8dadcdf72a
manual nullptr removals
...
unique_ptr has a bool overload. It's also easier to reason about.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Luis Díaz Más
f894ee0568
Fix debug builds
3 years ago
Luis Díaz Más
8b1fe379a1
Removing unused headers thanks to IWYU
3 years ago
Rosen Penev
daf7c890e2
misc stuff
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Rosen Penev
133849c394
clang-tidy: remove pointless get()
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Rosen Penev
6d1fa2ecea
clang-tidy: use empty() instead of size()
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Rosen Penev
04bacdedd6
clang-tidy: use auto
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Rosen Penev
a5c094b85f
clang-tidy: use concat namespaces
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Luis Díaz Más
b17828b454
Use SPDX for licenses ( #2122 )
...
* Use SPDX identifier in header files
* Use SPDX identifier in rest of source files
* Fix usage of SPDX for files with 2 licenses
* Add global license file
* Fix compilation
3 years ago
Luis Díaz Más
f6b17d2a4d
Fix issues found by fuzzer
3 years ago
Luis Díaz Más
b9f9d041ea
Several transformations on DataBuf + migration to size_t
...
- Provide begin/end iterators to DataBuf and simplify code
- Adapt test output after last changes
- Replacing long by size_t in value.hpp
- Use size_t in some Photoshop functions
- Remove some static_casts
3 years ago
Luis Díaz Más
5d627433fc
Remove useless DataBuf::clear()
3 years ago
Luis Díaz Más
c5a9dfd9af
Merge pull request #2109 from Exiv2/main_StringView
...
Refactoring & cleanup
3 years ago