From 5ae54ddafb0f8a9dd1a71d7a26549b31b6516e14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Fri, 10 Aug 2007 20:14:54 +0000 Subject: [PATCH] Get rid of a few warnings. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19409 a592a061-630c-0410-9148-cb99ea01b6c8 --- boost/libs/iostreams/src/zlib.cpp | 2 +- src/Buffer.cpp | 2 +- src/Encoding.cpp | 14 ++++++++++---- src/TextMetrics.cpp | 7 +++++-- src/ToolbarBackend.cpp | 2 +- src/frontends/qt4/IconPalette.cpp | 8 ++++---- src/frontends/qt4/qt_helpers.cpp | 2 +- src/insets/InsetGraphics.cpp | 7 +++++-- src/insets/InsetListings.cpp | 22 ++++++++++------------ src/support/lyxsum.cpp | 4 ---- 10 files changed, 38 insertions(+), 32 deletions(-) diff --git a/boost/libs/iostreams/src/zlib.cpp b/boost/libs/iostreams/src/zlib.cpp index 5b4bb71fde..65e7aefa84 100644 --- a/boost/libs/iostreams/src/zlib.cpp +++ b/boost/libs/iostreams/src/zlib.cpp @@ -153,7 +153,7 @@ void zlib_base::reset(bool compress, bool realloc) void zlib_base::do_init ( const zlib_params& p, bool compress, #if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) - zlib::alloc_func alloc, zlib::free_func free, + zlib::alloc_func /*alloc*/, zlib::free_func /*free*/, #endif void* derived ) { diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 9777f3bd9b..34727d28bf 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -199,7 +199,7 @@ public: Buffer::Impl::Impl(Buffer & parent, FileName const & file, bool readonly_) : lyx_clean(true), bak_clean(true), unnamed(false), read_only(readonly_), filename(file), file_fully_loaded(false), inset(params), - timestamp_(0), checksum_(0), toc_backend(&parent) + toc_backend(&parent), timestamp_(0), checksum_(0) { inset.setAutoBreakRows(true); lyxvc.buffer(&parent); diff --git a/src/Encoding.cpp b/src/Encoding.cpp index 6f009046a3..ae03c09b48 100644 --- a/src/Encoding.cpp +++ b/src/Encoding.cpp @@ -519,26 +519,32 @@ void Encodings::read(FileName const & encfile, FileName const & symbolsfile) string const iconvname = lex.getString(); lex.next(); string const width = lex.getString(); - bool fixedwidth; + bool fixedwidth;; if (width == "fixed") fixedwidth = true; else if (width == "variable") fixedwidth = false; - else + else { + fixedwidth = false; lex.printError("Encodings::read: " "Unknown width: `$$Token'"); + } + lex.next(); string const p = lex.getString(); Encoding::Package package; if (p == "none") - package = Encoding::none; + package = Encoding::none; else if (p == "inputenc") package = Encoding::inputenc; else if (p == "CJK") package = Encoding::CJK; - else + else { + package = Encoding::none; lex.printError("Encodings::read: " "Unknown package: `$$Token'"); + } + LYXERR(Debug::INFO) << "Reading encoding " << name << endl; encodinglist[name] = Encoding(name, latexname, iconvname, fixedwidth, diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 8467e45a18..fec9111b68 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -339,8 +339,11 @@ RowMetrics TextMetrics::computeRowMetrics(pit_type const pit, case Inset::AlignCenter: align = LYX_ALIGN_CENTER; break; - // other types unchanged (use align) - } + case Inset::Inline: + case Inset::AlignRight: + // unchanged (use align) + break; + } } switch (align) { diff --git a/src/ToolbarBackend.cpp b/src/ToolbarBackend.cpp index c6f78f61ed..8baddc4f54 100644 --- a/src/ToolbarBackend.cpp +++ b/src/ToolbarBackend.cpp @@ -63,7 +63,7 @@ ToolbarItem::ToolbarItem(Type type, FuncRequest const & func, docstring const & ToolbarItem::ToolbarItem(Type type, string const & name, docstring const & label) - : type_(type), name_(name), label_(label) + : type_(type), label_(label), name_(name) { } diff --git a/src/frontends/qt4/IconPalette.cpp b/src/frontends/qt4/IconPalette.cpp index 43d0b14bbb..50c4f497db 100644 --- a/src/frontends/qt4/IconPalette.cpp +++ b/src/frontends/qt4/IconPalette.cpp @@ -43,7 +43,7 @@ TearOff::TearOff(QWidget * parent) } -void TearOff::mouseReleaseEvent(QMouseEvent * event) +void TearOff::mouseReleaseEvent(QMouseEvent * /*event*/) { // signal tearOff(); @@ -66,7 +66,7 @@ void TearOff::leaveEvent(QEvent * event) } -void TearOff::paintEvent(QPaintEvent * event) +void TearOff::paintEvent(QPaintEvent * /*event*/) { QPainter p(this); const int fw = style()->pixelMetric(QStyle::PM_MenuPanelWidth, 0, this); @@ -149,7 +149,7 @@ void IconPalette::clicked(QAction * action) } -void IconPalette::showEvent(QShowEvent * event) +void IconPalette::showEvent(QShowEvent * /*event*/) { resize(sizeHint()); setMaximumSize(sizeHint()); @@ -218,7 +218,7 @@ void IconPalette::updateParent() } -void IconPalette::paintEvent(QPaintEvent * event) +void IconPalette::paintEvent(QPaintEvent * /*event*/) { // draw border const int fw = style()->pixelMetric(QStyle::PM_MenuPanelWidth, 0, this); diff --git a/src/frontends/qt4/qt_helpers.cpp b/src/frontends/qt4/qt_helpers.cpp index c39a245433..d89f1b2bf7 100644 --- a/src/frontends/qt4/qt_helpers.cpp +++ b/src/frontends/qt4/qt_helpers.cpp @@ -94,7 +94,7 @@ Length widgetsToLength(QLineEdit const * input, QComboBox const * combo) void lengthToWidgets(QLineEdit * input, LengthCombo * combo, - Length const & len, Length::UNIT defaultUnit) + Length const & len, Length::UNIT /*defaultUnit*/) { combo->setCurrentItem(Length(len).unit()); input->setText(toqstr(convert(Length(len).value()))); diff --git a/src/insets/InsetGraphics.cpp b/src/insets/InsetGraphics.cpp index 61daef31af..cfb0e326bb 100644 --- a/src/insets/InsetGraphics.cpp +++ b/src/insets/InsetGraphics.cpp @@ -848,8 +848,11 @@ int InsetGraphics::plaintext(Buffer const & buf, odocstream & os, namespace { -int writeImageObject(char * format, odocstream & os, OutputParams const & runparams, - docstring const graphic_label, docstring const attributes) +int writeImageObject(char const * format, + odocstream & os, + OutputParams const & runparams, + docstring const & graphic_label, + docstring const & attributes) { if (runparams.flavor != OutputParams::XML) { os << "; // are available. Order is faster to slowest. #if defined(HAVE_MMAP) && defined(HAVE_MUNMAP) -// Make sure we get modern version of mmap and friends with void*, -// not `compatibility' version with caddr_t. -#define _POSIX_C_SOURCE 199506L - #ifdef HAVE_SYS_TYPES_H # include #endif