[LyX/master] Fix warnings

Richard Kimberly Heck rikiheck at lyx.org
Sat Feb 29 04:59:58 UTC 2020


commit 9afc001fc518dd639103ffd1e5d22aaa52c117bf
Author: Richard Kimberly Heck <rikiheck at lyx.org>
Date:   Sat Feb 29 00:21:00 2020 -0500

    Fix warnings
---
 src/Floating.cpp    |    4 ++--
 src/Font.cpp        |    2 +-
 src/Format.cpp      |    2 +-
 src/FuncRequest.cpp |   12 ++++++------
 src/IndicesList.cpp |   14 +++++++-------
 src/KeyMap.cpp      |   10 +++++-----
 6 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/src/Floating.cpp b/src/Floating.cpp
index 3f6eb54..3dbc0a9 100644
--- a/src/Floating.cpp
+++ b/src/Floating.cpp
@@ -30,12 +30,12 @@ Floating::Floating(string const & type, string const & placement,
 		   string const & listName, std::string const & listCmd,
 		   string const & refPrefix, std::string const & allowedplacement,
 		   string const & htmlTag, string const & htmlAttrib,
-		   docstring const & htmlStyle, string const & requires, 
+		   docstring const & htmlStyle, string const & required,
 		   bool usesfloat, bool ispredefined,
 		   bool allowswide, bool allowssideways)
 	: floattype_(type), placement_(placement), ext_(ext), within_(within),
 	  style_(style), name_(name), listname_(listName), listcommand_(listCmd),
-	  refprefix_(refPrefix), allowedplacement_(allowedplacement), required_(requires),
+	  refprefix_(refPrefix), allowedplacement_(allowedplacement), required_(required),
 	  usesfloatpkg_(usesfloat), ispredefined_(ispredefined),
 	  allowswide_(allowswide), allowssideways_(allowssideways),
 	  html_tag_(htmlTag), html_attrib_(htmlAttrib), html_style_(htmlStyle)
diff --git a/src/Font.cpp b/src/Font.cpp
index 476ce37..a6580fd 100644
--- a/src/Font.cpp
+++ b/src/Font.cpp
@@ -773,7 +773,7 @@ ostream & operator<<(ostream & os, FontInfo const & f)
 ostream & operator<<(ostream & os, Font const & font)
 {
 	return os << font.bits_
-		<< " lang: " << (font.lang_ ? font.lang_->lang() : 0);
+		<< " lang: " << (font.lang_ ? font.lang_->lang() : nullptr);
 }
 
 
diff --git a/src/Format.cpp b/src/Format.cpp
index a6727a2..d6baa83 100644
--- a/src/Format.cpp
+++ b/src/Format.cpp
@@ -174,7 +174,7 @@ Format const * Formats::getFormat(string const & name) const
 	if (cit != formatlist_.end())
 		return &(*cit);
 	else
-		return 0;
+		return nullptr;
 }
 
 
diff --git a/src/FuncRequest.cpp b/src/FuncRequest.cpp
index a2c975c..2049210 100644
--- a/src/FuncRequest.cpp
+++ b/src/FuncRequest.cpp
@@ -30,40 +30,40 @@ FuncRequest const FuncRequest::unknown(LFUN_UNKNOWN_ACTION);
 FuncRequest const FuncRequest::noaction(LFUN_NOACTION);
 
 FuncRequest::FuncRequest(Origin o)
-	: action_(LFUN_NOACTION), origin_(o), view_origin_(0), x_(0), y_(0),
+	: action_(LFUN_NOACTION), origin_(o), view_origin_(nullptr), x_(0), y_(0),
 	  button_(mouse_button::none), modifier_(NoModifier), allow_async_(true)
 {}
 
 
 FuncRequest::FuncRequest(FuncCode act, Origin o)
-	: action_(act), origin_(o), view_origin_(0), x_(0), y_(0),
+	: action_(act), origin_(o), view_origin_(nullptr), x_(0), y_(0),
 	button_(mouse_button::none), modifier_(NoModifier), allow_async_(true)
 {}
 
 
 FuncRequest::FuncRequest(FuncCode act, docstring const & arg, Origin o)
-	: action_(act), argument_(arg), origin_(o), view_origin_(0), x_(0), y_(0),
+	: action_(act), argument_(arg), origin_(o), view_origin_(nullptr), x_(0), y_(0),
 	  button_(mouse_button::none), modifier_(NoModifier), allow_async_(true)
 {}
 
 
 FuncRequest::FuncRequest(FuncCode act, string const & arg, Origin o)
 	: action_(act), argument_(from_utf8(arg)),
-	  origin_(o), view_origin_(0), x_(0), y_(0),
+	  origin_(o), view_origin_(nullptr), x_(0), y_(0),
 	  button_(mouse_button::none), modifier_(NoModifier), allow_async_(true)
 {}
 
 
 FuncRequest::FuncRequest(FuncCode act, int ax, int ay,
 			 mouse_button::state but, KeyModifier modifier, Origin o)
-	: action_(act), origin_(o), view_origin_(0), x_(ax), y_(ay),
+	: action_(act), origin_(o), view_origin_(nullptr), x_(ax), y_(ay),
 	  button_(but), modifier_(modifier), allow_async_(true)
 {}
 
 
 FuncRequest::FuncRequest(FuncRequest const & cmd, docstring const & arg, Origin o)
 	: action_(cmd.action()), argument_(arg),
