Rosen Penev
6fd143d6a4
sonarlint cleanups
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-04-12 09:01:53 -07:00
Rosen Penev
9322f137aa
don't compile WIN32 stuff when iconv is present
...
MinGW has iconv, so this block of code can go away.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-04-04 06:58:23 -07:00
Rosen Penev
357d970425
get rid of EXV_CALL_MEMBER_FN
...
std::invoke can be used.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-03-25 08:03:39 -07:00
Rosen Penev
9ae339d39f
clang: fix various documentation errors
...
Found with -Wdocumentation
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
Rosen Penev
725875497b
SonarLint cleanups
2023-03-03 19:35:42 -08:00
Rosen Penev
2ddf00e7a2
use EXV_ICONV_CONST
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-02-07 08:47:56 -08:00
Rosen Penev
b8d4b9c6ea
remove manual math
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-02-03 07:21:13 -08:00
Rosen Penev
7fd7ee62a3
std::find to find template
...
std::find in C++20 can use ranges, which is equivalent here. Less error
prone.
Namespace is properly to avoid any conflicts with std::find or others
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-01-27 07:47:18 -08:00
Rosen Penev
6976aab5bd
replace substr with resize/pop_back
...
Shorter and more efficient.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-01-26 22:44:43 -08:00
Rosen Penev
bb311ba728
clang-tidy on Windows
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-01-04 01:40:27 -08:00
Rosen Penev
d458bf2540
clang-tidy: apply to newly merged stuff
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-01-03 01:24:04 -08:00
Peter
1f364be1fa
Fix seg fault when using iconv_open() ( #2403 )
...
* Fix seg fault when using `iconv_open()`
- Fix failure condition for `iconv_open()`
- Add new exception when failing to change the text encoding of an
Exif comment
* Add testing for `iconv_open()` seg fault bug
* Fix Python test by changing log level
2022-11-01 13:33:36 +00:00
Kevin Backhouse
abd817d181
Use size_t for sizes and offsets.
2022-10-31 03:00:47 -07:00
Rosen Penev
d856ca7d82
cland-tidy: simplify booleans
...
Found with readability-simplify-boolean-expr
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-09-27 06:40:37 -07:00
Rosen Penev
71dc04ebb1
misc sonarlint stuff
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-08-22 23:00:32 -07:00
Rosen Penev
b6c2062fae
std::to_string conversions
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-08-17 02:25:10 -07:00
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>
2022-08-08 19:24:47 -07:00
Rosen Penev
5c90684441
simplify some defines
...
As far as I can tell, _WIN32 is defined for true Windows platforms.
Cygwin is a POSIX platform.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-08-08 15:31:05 -07:00
Rosen Penev
f3b572d211
fix iconv handling and windows
...
WIN32 as a define is wrong. _WIN32 is the correct one.
Which opens up the issue of the used functions and the wrong logic.
Changed the function logic to use if and elif, as done later in the
code.
Also changed all usages of WIN32 with _WIN32
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-08-08 15:31:05 -07:00
Rosen Penev
e41dd1d227
remove pointless UNUSED statement
...
Does not compile as it is no longer present.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-08-08 15:31:05 -07:00
Rosen Penev
2b8ca5a9d7
fix compilation with mingw iconv
...
The parameter there is const. Use the appropriate macro.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-08-08 15:31:05 -07:00
Kevin Backhouse
97e58a4573
Merge pull request #2267 from neheb/clang
...
mostly clang-tidy fixes
2022-07-09 21:50:50 +01:00
Kevin Backhouse
7f673c766d
Fix some "signed shift" warnings
2022-07-06 22:22:30 +01:00
Rosen Penev
5be42f132c
try to fix some fanalyzer warnings
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-07-05 17:41:12 -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
Rosen Penev
fdfcde5e4b
structured binding conversions
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-09 10:49:02 +02:00
Rosen Penev
e82be13b73
C to std::function
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-01 17:38:06 -07:00
Rosen Penev
dfb93dd8cd
clang-tidy: use C++ headers
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-01 16:38:04 -07:00
Rosen Penev
9f67620503
clang-tidy: add more nodiscard
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-01 16:38:03 -07: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
Rosen Penev
b2b6d834ba
some std::array conversions ( #2148 )
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-15 10:17:06 +01:00
Luis Diaz
7576a2757b
More size_t for sizes
2022-03-14 11:50:42 +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
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