diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-05-02 09:01:34 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-05-02 13:21:40 +0200 |
commit | b26ff81a6f8f5ad99bba153cf57bef68fd03930d (patch) | |
tree | 70411312f58b1ad6a0c0d3cc72ecaea417233a25 | |
parent | tdf#99528 Use vertical tabs in character style dialog (diff) | |
download | core-b26ff81a6f8f5ad99bba153cf57bef68fd03930d.tar.gz core-b26ff81a6f8f5ad99bba153cf57bef68fd03930d.zip |
use [[noreturn]] instead of asserts that badUsage exits
Change-Id: I927434290b02b6cc0386b1e0038cd8385a762249
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166996
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
-rw-r--r-- | static/source/embindmaker/embindmaker.cxx | 2 | ||||
-rw-r--r-- | unoidl/source/unoidl-check.cxx | 3 | ||||
-rw-r--r-- | unoidl/source/unoidl-read.cxx | 2 | ||||
-rw-r--r-- | unoidl/source/unoidl-write.cxx | 3 |
4 files changed, 4 insertions, 6 deletions
diff --git a/static/source/embindmaker/embindmaker.cxx b/static/source/embindmaker/embindmaker.cxx index 0b7634cf8409..b696a09c6127 100644 --- a/static/source/embindmaker/embindmaker.cxx +++ b/static/source/embindmaker/embindmaker.cxx @@ -43,7 +43,7 @@ namespace { -void badUsage() +[[noreturn]] void badUsage() { std::cerr << "Usage:\n\n" diff --git a/unoidl/source/unoidl-check.cxx b/unoidl/source/unoidl-check.cxx index b2d57766f968..e836befbae13 100644 --- a/unoidl/source/unoidl-check.cxx +++ b/unoidl/source/unoidl-check.cxx @@ -72,7 +72,7 @@ static bool operator ==( namespace { -void badUsage() { +[[noreturn]] void badUsage() { std::cerr << "Usage:" << std::endl << std::endl << (" unoidl-check [--ignore-unpublished] [<extra registries A>]" @@ -106,7 +106,6 @@ bool getArgument( if (delimiter == nullptr) { badUsage(); } - assert(delimiter && "badUsage exits otherwise"); *delimiter = true; return false; } diff --git a/unoidl/source/unoidl-read.cxx b/unoidl/source/unoidl-read.cxx index 721fdabe9c8b..80d26a68c318 100644 --- a/unoidl/source/unoidl-read.cxx +++ b/unoidl/source/unoidl-read.cxx @@ -30,7 +30,7 @@ namespace { -void badUsage() { +[[noreturn]] void badUsage() { std::cerr << "Usage:" << std::endl << std::endl << " unoidl-read [--published] [--summary] [<extra registries>] <registry>" diff --git a/unoidl/source/unoidl-write.cxx b/unoidl/source/unoidl-write.cxx index e04fa16473a5..6505e5468e67 100644 --- a/unoidl/source/unoidl-write.cxx +++ b/unoidl/source/unoidl-write.cxx @@ -35,7 +35,7 @@ namespace { -void badUsage() { +[[noreturn]] void badUsage() { std::cerr << "Usage:" << std::endl << std::endl << " unoidl-write [<registries>] [@<entities file>] <unoidl file>" @@ -62,7 +62,6 @@ OUString getArgumentUri(sal_uInt32 argument, bool * entities) { if (entities == nullptr) { badUsage(); } - assert(entities && "badUsage exits otherwise"); *entities = true; } else if (entities != nullptr) { *entities = false; |