-	  origin_(o), view_origin_(0), x_(cmd.x_), y_(cmd.y_),
+	  origin_(o), view_origin_(nullptr), x_(cmd.x_), y_(cmd.y_),
 	  button_(cmd.button_), modifier_(NoModifier), allow_async_(true)
 {}
 
diff --git a/src/IndicesList.cpp b/src/IndicesList.cpp
index 52fbbde..5f5a1fe 100644
--- a/src/IndicesList.cpp
+++ b/src/IndicesList.cpp
@@ -140,7 +140,7 @@ Index * IndicesList::find(docstring const & name)
 {
 	List::iterator it =
 		find_if(list.begin(), list.end(), IndexNamesEqual(name));
-	return it == list.end() ? 0 : &*it;
+	return it == list.end() ? nullptr : &*it;
 }
 
 
@@ -148,7 +148,7 @@ Index const * IndicesList::find(docstring const & name) const
 {
 	List::const_iterator it =
 		find_if(list.begin(), list.end(), IndexNamesEqual(name));
-	return it == list.end() ? 0 : &*it;
+	return it == list.end() ? nullptr : &*it;
 }
 
 
@@ -156,7 +156,7 @@ Index * IndicesList::findShortcut(docstring const & shortcut)
 {
 	List::iterator it =
 		find_if(list.begin(), list.end(), IndexHasShortcut(shortcut));
-	return it == list.end() ? 0 : &*it;
+	return it == list.end() ? nullptr : &*it;
 }
 
 
@@ -164,7 +164,7 @@ Index const * IndicesList::findShortcut(docstring const & shortcut) const
 {
 	List::const_iterator it =
 		find_if(list.begin(), list.end(), IndexHasShortcut(shortcut));
-	return it == list.end() ? 0 : &*it;
+	return it == list.end() ? nullptr : &*it;
 }
 
 
@@ -189,10 +189,10 @@ bool IndicesList::add(docstring const & n, docstring const & s)
 			in.setIndex(name);
 			docstring sc = s.empty() ?
 				trim(lowercase(name.substr(0, 3))) : s;
-			if (findShortcut(sc) != 0) {
+			if (findShortcut(sc) != nullptr) {
 				int k = 1;
 				docstring scn = sc + convert<docstring>(k);
-				while (findShortcut(scn) != 0) {
+				while (findShortcut(scn) != nullptr) {
 					++k;
 					scn = sc + convert<docstring>(k);
 				}
@@ -211,7 +211,7 @@ bool IndicesList::add(docstring const & n, docstring const & s)
 
 bool IndicesList::addDefault(docstring const & n)
 {
-	if (findShortcut(from_ascii("idx")) != 0)
+	if (findShortcut(from_ascii("idx")) != nullptr)
 		// we already have a default
 		return false;
 	return add(n, from_ascii("idx"));
diff --git a/src/KeyMap.cpp b/src/KeyMap.cpp
index e18fb74..c5c387f 100644
--- a/src/KeyMap.cpp
+++ b/src/KeyMap.cpp
@@ -68,7 +68,7 @@ size_t KeyMap::bind(string const & seq, FuncRequest const & func)
 	LYXERR(Debug::KBMAP, "BIND: Sequence `" << seq << "' Action `"
 	       << func.action() << '\'');
 
-	KeySequence k(0, 0);
+	KeySequence k(nullptr, nullptr);
 
 	string::size_type const res = k.parse(seq);
 	if (res == string::npos) {
@@ -84,7 +84,7 @@ size_t KeyMap::bind(string const & seq, FuncRequest const & func)
 
 size_t KeyMap::unbind(string const & seq, FuncRequest const & func)
 {
-	KeySequence k(0, 0);
+	KeySequence k(nullptr, nullptr);
 
 	string::size_type const res = k.parse(seq);
 	if (res == string::npos)
@@ -497,7 +497,7 @@ docstring KeyMap::printBindings(FuncRequest const & func,
 
 KeyMap::Bindings KeyMap::findBindings(FuncRequest const & func) const
 {
-	return findBindings(func, KeySequence(0, 0));
+	return findBindings(func, KeySequence(nullptr, nullptr));
 }
 
 
@@ -529,7 +529,7 @@ KeyMap::Bindings KeyMap::findBindings(FuncRequest const & func,
 KeyMap::BindingList KeyMap::listBindings(bool unbound, KeyMap::ItemType tag) const
 {
 	BindingList list;
-	listBindings(list, KeySequence(0, 0), tag);
+	listBindings(list, KeySequence(nullptr, nullptr), tag);
 	if (unbound) {
 		LyXAction::const_iterator fit = lyxaction.func_begin();
 		LyXAction::const_iterator const fen = lyxaction.func_end();
@@ -544,7 +544,7 @@ KeyMap::BindingList KeyMap::listBindings(bool unbound, KeyMap::ItemType tag) con
 					break;
 				}
 			if (!has_action)
-				list.push_back(Binding(FuncRequest(action), KeySequence(0, 0), tag));
+				list.push_back(Binding(FuncRequest(action), KeySequence(nullptr, nullptr), tag));
 		}
 	}
 	return list;


More information about the lyx-cvs mailing list