From 73523c041c8a708e182ed2c5a0adbb10e9cdc661 Mon Sep 17 00:00:00 2001 From: Slava Monich Date: Mon, 1 Nov 2021 01:33:32 +0200 Subject: [PATCH] [fbreader] Fixed a few compilation warnings --- .../fbreader/src/formats/oeb/OCFContainerReader.cpp | 4 ++-- .../zlibrary/text/src/hyphenation/ZLTextHyphenator.h | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/fbreader/fbreader/fbreader/src/formats/oeb/OCFContainerReader.cpp b/fbreader/fbreader/fbreader/src/formats/oeb/OCFContainerReader.cpp index abfb1ac..970b57b 100644 --- a/fbreader/fbreader/fbreader/src/formats/oeb/OCFContainerReader.cpp +++ b/fbreader/fbreader/fbreader/src/formats/oeb/OCFContainerReader.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 Slava Monich + * Copyright (C) 2015-2021 Slava Monich * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -50,7 +50,7 @@ void OCFContainerReader::startElementHandler(const char *tag, const char **attr) } } } - /* no break */ + /* fallthrough */ default: myStateStack.push(STATE_IGNORE); break; diff --git a/fbreader/fbreader/zlibrary/text/src/hyphenation/ZLTextHyphenator.h b/fbreader/fbreader/zlibrary/text/src/hyphenation/ZLTextHyphenator.h index e8daf35..4cf85c1 100644 --- a/fbreader/fbreader/zlibrary/text/src/hyphenation/ZLTextHyphenator.h +++ b/fbreader/fbreader/zlibrary/text/src/hyphenation/ZLTextHyphenator.h @@ -1,5 +1,6 @@ /* * Copyright (C) 2004-2010 Geometer Plus + * Copyright (C) 2021 Slava Monich * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,11 +31,12 @@ class ZLTextHyphenationInfo { private: ZLTextHyphenationInfo(int length); - const ZLTextHyphenationInfo &operator = (ZLTextHyphenationInfo &info); + const ZLTextHyphenationInfo &operator = (const ZLTextHyphenationInfo &info); public: + ZLTextHyphenationInfo(const ZLTextHyphenationInfo &info) : myMask(info.myMask) { } ~ZLTextHyphenationInfo() {} - bool isHyphenationPossible(size_t position); + bool isHyphenationPossible(size_t position) const; private: std::vector myMask; @@ -70,7 +72,7 @@ protected: inline ZLTextHyphenationInfo::ZLTextHyphenationInfo(int length) : myMask(length - 1, false) { } -inline bool ZLTextHyphenationInfo::isHyphenationPossible(size_t position) { +inline bool ZLTextHyphenationInfo::isHyphenationPossible(size_t position) const { return (position < myMask.size()) && myMask[position]; }