Commit Graph

71 Commits

Author SHA1 Message Date
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
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
2022-03-04 11:44:39 +01:00
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
2022-02-27 09:41:47 +01:00
Luis Díaz Más
5d627433fc Remove useless DataBuf::clear() 2022-02-27 09:36:46 +01:00
Kevin Backhouse
2a3dd2def9
Replace Value::toLong with Value::toInt64. (#2062)
* Replace Value::toLong with Value::toInt64.

* Fix compiler warning.

* Fix compile error.

* Fix declaration of canonEv

* Fix compiler warning.

* Fix compiler warning.

* Use int64_t for offsets in tiffcomposite_int.cpp

* Fix compiler warning.

* Fix compiler warnings.

* Fix compiler warning.

* Fix compiler warning.

* Fix compiler warning.

* Fix compiler warning.

* Remove static_cast<long int> in TagDetails initializer.
2022-02-12 21:16:18 +00:00
Luis Díaz Más
0f03e77634 Simplify code around UniquePtr(s) & use make_unique over new 2022-02-05 11:02:04 +01:00
Kevin Backhouse
b6a4fd1c67
Add storage parameter to setData. 2021-12-24 12:54:35 +00:00
Kevin Backhouse
9f3240c91c
Delete TiffEntryBase::isMalloced_ field and use a std::shared_ptr instead. 2021-12-24 12:32:48 +00:00
Kevin Backhouse
9ff72e5ca5
Make offset=0 the default parameter. 2021-08-30 12:41:08 +01:00
Kevin Backhouse
c9d0cf3643
Make fields of DataBuf private. 2021-08-29 15:43:10 +01:00
Rosen Penev
f3fcffd6e6 remove most usages of std::make_pair
Better alternatives exist with C++11.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-08-17 19:11:28 -07:00
Kevin Backhouse
a1b65a7928
Merge pull request #1849 from Exiv2/mergify/bp/main/pr-1848
Replace assertion with an error message (backport #1848)
2021-08-06 13:47:11 +01:00
Kevin Backhouse
9fd8b40a4e Replace assertion with an error message.
(cherry picked from commit cb32b809c80163c2392543dfb830dffe44e47f91)
2021-08-06 12:13:38 +00:00
Kevin Backhouse
9e160a453b
Replace assertion with an error message. 2021-08-05 22:31:41 +01:00
Kevin Backhouse
e34e150f22 Replace assertion with an error message.
(cherry picked from commit 4ec1768415ba015041a9bb28ab17c1ccf6a8c63e)
2021-08-03 21:08:53 +00:00
Kevin Backhouse
69d82ffe01
Defensive coding changes to avoid integer overflow in loop conditions. 2021-07-18 15:02:35 +01:00
Luis Díaz Más
f30022d73d
Fix issues detected with PVS-Studio + other little improvements (#1689)
* avoid re-declaration of constant variables

* Replace pthreads critical section with std::mutex

* ci - better naming

* cmake - increase minimum version to 3.11. Use project DESCRIPTION

* fix - do not treat string::find() return type as bool

* remove conditions that were always true

* remove condition that were always false

* Remove EXV_HAVE_GMTIME_R which is not used anymore

* pixelWidth_ was inherited from Exiv2::Image

The width & height variables in the TiffImage class need to be mutable
to be able to change their values on the getters pixelHeight() and
pixelWidth() ... Do not ask me why ...

* Remove superfluous if

* pvs:V766 item with identical key added already

* pvs:V730 not all members were initialized (time)

* pvs:V730 not all members are initialized

* pvs:v668 no point in testing pointer against null after new

* pvs:V1048 variable assigned the same value

* replace c-style dynamic vector with std one

* pvs:547 fakeData is always true

* Remove useless constructor in derived class

* pvs:V690 modern way to disable copy-ctor

* Replace malloc/free with new/delete. No need to check for null

* pvs:V1028 cast operands and not result

* Remove custom MIN/MAX functions

* pvs:V595 pointer used before verified against null

* pvs: index used before being checked

* pvs:V1028 possible overflow. Cast operands

* pvs:v575 potential null pointer passed to other functions

* pvs:V547 deal with always true/false expressions

* pvs:V560 part of conditional expressions always false or true

* pvs:V701 possible break in realloc -> move to std::vector

* Make some classes 'final'

* Replace sprintf with std::to_string()

* fix compilation on windows
2021-06-01 12:39:10 +02:00