Commit Graph

325 Commits

Author SHA1 Message Date
Kevin Backhouse
b13585a697
Fix code scanning alert: "Multiplication result converted to larger type".
9284b58bfc/samples/Jzon.cpp (L61-L61)
2021-07-13 10:11:20 +01:00
Kevin Backhouse
b16cd52b88 Replace sprintf with snprintf. 2021-06-27 10:27:54 +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
Robin Mills
6452a9ce36 Fixing typos. 2021-06-24 17:49:47 +01:00
Robin Mills
739673335c Forgive "SHORT or LONG" tags. Add test code. 2021-06-24 09:49:22 +01:00
Robin Mills
fd2ab89de5 exifprint_lint 2021-06-23 14:24:46 +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
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
86c71ae6c3 clang-tidy: avoid global non const variables
Found with cppcoreguidelines-avoid-non-const-global-variables

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-25 08:43:27 +02:00
Rosen Penev
c7a41230f0 clang-tidy: remove pointless member init
Found with readability-redundant-member-init

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-19 23:32:29 -07:00
Rosen Penev
7179300b7f clang-tidy: use dynamic cast
Found with cppcoreguidelines-pro-type-static-cast-downcast

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-19 23:31:22 -07:00
Rosen Penev
8d501fcf24 clang-tidy: no else after return
Found with readability-else-after-return

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-19 23:09:46 -07:00
Rosen Penev
ceed79c95e Jzon: algorithm conversions
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-20 07:37:00 +02:00
Rosen Penev
4d2bc3c752 some range loop conversions
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-20 07:37:00 +02:00
Rosen Penev
743da1a564 clang-tidy: use C++ casting
Found with google-readability-casting

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-20 07:29:02 +02:00
Rosen Penev
8dbc699858 clang-tidy: add missing explicit
Found with google-explicit-constructor

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-19 16:48:44 +02:00
Rosen Penev
ff39473c18 clang-tidy: convert to static
Found with readability-convert-member-functions-to-static

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-19 14:45:20 +02:00
Rosen Penev
6da49fd29b more constexpr
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-19 14:11:42 +02:00
Rosen Penev
cdbee3c26c clang-tidy: init in member initializer
Found with cppcoreguidelines-prefer-member-initializer

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-19 14:11:42 +02:00
Rosen Penev
8564d0b394 clang-tidy: pass by value
Found with modernize-pass-by-value

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-18 14:30:08 +02:00
Rosen Penev
f9d394adf0 clang-tidy: run through performance checks
Found with performance*

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-18 14:30:08 +02: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
8e52032ee0 clang-tidy: range loop conversions
Found with: modernize-loop-convert

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-17 08:53:39 +02:00
Rosen Penev
c73dfa0106 clang-tidy: use uppercase numeric literals
Found with readability-uppercase-literal-suffix

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-16 11:27:49 +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
Luis Diaz Mas
e87424b5e0 Add CTest support 2021-05-15 16:58:24 +02:00
Rosen Penev
4aa5566cf6 clang-tidy: make several member functions const
Found with readability-make-member-function-const

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-15 08:42:04 +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
fddb035106 clang-tidy: remove pointless const
Found with readability-avoid-const-params-in-decls

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-13 16:02:18 +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
5d716c7df4 clang-tidy: empty() conversions
Found with readability-container-size-empty

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-12 07:12:15 +02:00
Rosen Penev
9642e3cceb clang-tidy: remove pointless string init
Found with readability-redundant-string-init

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-12 07:12:15 +02:00
Rosen Penev
143a1fbbe2 clang-tidy: don't use string compare
Found with readability-string-compare

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-12 07:12:15 +02:00
Rosen Penev
8337462032 clang-tidy: use empty() instead of comparing size
Found with readability-container-size-empty

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-11 22:02:47 +02:00
Rosen Penev
af7b2430c5 clang-tidy: use override
Found with modernize-use-override

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-11 17:39:59 +02:00
Rosen Penev
15f0a600ed clang-tidy: use default member init
Found with modernize-use-default-member-init

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-11 15:01:26 +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
b3040da54c clang-tidy: don't check for NULL with delete
Found with readability-delete-null-pointer

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-09 17:42:26 +02:00
Rosen Penev
1dc1186760 clang-tidy: simplify boolean expressions
Found with readability-simplify-boolean-expr

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-09 17:30:46 +02:00
Rosen Penev
8128716287 clang-tidy: use = default
Found with modernize-use-equals-default

Ran through git clang-format

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-09 15:18:50 +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
Rosen Penev
5a4c3cd057 convert Pair to std::pair
This is C++11 now.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-03 07:16:51 +02:00
Luis Díaz Más
582edd399c cmake: ignore PDBs warnings on Win/Debug/Static buils 2021-05-03 06:40:02 +02:00
Rosen Penev
84220855b2 clang-tidy: use = delete
Found with modernize-use-equals-delete

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-03 06:34:47 +02:00
Luis Díaz Más
53f18cf408 conan: use cmake_paths generator instead of cmake
We also upgraded the xcode version on Travis-CI
2021-04-23 14:53:08 +02:00
Luis Díaz Más
f601d23d5e conan: update conan recipe versions 2021-04-23 14:53:08 +02:00
Luis Díaz Más
c33c6abc82 Remove useless explicit constructor 2021-04-22 18:40:03 +02:00
Luis Díaz Más
f85f7f717a Replace many of the iterators types with auto 2021-04-19 10:43:46 +02:00
Luis Díaz Más
75e4bd9059 Remove rest of useless typedefs from datasets.hpp 2021-04-19 10:43:46 +02:00
Luis Díaz Más
83dda6ccd7 Fix warnings related to -Wdeprecated-copy 2021-04-18 18:49:58 +02:00