storage/State: add noexcept

This commit is contained in:
Max Kellermann 2022-11-17 05:18:35 +01:00
parent 9467df526c
commit a5d04be21f
2 changed files with 8 additions and 5 deletions

View File

@ -73,7 +73,8 @@ storage_state_save(BufferedOutputStream &os, const Instance &instance)
}
bool
storage_state_restore(const char *line, LineReader &file, Instance &instance)
storage_state_restore(const char *line, LineReader &file,
Instance &instance) noexcept
{
if (!StringStartsWith(line, MOUNT_STATE_BEGIN))
return false;
@ -144,7 +145,7 @@ storage_state_restore(const char *line, LineReader &file, Instance &instance)
}
unsigned
storage_state_get_hash(const Instance &instance)
storage_state_get_hash(const Instance &instance) noexcept
{
if (instance.storage == nullptr)
return 0;

View File

@ -30,18 +30,20 @@ class BufferedOutputStream;
class LineReader;
void
storage_state_save(BufferedOutputStream &os, const Instance &instance);
storage_state_save(BufferedOutputStream &os,
const Instance &instance);
bool
storage_state_restore(const char *line, LineReader &file,
Instance &instance);
Instance &instance) noexcept;
/**
* Generates a hash number for the current state of the composite storage.
* This is used by timer_save_state_file() to determine whether the state
* has changed and the state file should be saved.
*/
[[gnu::pure]]
unsigned
storage_state_get_hash(const Instance &instance);
storage_state_get_hash(const Instance &instance) noexcept;
#endif