aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-05-19 16:53:52 +0200
committerSven Göthel <[email protected]>2024-05-19 16:53:52 +0200
commita9e607e726376b5d0b93192a424ed345907245b7 (patch)
tree5a2f3e351bf4ffd15a599600957e30586914697c
parent95af1dac50e3cbbebd070bad44adb59f3a7fd144 (diff)
cleanup C++20: Adjust enum values (Use 1U << x for unsigned values; reduce type size)
-rw-r--r--include/jau/byte_stream.hpp10
-rw-r--r--include/jau/file_util.hpp14
-rw-r--r--include/jau/functional.hpp2
3 files changed, 13 insertions, 13 deletions
diff --git a/include/jau/byte_stream.hpp b/include/jau/byte_stream.hpp
index d65e5f7..0bd2575 100644
--- a/include/jau/byte_stream.hpp
+++ b/include/jau/byte_stream.hpp
@@ -45,7 +45,7 @@ namespace jau::io {
* @{
*/
- /**
+ /*
* Mimic std::ios_base::iostate for state functionality, see iostate_func.
*
* This `enum class` type fulfills `C++ named requirements: BitmaskType`.
@@ -58,16 +58,16 @@ namespace jau::io {
goodbit = 0,
/** Irrecoverable stream error, including loss of integrity of the underlying stream or media. */
- badbit = 1 << 0,
+ badbit = 1U << 0,
/** An input operation reached the end of its stream. */
- eofbit = 1 << 1,
+ eofbit = 1U << 1,
/** Input or output operation failed (formatting or extraction error). */
- failbit = 1 << 2,
+ failbit = 1U << 2,
/** Input or output operation failed due to timeout. */
- timeout = 1 << 3
+ timeout = 1U << 3
};
constexpr uint32_t number(const iostate rhs) noexcept {
return static_cast<uint32_t>(rhs);
diff --git a/include/jau/file_util.hpp b/include/jau/file_util.hpp
index 3ed96a1..f67d229 100644
--- a/include/jau/file_util.hpp
+++ b/include/jau/file_util.hpp
@@ -881,25 +881,25 @@ namespace jau::fs {
none = 0,
/** Traverse through directories, i.e. perform visit, copy, remove etc actions recursively throughout the directory structure. */
- recursive = 1 << 0,
+ recursive = 1U << 0,
/** Traverse through symbolic linked directories if traverse_options::recursive is set, i.e. directories with property fmode_t::link set. */
- follow_symlinks = 1 << 1,
+ follow_symlinks = 1U << 1,
/** Traverse through elements in lexicographical order. This might be required when computing an order dependent outcome like a hash value. */
- lexicographical_order = 1 << 2,
+ lexicographical_order = 1U << 2,
/** Call path_visitor at directory entry, allowing path_visitor to skip traversal of this directory if returning false. */
- dir_check_entry = 1 << 7,
+ dir_check_entry = 1U << 7,
/** Call path_visitor at directory entry. Both, dir_entry and dir_exit can be set, only one or none. */
- dir_entry = 1 << 8,
+ dir_entry = 1U << 8,
/** Call path_visitor at directory exit. Both, dir_entry and dir_exit can be set, only one or none. */
- dir_exit = 1 << 9,
+ dir_exit = 1U << 9,
/** Enable verbosity mode, potentially used by a path_visitor implementation like remove(). */
- verbose = 1 << 15
+ verbose = 1U << 15
};
constexpr uint16_t number(const traverse_options rhs) noexcept {
return static_cast<uint16_t>(rhs);
diff --git a/include/jau/functional.hpp b/include/jau/functional.hpp
index b88b04c..70cca2b 100644
--- a/include/jau/functional.hpp
+++ b/include/jau/functional.hpp
@@ -338,7 +338,7 @@ namespace jau {
*
* @see @ref function_overview "Function Overview"
*/
- enum class target_type : uint32_t {
+ enum class target_type : uint16_t {
/** Denotes a func::null_target_t */
null = 0,
/** Denotes a func::member_target_t */