Commit Graph

110 Commits

Author SHA1 Message Date
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
Rosen Penev
b8304fffa4 clang-tidy: don't use C casts
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-08 19:22:46 -08:00
Luis Díaz Más
2834fa5f05 Use [[maybe_unused]] 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
04bacdedd6 clang-tidy: use auto
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
208ec70df8 Fix windows builds 2022-02-27 13:48:21 +01:00
Luis Díaz Más
12738214f2 Fix warnings and place return statements separated from if 2022-02-27 11:57:53 +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
c5a9dfd9af
Merge pull request #2109 from Exiv2/main_StringView
Refactoring & cleanup
2022-02-21 22:29:43 +01:00
Luis Díaz Más
76f01fd4d3 Clean more header inclusions 2022-02-18 22:48:01 +01:00
Luis Díaz Más
ea201ce613 Remove dead code 2022-02-18 18:01:02 +01:00
Kevin Backhouse
256365830a
Replace Metadatum::toLong() with Metadatum::toInt64(). 2022-02-18 12:30:33 +00:00
Luis Díaz Más
db4b63937e Add some TODO comments 2022-02-05 11:02:03 +01:00
Kevin Backhouse
bb9ff53ebe
Throw an exception on integer overflow. 2021-09-13 21:43:59 +01: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
Kevin Backhouse
69d82ffe01
Defensive coding changes to avoid integer overflow in loop conditions. 2021-07-18 15:02:35 +01:00
Kevin Backhouse
c2b52119d4 Check that findKey didn't return end(). 2021-07-05 22:26:09 +02:00
Kevin Backhouse
2b84f4bd64
fix: zero initialize local variables. (#1743)
* Zero initialize local variables.

* Initialize xmpID_
2021-06-27 08:56:31 +02:00
Kevin Backhouse
3e099da7b7 Remove obsolete snprintf macros. 2021-06-22 18:25:52 +02: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
Rosen Penev
2c57f214c5 clang-tidy: use nullptr
Found with modernize-use-nullptr

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-26 08:31:45 +02:00
Rosen Penev
a74bceacb0 clang-tidy: remove pointless return
Found with readability-redundant-control-flow

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-19 23:07:45 -07:00
Rosen Penev
b8712188bb clang-tidy: use auto
Found with modernize-use-auto

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-17 21:52:03 +02:00
Rosen Penev
fdf9d3799c clang-tidy: don't use else after return
Found with llvm-else-after-return

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-15 17:32:56 +02:00
Rosen Penev
1b9b77c51f clang-tidy: add ending namespace comments
Found with google-readability-namespace-comments

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-14 17:34:09 +02:00
Rosen Penev
80595f8468 clang-tidy: remove duplicate public
Found with readability-redundant-access-specifiers

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-13 11:52:02 +02:00
Rosen Penev
bd6a996181 clang-tidy: use using
Found with modernize-use-using

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-09 17:42:51 +02:00
Rosen Penev
4ceb325c8f clang-tidy: range for loop conversions
Found with modernize-loop-convert

Ran through git clang-format.

Also removed several questionable loops and replaced with simpler
algorithms.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-03 14:50:04 +02:00
Luis Díaz Más
f85f7f717a Replace many of the iterators types with auto 2021-04-19 10:43:46 +02:00
Robin Mills
d632988bbd Massive code prolog cleanup. 2021-03-17 13:34:21 +00:00
Luis Díaz Más
113136e134 Replace DEBUG with EXIV2_DEBUG_MESSAGES
Fixes #926
2019-07-12 11:14:35 +02:00
Luis Diaz Mas
6f8d8e3da6 cleanup header inclusions in API 2019-01-11 15:55:25 +01:00
Luis Díaz Más
ab35759de8 Fix cppcheck issues: unreachableCode 2018-10-11 13:40:03 +02:00
Luis Díaz Más
b118192f94 Fix cppcheck issues: redundantAssignment 2018-10-11 13:40:03 +02:00
Luis Díaz Más
603692a1d8 Copyright to Exiv2 authors 2018-09-12 19:22:31 +02:00
Luis Díaz Más
4161099b91 Fix warnings reported by MSVC 2018-09-10 10:31:00 +02:00
Luis Díaz Más
6a203c70c0 Include missing unused.h header in convert.cpp 2018-07-09 22:17:47 +02:00
Luis Diaz Mas
773bdfd14e Create a header where to keep an unique definition of UNUSED 2018-05-31 14:44:24 +02:00
Dan Čermák
316548d2de Fix shadowing issues
- renamed variables that were shadowing a previously defined variables
2018-05-16 10:15:53 +02:00
Dan Čermák
bc58752d18 Remove useless casts
This commit removes only casts where type A is cast to the exactly same
type (and not to a platform dependent typedefs)
2018-05-16 10:15:53 +02:00
tbeu
5b5987a596 Remove obsolete EXIV2_RCSID 2017-11-19 11:17:12 +01:00
tbeu
5df8b01b77 Remove obsolete svn revision 2017-11-19 11:17:11 +01:00
tbeu
d7297a2c2c Pass argument as constant reference 2017-11-04 21:01:33 +01:00
clanmills
573b2cfcd2 XMPsdk fixes. 2013 and 2016 build and (mostly) pass the test suite. 2017-08-22 14:34:01 +01:00
clanmills
95c5e92365 Support for Adobe XMPsdk 2013. Build xmpsdk using Adobe scripts. 2017-08-22 09:30:41 +01:00
clanmills
935421c855 Refactoring autotools to support ADOBE_XMPSDK (Work in Progress) 2017-08-15 20:00:09 +01:00
Robin Mills
559ace375b #1291 Reverting change in r4763 relating to windows.h as they break the Cygwin build. Retain changes in exiv2/exiv2.hpp and exv_msvc.h 2017-04-23 19:29:19 +00:00