From b954f478e31e640f292f865a5c41c65565e5c02a Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Fri, 15 Dec 2017 23:41:32 -0500 Subject: [PATCH] Fix #10858 compiler warnings. --- src/mathed/InsetMathHull.cpp | 16 +++++++--------- src/support/gzstream.cpp | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index 892b9df44b..724c11574e 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -823,11 +823,9 @@ void InsetMathHull::preparePreview(DocIterator const & pos, for (idx_type idx = 0; idx < nargs(); ++idx) usedMacros(cell(idx), pos, macros, defs); - MacroNameSet::iterator it = defs.begin(); - MacroNameSet::iterator end = defs.end(); docstring macro_preamble; - for (; it != end; ++it) - macro_preamble.append(*it); + for (auto const & defit : defs) + macro_preamble.append(defit); // set the font series and size for this snippet DocIterator dit = pos.getInnerText(); @@ -1650,7 +1648,8 @@ void InsetMathHull::mutate(HullType newtype) default: // we passed the guard so we should not be here - LASSERT("Mutation not implemented, but should have been.", return); + LYXERR0("Mutation not implemented, but should have been."); + LASSERT(false, return); break; }// switch } @@ -2084,11 +2083,10 @@ bool InsetMathHull::getStatus(Cursor & cur, FuncRequest const & cmd, case LFUN_LABEL_COPY_AS_REFERENCE: { bool enabled = false; - row_type row; if (cmd.argument().empty() && &cur.inset() == this) { // if there is no argument and we're inside math, we retrieve // the row number from the cursor position. - row = (type_ == hullMultline) ? nrows() - 1 : cur.row(); + row_type row = (type_ == hullMultline) ? nrows() - 1 : cur.row(); enabled = numberedType() && label_[row] && numbered(row); } else { // if there is an argument, find the corresponding label, else @@ -2319,8 +2317,8 @@ bool InsetMathHull::readQuiet(Lexer & lex) int InsetMathHull::plaintext(odocstringstream & os, OutputParams const & op, size_t max_length) const { - // disables ASCII-art for export of equations. See #2275. - if (0 && display()) { + // Try enabling this now that there is a flag as requested at #2275. + if (buffer().isExporting() && display()) { Dimension dim; TextMetricsInfo mi; metricsT(mi, dim); diff --git a/src/support/gzstream.cpp b/src/support/gzstream.cpp index 521458eab3..22e7c07d09 100644 --- a/src/support/gzstream.cpp +++ b/src/support/gzstream.cpp @@ -121,7 +121,7 @@ int gzstreambuf::overflow( int c) { // used for output buffer only if ( ! ( mode & ios::out) || ! opened) return EOF; if (c != EOF) { - *pptr() = c; + *pptr() = (char) c; pbump(1); } if ( flush_buffer() == EOF)