Skip to content
Snippets Groups Projects
Verified Commit c0f32448 authored by Tomas Krizek's avatar Tomas Krizek
Browse files

lib/resolve.h: replace asserts

parent 8ade1738
No related branches found
No related tags found
1 merge request!1146lib/utils: define kr_require(), kr_assume() macros
......@@ -130,8 +130,10 @@ bool kr_rank_test(uint8_t rank, uint8_t kr_flag) KR_PURE KR_EXPORT;
/** Set the rank state. The _AUTH flag is kept as it was. */
static inline void kr_rank_set(uint8_t *rank, uint8_t kr_flag)
{
assert(rank && kr_rank_check(*rank));
assert(kr_rank_check(kr_flag) && !(kr_flag & KR_RANK_AUTH));
if (!kr_assume(rank && kr_rank_check(*rank)))
return;
if (!kr_assume(kr_rank_check(kr_flag) && !(kr_flag & KR_RANK_AUTH)))
return;
*rank = kr_flag | (*rank & KR_RANK_AUTH);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment