Skip to content

Commit 2cf2c35

Browse files
authored
Small code modernizations (#835)
- Use std::numeric_limits<uid_t>::max() to ensure consistency with gui/gid - Specify partition_id_t as a constexpr
1 parent 37175bf commit 2cf2c35

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

implementation/configuration/include/internal.hpp.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ enum class port_type_e {
190190
};
191191

192192
using partition_id_t = std::uint8_t;
193-
const partition_id_t VSOMEIP_DEFAULT_PARTITION_ID = 0;
193+
inline constexpr partition_id_t VSOMEIP_DEFAULT_PARTITION_ID = 0;
194194

195195
} // namespace vsomeip_v3
196196

test/unit_tests/security_tests/ut_is_client_allowed.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ namespace {
2222

2323
vsomeip_v3::gid_t invalid_uid = 1;
2424
vsomeip_v3::gid_t invalid_gid = 1;
25-
vsomeip_v3::uid_t ANY_UID = 0xFFFFFFFF;
26-
vsomeip_v3::gid_t ANY_GID = 0xFFFFFFFF;
25+
vsomeip_v3::uid_t ANY_UID = std::numeric_limits<uid_t>::max();
26+
vsomeip_v3::gid_t ANY_GID = std::numeric_limits<uid_t>::max();
2727

2828
vsomeip_v3::gid_t deny_uid = 9999;
2929
vsomeip_v3::gid_t deny_gid = 9999;

0 commit comments

Comments
 (0)