Rosen Penev
e74feff4d8
strcmp to == conversions
...
Does the same thing.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Kevin Backhouse
4410f46214
Change the return type of the 2Data functions to size_t.
3 years ago
Kevin Backhouse
3db7598e29
Don't use long in floatToRationalCast
3 years ago
Rosen Penev
84555f1ad5
clang-tidy: no else after return
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Kevin Backhouse
b3f2ab5988
Fix some "signed shift" warnings.
3 years ago
Rosen Penev
cf963e9e4d
clang-tidy: C casts to C++
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Luis Díaz Más
1a3e93856b
More tests for rational convertions
3 years ago
Luis Díaz Más
8da71e7133
Test parseUint32 and fix it when number is out of limits
3 years ago
Luis Díaz Más
331924612e
Remove duplication by using templates
3 years ago
Luis Díaz Más
2b91b5daf9
More tests for DataBuf read/write functions
3 years ago
Luis Díaz Más
6964f5f9f2
DataBuf::c_data() returns nullptr when empty + avoid duplication
...
After the previous commit, I realized that std::vector::data() also
returns nullptr when the vector is empty. So I decided to emulate this
behavior in DataBuf::c_data().
Anyways, the changes done in the previous commit are valid and allow us
to avoid some processing when the DataBuf is empty.
3 years ago
Luis Díaz Más
4a4a8c544c
Throwing when trying to access TooFar elements in DataBuf
3 years ago
Rosen Penev
fdfcde5e4b
structured binding conversions
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Luis Díaz Más
ae4df71233
Remove DataBuf::copyBytes and use std::copy instead
3 years ago
Luis Díaz Más
b05573fadc
Remove most of the asserts from codebase
3 years ago
Luis Díaz Más
30bf563f4d
Update .clang-format file & apply clang-format to whole project
3 years ago
Rosen Penev
b2b6d834ba
some std::array conversions ( #2148 )
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Luis Diaz
7576a2757b
More size_t for sizes
3 years ago
Luis Díaz Más
c115d4daf7
Merge pull request #2131 from Exiv2/mainCleanups
...
Include what you use + more SPDX identifiers + few other cleanups
3 years ago
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>
3 years ago
Rosen Penev
b6bdbf5574
clang-tidy: don't use else after return/throw
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Luis Díaz Más
b3a216310a
Removing unused headers thanks to IWYU
3 years ago
Luis Díaz Más
2834fa5f05
Use [[maybe_unused]]
3 years ago
Luis Díaz Más
5508e6f466
hexdump to size_t
3 years ago
Rosen Penev
04bacdedd6
clang-tidy: use auto
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
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
3 years ago
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
3 years ago
Luis Díaz Más
5d627433fc
Remove useless DataBuf::clear()
3 years ago
Luis Díaz Más
3a749e6861
No need to define copy & move ctors
3 years ago
Luis Díaz Más
2bacff0f5c
Simplify DataBuf
3 years ago
Luis Díaz Más
f1e04ee866
Replace DataBuf internal buffer with std::vector
3 years ago
Luis Díaz Más
7933ff401d
Remove dead code around EXV_UNICODE_PATH
3 years ago
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.
3 years ago
Luis Díaz Más
524fad42e1
Remove useless ops
3 years ago
Kevin Backhouse
29f7d0ccf0
Remove DataBuf::release() which is no longer used.
4 years ago
Kevin Backhouse
81cfc162c1
Use std::move to transfer ownership of DataBufs.
4 years ago
Kevin Backhouse
9ff72e5ca5
Make offset=0 the default parameter.
4 years ago
Kevin Backhouse
c9d0cf3643
Make fields of DataBuf private.
4 years ago
Rosen Penev
f3fcffd6e6
remove most usages of std::make_pair
...
Better alternatives exist with C++11.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Kevin Backhouse
7c2ab1d7de
Check that the float is within the range of an int before casting.
4 years ago
Kevin Backhouse
dc2c77ce81
Safer std::vector indexing.
4 years ago
Kevin Backhouse
2b84f4bd64
fix: zero initialize local variables. ( #1743 )
...
* Zero initialize local variables.
* Initialize xmpID_
4 years ago
Christoph Hasse
758dd6bbc6
refactor!: remove free() function from DataBuf to avoid potential problems, see #1542
4 years ago
Rosen Penev
2c57f214c5
clang-tidy: use nullptr
...
Found with modernize-use-nullptr
Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev
743da1a564
clang-tidy: use C++ casting
...
Found with google-readability-casting
Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev
b8712188bb
clang-tidy: use auto
...
Found with modernize-use-auto
Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev
c73dfa0106
clang-tidy: use uppercase numeric literals
...
Found with readability-uppercase-literal-suffix
Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
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>
4 years ago
Rosen Penev
1b9b77c51f
clang-tidy: add ending namespace comments
...
Found with google-readability-namespace-comments
Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev
e93ad82734
clang-tidy: use braced init list
...
Found with modernize-return-braced-init-list
Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago