From ff4e7e74e24d88194e01a78f9c5b2649bbcc1a59 Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 27 Mar 2019 08:34:16 +1100 Subject: Replace NULL/0 with nullptr. Mark noexcept where simple. Move some static functions into anonymous namespace. --- gtk/Converter.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'gtk/Converter.h') diff --git a/gtk/Converter.h b/gtk/Converter.h index 0ef80ae23..fa9a101f1 100644 --- a/gtk/Converter.h +++ b/gtk/Converter.h @@ -15,14 +15,14 @@ const gsize sizeFailure = static_cast(-1); */ class Converter { GIConv iconvh; - void OpenHandle(const char *fullDestination, const char *charSetSource) { + void OpenHandle(const char *fullDestination, const char *charSetSource) noexcept { iconvh = g_iconv_open(fullDestination, charSetSource); } - bool Succeeded() const { + bool Succeeded() const noexcept { return iconvh != iconvhBad; } public: - Converter() { + Converter() noexcept { iconvh = iconvhBad; } Converter(const char *charSetDestination, const char *charSetSource, bool transliterations) { @@ -32,7 +32,7 @@ public: ~Converter() { Close(); } - operator bool() const { + operator bool() const noexcept { return Succeeded(); } void Open(const char *charSetDestination, const char *charSetSource, bool transliterations) { @@ -50,13 +50,13 @@ public: } } } - void Close() { + void Close() noexcept { if (Succeeded()) { g_iconv_close(iconvh); iconvh = iconvhBad; } } - gsize Convert(char** src, gsize *srcleft, char **dst, gsize *dstleft) const { + gsize Convert(char** src, gsize *srcleft, char **dst, gsize *dstleft) const noexcept { if (!Succeeded()) { return sizeFailure; } else { -- cgit v1.2.3