mirror of
https://github.com/arun11299/cpp-jwt.git
synced 2025-05-16 17:58:32 +00:00
Fixed many warnings that appear due to assert not being executed in
release mode.
This commit is contained in:
parent
9ff6e50b5e
commit
00343347b2
4 changed files with 13 additions and 9 deletions
include/jwt
|
@ -211,6 +211,7 @@ enum class algorithm
|
|||
ES256,
|
||||
ES384,
|
||||
ES512,
|
||||
UNKN,
|
||||
TERM,
|
||||
};
|
||||
|
||||
|
@ -233,9 +234,10 @@ inline jwt::string_view alg_to_str(enum algorithm alg) noexcept
|
|||
case algorithm::ES512: return "ES512";
|
||||
case algorithm::TERM: return "TERM";
|
||||
case algorithm::NONE: return "NONE";
|
||||
case algorithm::UNKN: return "UNKN";
|
||||
default: assert (0 && "Unknown Algorithm");
|
||||
};
|
||||
|
||||
return "UNKN";
|
||||
assert (0 && "Code not reached");
|
||||
}
|
||||
|
||||
|
@ -258,6 +260,8 @@ inline enum algorithm str_to_alg(const jwt::string_view alg) noexcept
|
|||
if (!strcasecmp(alg.data(), "es384")) return algorithm::ES384;
|
||||
if (!strcasecmp(alg.data(), "es512")) return algorithm::ES512;
|
||||
|
||||
return algorithm::UNKN;
|
||||
|
||||
assert (0 && "Code not reached");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue