From a5d04be21ff52139a6dca292dd958b5f2b3f3310 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 17 Nov 2022 05:18:35 +0100 Subject: [PATCH] storage/State: add `noexcept` --- src/storage/StorageState.cxx | 5 +++-- src/storage/StorageState.hxx | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/storage/StorageState.cxx b/src/storage/StorageState.cxx index 1c8c155e7..ea408da76 100644 --- a/src/storage/StorageState.cxx +++ b/src/storage/StorageState.cxx @@ -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; diff --git a/src/storage/StorageState.hxx b/src/storage/StorageState.hxx index b131ba078..8e8db77fc 100644 --- a/src/storage/StorageState.hxx +++ b/src/storage/StorageState.hxx @@ -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