Commit Graph

87 Commits

Author SHA1 Message Date
Rosen Penev
513b0e8bbd constexpr some constructors
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-03-22 06:11:10 -07:00
Rosen Penev
0aed79ff57 remove several constructors
Just direct initialize

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-03-22 06:11:10 -07:00
Rosen Penev
024e026bbb clang: small fixes
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-03-22 06:11:10 -07:00
Rosen Penev
22b12012a6 more SonarLint cleanups
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-03-20 08:01:22 -07:00
Kevin Backhouse
5d11208aa0
Minor refactorings to stop UBSAN from complaining. 2023-03-18 17:26:00 +00:00
Rosen Penev
b9d94e61fe coverity: remove dead code
Found with: CID 1521533
Unsigned compared against 0 (NO_EFFECT)

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-02-27 07:05:08 -08:00
Rosen Penev
e7977554e2 default initializations
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-02-05 22:38:09 -08:00
Rosen Penev
0d353ac5f3 work around windows.h min/max macros
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-02-03 23:27:11 -08:00
Rosen Penev
aefd901bef fix copy constructors
clang-tidy couldn't transform these because of missing members

Found with cppcheck.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-01-26 22:44:43 -08:00
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>
2023-01-03 01:24:04 -08:00
Kevin Backhouse
abd817d181 Use size_t for sizes and offsets. 2022-10-31 03:00:47 -07:00
Rosen Penev
84f566b4b7 use reference to work around MSVC bug
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-09-25 14:50:53 -07:00
Kevin Backhouse
e831219d5c Correct error from #2301 2022-08-03 20:00:20 -07:00
Rosen Penev
e74feff4d8 strcmp to == conversions
Does the same thing.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-08-03 01:36:19 -07:00
Kevin Backhouse
ee5dae4ddd Fix implicit cast warning. 2022-08-01 16:28:36 -07:00
Rosen Penev
1d0530f04d misc sonarlint changes
Mostly const changes.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-07-31 20:51:12 -07:00
Kevin Backhouse
8ba9003f19 Fix clang-tidy warning about double move. 2022-07-31 16:00:17 -07:00
Kevin Backhouse
39239cef68
Merge pull request #2296 from kevinbackhouse/tiff-offset-size_t
Use size_t for the offset argument in TiffComponent
2022-07-30 17:23:57 +01:00
Kevin Backhouse
89040ad1de
Fix implicit type conversions. 2022-07-28 22:46:17 -04:00
Kevin Backhouse
d8bd05f4e8
Use size_t 2022-07-27 22:54:41 -04:00
Kevin Backhouse
30debd2635
Use size_t for the offset. 2022-07-27 17:26:18 -04:00
Rosen Penev
b793409eb6 find_if and lambda conversions
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-07-24 16:34:00 -07:00
Kevin Backhouse
3ef783e02a
Convert IfdId and SectionId to enum classes. 2022-07-11 22:37:52 +01:00
Rosen Penev
bae7da19ca clang-tidy: use default member init
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-07-03 12:24:41 -07:00
Rosen Penev
cf963e9e4d clang-tidy: C casts to C++
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-05-21 17:58:10 -07:00
Luis Díaz Más
c9bdd6ed94
Merge pull request #2209 from Exiv2/mainTODOs
Improvements around TODO comments
2022-04-29 09:04:46 +02:00
Rosen Penev
65c5b772c9 fix misplaced const
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-18 14:23:58 -07:00
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>
2022-04-18 13:53:13 -07:00
Luis Díaz Más
c3d0100d48 Fixing bad usages of DataBuf (when it is empty) 2022-04-14 10:40:58 +02:00
Rosen Penev
0d971e98e4 remove some unique_ptrs
They're not really used as pointers.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-10 01:40:34 -07:00
Rosen Penev
fdfcde5e4b structured binding conversions
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-09 10:49:02 +02:00
Rosen Penev
b72e4b0e44 clang-tidy: use auto
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-01 16:37:51 -07:00
Luis Díaz Más
d7f35e33f0 Remove useless static_casts 2022-03-25 08:43:37 +01:00
Luis Díaz Más
b05573fadc Remove most of the asserts from codebase 2022-03-23 16:55:18 +01:00
Luis Díaz Más
30bf563f4d Update .clang-format file & apply clang-format to whole project 2022-03-16 22:30:53 +01:00
Luis Diaz
4355d635d4 More conversions to size_t while removing static_casts 2022-03-14 11:55:10 +01:00
Luis Diaz
7576a2757b More size_t for sizes 2022-03-14 11:50:42 +01:00
Luis Diaz
62aad98d0b Change Metadatum::copy return value from long to size_t 2022-03-14 11:47:15 +01:00
Luis Díaz Más
96f7f2e4c5 Convert Exiv2::ErrorCode into an enum class 2022-03-12 16:58:40 +01:00
Luis Díaz Más
c115d4daf7
Merge pull request #2131 from Exiv2/mainCleanups
Include what you use + more SPDX identifiers + few other cleanups
2022-03-11 21:02:45 +01:00
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>
2022-03-09 17:12:29 -08:00
Luis Díaz Más
f894ee0568 Fix debug builds 2022-03-08 10:13:22 +01:00
Rosen Penev
c2bcd4b08e replace EXV_COUNTOF with std::size
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-08 00:26:33 -08:00
Luis Díaz Más
5508e6f466 hexdump to size_t 2022-03-07 22:25:51 +01:00
Luis Díaz Más
8b1fe379a1 Removing unused headers thanks to IWYU 2022-03-07 22:25:47 +01:00
Rosen Penev
daf7c890e2 misc stuff
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-06 01:17:12 -08:00
Rosen Penev
6d1fa2ecea clang-tidy: use empty() instead of size()
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-05 16:21:26 -08:00
Rosen Penev
5833101b9b manual nullptr conversions
Mostly not caught because I'm not running clang-tidy on Windows.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-05 16:21:25 -08:00
Rosen Penev
04bacdedd6 clang-tidy: use auto
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-04 15:54:05 -08:00
Rosen Penev
a5c094b85f clang-tidy: use concat namespaces
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-04 15:54:05 -08:00