Permission: add noexcept

This commit is contained in:
Max Kellermann 2019-04-03 21:42:31 +02:00
parent 3f05b7d8b4
commit 8499a662ea
2 changed files with 7 additions and 4 deletions

View File

@ -131,7 +131,8 @@ initPermissions(const ConfigData &config)
#endif
}
int getPermissionFromPassword(char const* password, unsigned* permission)
int
getPermissionFromPassword(const char *password, unsigned *permission) noexcept
{
auto i = permission_passwords.find(password);
if (i == permission_passwords.end())
@ -141,7 +142,8 @@ int getPermissionFromPassword(char const* password, unsigned* permission)
return 0;
}
unsigned getDefaultPermissions(void)
unsigned
getDefaultPermissions() noexcept
{
return permission_default;
}

View File

@ -30,10 +30,11 @@ static constexpr unsigned PERMISSION_ADD = 2;
static constexpr unsigned PERMISSION_CONTROL = 4;
static constexpr unsigned PERMISSION_ADMIN = 8;
int getPermissionFromPassword(char const* password, unsigned* permission);
int
getPermissionFromPassword(const char *password, unsigned *permission) noexcept;
unsigned
getDefaultPermissions();
getDefaultPermissions() noexcept;
#ifdef HAVE_UN
unsigned