* This matches an alias target name
* Recommend using the namespaced target in the README
Signed-off-by: Ryan Friedman <ryan.friedman+github@avinc.com>
c == 0 was a dead branch because of the way printable ascii was
calculated. Move it up instead.
While at it, replace std::transform with std::replace. Easier to read.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
GCC is able to see that the branch is useless as it can be done at
compile time. Produces shorter assembly with both -O2 and -O3.
Assign the pointer to the std::string directly and use proper iterators
with std::transform. Also produces shorter assembly.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
The actual values of errno constants are not specified in POSIX, and
left as implementation details; hence, tweak the check for the ENOENT
description to not check for the actual value.
Setting the initial parts (data1_, data2_, data3_) from the bytes
directly using memcpy() means that they will be interpreted depending
on the platform endianness. For example, the initial 4 bytes of the ASF
header are 0x30, 0x26, 0xB2, 0x75, which will be read as 0x3026B275 on
big endian platforms, never matching the actual GUID (0x75B22630), which
is always specified in little endian format.
Hence, when reading a GUID from data, make sure to turn the GUID parts
to little endian. This fixes the reading of ASF files on big endian
platforms.
Fixes commit bed8d3d93c
GCC is able to see that the branch is useless as it can be done at
compile time. Produces shorter assembly with both -O2 and -O3.
https://godbolt.org/z/ejhfxh8Tx
Signed-off-by: Rosen Penev <rosenp@gmail.com>
More readable anyway.
Also remove specific version. Problems have been fixed already. All
versions should work the same now.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Stricter compiler/settings, such as found during a build
on FreeBSD with clang 14, issue warnings of the kind below.
/usr/local/include/exiv2/value.hpp:1272:31: warning: '_MSVC_LANG' is not defined, evaluates to 0 [-Wundef]
Fix: Guard use of _MSVC_LANG by a check.
Personally, I found that MSVC has several feature-specific
checks in predefined macros which might allow for one
standards-based check that matches GCC/clang/MSVC rather than the
split check for C++ standard and MSVC language version settings.
See https://en.cppreference.com/w/cpp/feature_test
I am not building Exiv2 on MSVC, so I cannot test/suggest
anything here.
FreeBSD's getLoadedLibraries() uses libprocstat(3) to obtain
the list of mapped files (libraries). However, the list
obtained from procstat_getfiles() does not only return regular files,
but might also return anonymous objects that have no fs->path.
With exiv2 v0.28, I had also observed crashes with a real TTY,
and the entry->fs_path dereference would crash, even if it
was only for a test "non-null", so we need something more thorough.
Add a check to only consider VNODEs (actual file system entries),
and also make sure that entry->fs_path is defined so we don't
pass a nullptr to the std::string(const char *) constructor when
we are reading corrupt data. std::string((const char *)0)
on FreeBSD 13.2 - calls strlen() and crashes there.