]> git.lyx.org Git - features.git/commitdiff
Remove warnings reported with gcc 4.3:
authorLars Gullik Bjønnes <larsbj@gullik.org>
Sun, 16 Sep 2007 10:36:57 +0000 (10:36 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Sun, 16 Sep 2007 10:36:57 +0000 (10:36 +0000)
- Modifier on return type ignored
- Ambigous else
- Ambigous logical operators
- Semi-colon instead of empty block
- Missing header files
- Missing using std::XX
- Initialization out of order

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20304 a592a061-630c-0410-9148-cb99ea01b6c8

39 files changed:
src/Converter.cpp
src/ConverterCache.cpp
src/CoordCache.h
src/DocIterator.cpp
src/Format.cpp
src/Lexer.cpp
src/LyX.cpp
src/LyX.h
src/ParagraphMetrics.cpp
src/Row.cpp
src/Row.h
src/TocBackend.cpp
src/TocBackend.h
src/frontends/LyXView.cpp
src/frontends/LyXView.h
src/frontends/controllers/ButtonPolicy.cpp
src/frontends/controllers/ControlCitation.cpp
src/frontends/controllers/ControlCitation.h
src/frontends/controllers/ControlDocument.cpp
src/frontends/controllers/ControlDocument.h
src/frontends/controllers/ControlParagraph.cpp
src/frontends/controllers/ControlParagraph.h
src/frontends/controllers/ControlPrefs.cpp
src/frontends/controllers/ControlPrefs.h
src/frontends/controllers/ControlRef.cpp
src/frontends/qt4/GuiGraphics.cpp
src/frontends/qt4/GuiImage.cpp
src/frontends/qt4/TocModel.cpp
src/insets/ExternalSupport.cpp
src/insets/InsetCollapsable.cpp
src/insets/InsetInclude.cpp
src/insets/InsetListingsParams.cpp
src/insets/InsetTabular.cpp
src/mathed/InsetMathGrid.cpp
src/output_latex.cpp
src/support/lstrings.h
src/support/qstring_helpers.h
src/support/rename.cpp
src/tex2lyx/preamble.cpp

index f2a463868e381d2badae7bd5aa23ee1304a32261..3108d6d286d057bf5ad79f7c3c0f3dfbf190ce00 100644 (file)
@@ -365,9 +365,10 @@ bool Converters::convert(Buffer const * buffer,
             cit != edgepath.end(); ++cit) {
                Converter const & conv = converterlist_[*cit];
                bool dummy = conv.To->dummy() && conv.to != "program";
-               if (!dummy)
+               if (!dummy) {
                        LYXERR(Debug::FILES) << "Converting from  "
                               << conv.from << " to " << conv.to << endl;
+               }
                infile = outfile;
                outfile = FileName(conv.result_dir.empty()
                        ? changeExtension(from_file.absFilename(), conv.To->extension())
index 6bcaa60f2507bed61efd4e693d67b268ba559c18..72425ed8b3d6d06f05d92ca3a531f8eb4576b740 100644 (file)
@@ -296,11 +296,12 @@ void ConverterCache::add(FileName const & orig_from, string const & to_format,
                        item->checksum = checksum;
                }
                if (!mover.copy(converted_file, item->cache_name,
-                               support::onlyFilename(item->cache_name.absFilename()), 0600))
+                               support::onlyFilename(item->cache_name.absFilename()), 0600)) {
                        LYXERR(Debug::FILES) << "ConverterCache::add("
                                             << orig_from << "):\n"
                                                "Could not copy file."
                                             << std::endl;
+               }
        } else {
                CacheItem new_item(orig_from, to_format, timestamp,
                                support::sum(orig_from));
index 63e0aece9678d2719efc5d139fdf081a26c856b9..296de324e94b61b74a877f054913f69be11ec90a 100644 (file)
@@ -45,7 +45,7 @@ public:
                data_.clear();
        }
 
-       bool const empty() const
+       bool empty() const
        {
                return data_.empty();
        }
index af36b644573fdbbf3fd0151cac61f5d0eec0c3bd..07e0d6f5e0d012a7e24dfeb18400db2c3cae2789 100644 (file)
@@ -78,7 +78,7 @@ Inset * DocIterator::prevInset() const
        BOOST_ASSERT(!empty());
        if (pos() == 0)
                return 0;
-       if (inMathed())
+       if (inMathed()) {
                if (cell().empty())
                        // FIXME: this should not happen but it does.
                        // See bug 3189
@@ -86,6 +86,7 @@ Inset * DocIterator::prevInset() const
                        return 0;
                else
                        return prevAtom().nucleus();
+       }
        return paragraph().isInset(pos() - 1) ? paragraph().getInset(pos() - 1) : 0;
 }
 
index 90f766bfeb5baf9afe3f04d5bd03188cde57a688..8bd34ad48968d9fb6df3b53ec97eebacfeee22f3 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <boost/filesystem/operations.hpp>
 
+using std::find_if;
 using std::string;
 using std::distance;
 
index f9146a296bb5f2999f1f2933976bd6185132e300..4db980859f9d70b7277e2f79c172670d9a936d5e 100644 (file)
@@ -274,9 +274,10 @@ bool Lexer::Pimpl::setFile(FileName const & filename)
                // The check only outputs a debug message, because it triggers
                // a bug in compaq cxx 6.2, where is_open() returns 'true' for
                // a fresh new filebuf.  (JMarc)
-               if (fb_.is_open() || istream::off_type(is.tellg()) > 0)
+               if (fb_.is_open() || istream::off_type(is.tellg()) > 0) {
                        LYXERR(Debug::LYXLEX) << "Error in Lexer::setFile: "
                                "file or stream already set." << endl;
+               }
                fb_.open(filename.toFilesystemEncoding().c_str(), ios::in);
                is.rdbuf(&fb_);
                name = filename.absFilename();
@@ -288,9 +289,10 @@ bool Lexer::Pimpl::setFile(FileName const & filename)
 
 void Lexer::Pimpl::setStream(istream & i)
 {
-       if (fb_.is_open() || istream::off_type(is.tellg()) > 0)
+       if (fb_.is_open() || istream::off_type(is.tellg()) > 0) {
                LYXERR(Debug::LYXLEX)  << "Error in Lexer::setStream: "
                        "file or stream already set." << endl;
+       }
        is.rdbuf(i.rdbuf());
        lineno = 0;
 }
index 873888c2915ef910928399295cb4e0efd929236a..21de3ff6cf488e44664ed396606b2a8963c4d4f8 100644 (file)
@@ -366,7 +366,7 @@ void LyX::setGuiLanguage(std::string const & language)
 }
 
 
-Buffer const * const LyX::updateInset(Inset const * inset) const
+Buffer const * LyX::updateInset(Inset const * inset) const
 {
        if (quitting || !inset)
                return 0;
index be52628497873086926627bff0cfc08f3519240a..534704957ef2807887354662b257edd49b9bf589 100644 (file)
--- a/src/LyX.h
+++ b/src/LyX.h
@@ -103,7 +103,7 @@ public:
        /** redraw \c inset in all the BufferViews in which it is currently
         *  visible. If successful return a pointer to the owning Buffer.
         */
-       Buffer const * const updateInset(Inset const *) const;
+       Buffer const * updateInset(Inset const *) const;
 
        void hideDialogs(std::string const & name, Inset * inset) const;
 
index a05177831dc85f4ccf66ac6465b4335aa9fc9ee3..701e6742334731e7d575861d9e6972200c4f5419 100644 (file)
@@ -71,7 +71,7 @@ using std::ostream;
 using std::ostringstream;
 
 
-ParagraphMetrics::ParagraphMetrics(Paragraph const & par): par_(&par), position_(-1)
+ParagraphMetrics::ParagraphMetrics(Paragraph const & par): position_(-1), par_(&par)
 {
 }
 
index 6f1a31c078fbc0c5f2b2288da0934288153324e2..c965210e7a1c258494a2f8af0a2c3e20bd65d2d7 100644 (file)
@@ -24,14 +24,14 @@ namespace lyx {
 
 
 Row::Row()
-       : changed_(false), crc_(0), pos_(0), end_(0), separator(0), hfill(0),
-       label_hfill(0), x(0), sel_beg(-1), sel_end(-1)
+       : separator(0), hfill(0), label_hfill(0), x(0),
+       sel_beg(-1), sel_end(-1), changed_(false), crc_(0), pos_(0), end_(0)
 {}
 
 
 Row::Row(pos_type pos)
-       : changed_(false), crc_(0), pos_(pos), end_(0), separator(0), hfill(0),
-       label_hfill(0), x(0), sel_beg(-1), sel_end(-1)
+       : separator(0), hfill(0), label_hfill(0), x(0),
+       sel_beg(-1), sel_end(-1), changed_(false), crc_(0), pos_(pos), end_(0)
 {}
 
 
@@ -89,7 +89,7 @@ void Row::setSelection(pos_type beg, pos_type end)
 }
 
 
-void Row::dump(const char * s) const
+void Row::dump(char const * s) const
 {
        lyxerr << s << " pos: " << pos_ << " end: " << end_
                << " width: " << dim_.wid
index f013fb49db1159ee094ff338125e19f337107ad6..5b67abba5e463d655edfbb3b3dcf621c5db91634 100644 (file)
--- a/src/Row.h
+++ b/src/Row.h
@@ -64,7 +64,7 @@ public:
        int descent() const { return dim_.des; }
 
        /// current debugging only
-       void dump(const char * = "") const;
+       void dump(char const * = "") const;
 
        /// width of a separator (i.e. space)
        double separator;
@@ -78,8 +78,6 @@ public:
        pos_type sel_beg;
        ///
        pos_type sel_end;
-
-
 private:
        /// has the Row appearance changed since last drawing?
        bool changed_;
index 03f3a7433f56de8eabf1e9b61dd52af6a88e2132..07fbc1fe51d55613e300c54401552eee2cab4935 100644 (file)
@@ -40,13 +40,13 @@ TocItem::TocItem(ParConstIterator const & par_it, int d,
 }
 
 
-int const TocItem::id() const
+int TocItem::id() const
 {
        return par_it_->id();
 }
 
 
-int const TocItem::depth() const
+int TocItem::depth() const
 {
        return depth_;
 }
index 25b39c953876ee331e67e987a97bf1d862c965fd..60b4e511228835faae21febb6cd94ae791ad9dc6 100644 (file)
@@ -48,9 +48,9 @@ public:
        ///
        ~TocItem() {}
        ///
-       int const id() const;
+       int id() const;
        ///
-       int const depth() const;
+       int depth() const;
        ///
        docstring const & str() const;
        ///
index 0ebbe0b67651eacc8b750cfeb862858e53939012..29b4af65aa3ce8a6be1269928deb444ce42a96e3 100644 (file)
@@ -421,7 +421,7 @@ void LyXView::dispatch(FuncRequest const & cmd)
 }
 
 
-Buffer const * const LyXView::updateInset(Inset const * inset)
+Buffer const * LyXView::updateInset(Inset const * inset)
 {
        WorkArea * work_area = currentWorkArea();
        if (!work_area)
index e7100d6f1730c875571095a5063bc31a092e56ca..bf9aa5778db67781f6e41c33cbfeee0f4db233ff 100644 (file)
@@ -62,7 +62,7 @@ public:
 
        virtual ~LyXView();
 
-       int const id() const { return id_; }
+       int id() const { return id_; }
 
        virtual void close() = 0;
 
@@ -174,7 +174,7 @@ public:
        /** redraw \c inset in all the BufferViews in which it is currently
         *  visible. If successful return a pointer to the owning Buffer.
         */
-       Buffer const * const updateInset(Inset const *);
+       Buffer const * updateInset(Inset const *);
 
        /// returns true if this view has the focus.
        virtual bool hasFocus() const = 0;
index 8af5b6d652170f902da72e2cf71ada389c95f941..69c15f97724457b28b16657225f37699a681eb4d 100644 (file)
@@ -124,7 +124,7 @@ bool ButtonPolicy::isReadOnly() const
 }
 
 
-static char const * const printState(ButtonPolicy::State const & state)
+static char const * printState(ButtonPolicy::State const & state)
 {
        switch (state) {
                case ButtonPolicy::INITIAL:
@@ -151,7 +151,7 @@ static char const * const printState(ButtonPolicy::State const & state)
 }
 
 
-static char const * const printInput(ButtonPolicy::SMInput const & input)
+static char const * printInput(ButtonPolicy::SMInput const & input)
 {
        switch (input) {
                case ButtonPolicy::SMI_VALID:
index b96d01387b5fffd3bcbd85bab39ef78a17e9bfc2..2fa35bcac0026b56edf56fadff06954099b1213b 100644 (file)
@@ -109,7 +109,7 @@ void ControlCitation::filterByEntryType(
 }
 
 
-biblio::CiteEngine const ControlCitation::getEngine() const
+biblio::CiteEngine ControlCitation::getEngine() const
 {
        return buffer().params().getEngine();
 }
index 94985eacc9ec95e8066fe2a4d828838b92edea87..af236b8e623aed82c90ef00146e6c39a4515d7af 100644 (file)
@@ -46,7 +46,7 @@ public:
        void filterByEntryType(
                std::vector<docstring> & keyVector, docstring entryType);
        ///
-       biblio::CiteEngine const getEngine() const;
+       biblio::CiteEngine getEngine() const;
 
        /// \return information for this key.
        docstring const getInfo(docstring const & key) const;
index 1a75bc931725a17e58e95084c080d1a4ed8638b5..d21f1d3aa75756dd2d1bb2bc6bfd6cbd0cb551d4 100644 (file)
@@ -35,6 +35,7 @@
 #include <sstream>
 
 using std::ostringstream;
+using std::sort;
 using std::string;
 using std::vector;
 
@@ -60,7 +61,7 @@ ControlDocument::~ControlDocument()
 {}
 
 
-bool ControlDocument::initialiseParams(std::string const &)
+bool ControlDocument::initialiseParams(string const &)
 {
        bp_.reset(new BufferParams);
        *bp_ = buffer().params();
@@ -100,7 +101,7 @@ vector<string> const & ControlDocument::getSelectedModules()
 }
 
 
-string ControlDocument::getModuleDescription(string modName) const
+string ControlDocument::getModuleDescription(string const & modName) const
 {
        LyXModule const * const mod = moduleList[modName];
        if (!mod)
@@ -109,11 +110,12 @@ string ControlDocument::getModuleDescription(string modName) const
 }
 
 
-std::vector<std::string> 
-       ControlDocument::getPackageList(std::string modName) const {
+vector<string>
+ControlDocument::getPackageList(string const & modName) const
+{
        LyXModule const * const mod = moduleList[modName];
-       if (!mod) 
-               return std::vector<std::string>(); //empty such thing
+       if (!mod)
+               return vector<string>(); //empty such thing
        return mod->packageList;
 }
 
@@ -177,7 +179,7 @@ void ControlDocument::setLanguage() const
        if (buffer().params().language == newL)
                return;
 
-       string const lang_name = newL->lang();
+       string const lang_name = newL->lang();
        dispatch(FuncRequest(LFUN_BUFFER_LANGUAGE, lang_name));
 }
 
@@ -188,7 +190,7 @@ void ControlDocument::saveAsDefault() const
 }
 
 
-bool const ControlDocument::isFontAvailable(std::string const & font) const
+bool ControlDocument::isFontAvailable(string const & font) const
 {
        if (font == "default" || font == "cmr"
            || font == "cmss" || font == "cmtt")
@@ -212,7 +214,7 @@ bool const ControlDocument::isFontAvailable(std::string const & font) const
 }
 
 
-bool const ControlDocument::providesOSF(std::string const & font) const
+bool ControlDocument::providesOSF(string const & font) const
 {
        if (font == "cmr")
                return isFontAvailable("eco");
@@ -223,7 +225,7 @@ bool const ControlDocument::providesOSF(std::string const & font) const
 }
 
 
-bool const ControlDocument::providesSC(std::string const & font) const
+bool ControlDocument::providesSC(string const & font) const
 {
        if (font == "palatino")
                return isFontAvailable("mathpazo");
@@ -234,7 +236,7 @@ bool const ControlDocument::providesSC(std::string const & font) const
 }
 
 
-bool const ControlDocument::providesScale(std::string const & font) const
+bool ControlDocument::providesScale(string const & font) const
 {
        return (font == "helvet" || font == "luximono"
                || font == "berasans"  || font == "beramono");
index ca80fcb7bc0cdd9bdfe782bae7a7af8c631860f1..8d05f690c1b52c47099e9c74361b76065ce8052c 100644 (file)
@@ -27,7 +27,7 @@ class BufferParams;
 class TextClass;
 
 namespace frontend {
-       
+
 ///
 typedef void const * BufferId;
 ///
@@ -66,21 +66,21 @@ public:
        /// Modules in use in current buffer
        std::vector<std::string> const & getSelectedModules();
        ///
-       std::string getModuleDescription(std::string modName) const;
+       std::string getModuleDescription(std::string const & modName) const;
        ///
-       std::vector<std::string> getPackageList(std::string modName) const;
+       std::vector<std::string> getPackageList(std::string const & modName) const;
        ///
        void setLanguage() const;
        ///
        void saveAsDefault() const;
        ///
-       bool const isFontAvailable(std::string const & font) const;
+       bool isFontAvailable(std::string const & font) const;
        /// does this font provide Old Style figures?
-       bool const providesOSF(std::string const & font) const;
+       bool providesOSF(std::string const & font) const;
        /// does this font provide true Small Caps?
-       bool const providesSC(std::string const & font) const;
+       bool providesSC(std::string const & font) const;
        /// does this font provide size adjustment?
-       bool const providesScale(std::string const & font) const;
+       bool providesScale(std::string const & font) const;
 private:
        ///
        void loadModuleNames();
index ab11234e1db14d774fabb345a6b3f85d7398c160..a7a022c37ca8770527b701b147a33c7fd3598785 100644 (file)
@@ -151,7 +151,7 @@ ParagraphParameters const & ControlParagraph::params() const
 }
 
 
-bool const ControlParagraph::haveMulitParSelection()
+bool ControlParagraph::haveMulitParSelection()
 {
        Cursor cur = bufferview()->cursor();
        return cur.selection() && cur.selBegin().pit() != cur.selEnd().pit();
index bb06f8750cbfc56cf4c88a490f8260f345d7ca33..fae990012c47d604651d5e9e6ebcce43653543e8 100644 (file)
@@ -39,7 +39,7 @@ public:
        ///
        ParagraphParameters const & params() const;
        ///
-       bool const haveMulitParSelection();
+       bool haveMulitParSelection();
        ///
        bool inInset() const;
        ///
index 4cd5f3ceb8f15b6f83a733838663ae6be45a12d5..2c2c1cdb7c6a1e96ac8ecb80359c7c8b3273cff3 100644 (file)
@@ -155,7 +155,7 @@ docstring const ControlPrefs::browsedir(docstring const & path,
 
 // We support less paper sizes than the document dialog
 // Therefore this adjustment is needed.
-PAPER_SIZE const ControlPrefs::toPaperSize(int i) const
+PAPER_SIZE ControlPrefs::toPaperSize(int i) const
 {
        switch (i) {
        case 0:
@@ -181,7 +181,7 @@ PAPER_SIZE const ControlPrefs::toPaperSize(int i) const
 }
 
 
-int const ControlPrefs::fromPaperSize(PAPER_SIZE papersize) const
+int ControlPrefs::fromPaperSize(PAPER_SIZE papersize) const
 {
        switch (papersize) {
        case PAPER_DEFAULT:
index e2730c5cdfac21aeb86e66a4457966ad2edc5fb6..220c2b90c2ea9cde32a9f0494120d9f07ca615cd 100644 (file)
@@ -72,9 +72,9 @@ public:
        void updateScreenFonts();
 
        /// adjust the prefs paper sizes
-       PAPER_SIZE const toPaperSize(int i) const;
+       PAPER_SIZE toPaperSize(int i) const;
        /// adjust the prefs paper sizes
-       int const fromPaperSize(PAPER_SIZE papersize) const;
+       int fromPaperSize(PAPER_SIZE papersize) const;
 
 private:
        /// temporary lyxrc
index 87e76c1a2ae6133347ea42205a26fc120ce36e05..0a5d9c4b4d88cd0ab186fd8f81a1a789666ed3f5 100644 (file)
@@ -21,6 +21,7 @@
 
 using lyx::docstring;
 
+using std::find;
 using std::vector;
 using std::string;
 
index a1741ba4a91c3d14a09bf1e196d4e86a86018333..283f3f56f6f2fcf80fa786a47fca8716e01fed49 100644 (file)
@@ -48,13 +48,15 @@ using lyx::support::token;
 
 using lyx::support::os::internal_path;
 
+using std::find;
+
 #ifndef CXX_GLOBAL_CSTD
 using std::floor;
 #endif
 
 using std::vector;
 using std::string;
-
+using std::transform;
 
 namespace lyx {
 namespace frontend {
@@ -89,23 +91,23 @@ void setAutoTextCB(QCheckBox * checkBox, QLineEdit * lineEdit,
 
 
 template<class Pair>
-std::vector<typename Pair::first_type> const
-getFirst(std::vector<Pair> const & pr)
+vector<typename Pair::first_type> const
+getFirst(vector<Pair> const & pr)
 {
-       std::vector<typename Pair::first_type> tmp(pr.size());
-       std::transform(pr.begin(), pr.end(), tmp.begin(),
-                      boost::bind(&Pair::first, _1));
+       vector<typename Pair::first_type> tmp(pr.size());
+       transform(pr.begin(), pr.end(), tmp.begin(),
+                 boost::bind(&Pair::first, _1));
        return tmp;
 }
 
 ///
 template<class Pair>
-std::vector<typename Pair::second_type> const
-getSecond(std::vector<Pair> const & pr)
+vector<typename Pair::second_type> const
+getSecond(vector<Pair> const & pr)
 {
-        std::vector<typename Pair::second_type> tmp(pr.size());
-        std::transform(pr.begin(), pr.end(), tmp.begin(),
-                                        boost::bind(&Pair::second, _1));
+        vector<typename Pair::second_type> tmp(pr.size());
+        transform(pr.begin(), pr.end(), tmp.begin(),
+                  boost::bind(&Pair::second, _1));
         return tmp;
 }
 
@@ -283,7 +285,7 @@ void GuiGraphicsDialog::on_browsePB_clicked()
 {
        docstring const str =
                controller().browse(qstring_to_ucs4(filename->text()));
-       if(!str.empty()){
+       if (!str.empty()) {
                filename->setText(toqstr(str));
                embedCB->setCheckState(Qt::Unchecked);
                changed();
@@ -725,4 +727,3 @@ bool GuiGraphicsDialog::isValid()
 
 
 #include "GuiGraphics_moc.cpp"
-
index d0d0e8d07147cfd95a367e0911dea8067365fe2a..1b645311e5662d18f146f79d430abeaa8553d7d9 100644 (file)
@@ -77,9 +77,10 @@ Image::FormatList GuiImage::loadableFormats()
        LYXERR(Debug::GRAPHICS)
                << "\nThe image loader can load the following directly:\n";
 
-       if (qt_formats.empty())
+       if (qt_formats.empty()) {
                LYXERR(Debug::GRAPHICS)
                        << "\nQt4 Problem: No Format available!" << endl;
+       }
 
        for (QList<QByteArray>::const_iterator it =qt_formats.begin(); it != qt_formats.end(); ++it) {
 
@@ -107,8 +108,9 @@ Image::FormatList GuiImage::loadableFormats()
                FormatList::const_iterator fbegin = fmts.begin();
                FormatList::const_iterator fend   = fmts.end();
                for (FormatList::const_iterator fit = fbegin; fit != fend; ++fit) {
-                       if (fit != fbegin)
+                       if (fit != fbegin) {
                                LYXERR(Debug::GRAPHICS) << ", ";
+                       }
                        LYXERR(Debug::GRAPHICS) << *fit;
                }
                LYXERR(Debug::GRAPHICS) << '\n' << endl;
index cf68a115a9b55b2dbed076b5c5f72863b1624705..24bcf728780cfe413ecde79a256c88b72ce8a1be 100644 (file)
@@ -15,6 +15,8 @@
 
 #include "debug.h"
 
+#include <climits>
+
 #include <vector>
 #include <string>
 
index 2210a1bc721a8b078bd2688939e6bfe732a70b7d..1e58f6774ecfd63c3dd8024c2634059f7144068d 100644 (file)
@@ -327,11 +327,12 @@ void updateExternal(InsetExternalParams const & params,
                                   params.filename, from_format, to_format, el,
                                   Converters::try_default | Converters::try_cache);
 
-       if (!success)
+       if (!success) {
                LYXERR(Debug::EXTERNAL)
                        << "external::updateExternal. "
                        << "Unable to convert from "
                        << from_format << " to " << to_format << endl;
+       }
 
        // return success
 }
index bec8c17c80ed5fc12e1691a206688a29db3b0413..45edd5be3c76f18acbb86276ad3ec7908f1f7c49 100644 (file)
@@ -667,13 +667,14 @@ int InsetCollapsable::latex(Buffer const & buf, odocstream & os,
                }
        }
        int i = InsetText::latex(buf, os, runparams);
-       if (!layout_.latexname.empty())
+       if (!layout_.latexname.empty()) {
                if (layout_.latextype == "command") {
                        os << "}";
                } else if (layout_.latextype == "environment") {
                        os << "\n\\end{" << from_utf8(layout_.latexname) << "}\n";
                        i += 4;
                }
+       }
        return i;
 }
 
index 1a8ec8713c3bfce87dd037285a1e9feee6813234..136c461aac9302ca946ad73ccea5fb992e7e8462 100644 (file)
@@ -52,7 +52,7 @@
 
 
 namespace lyx {
-  
+
 // Implementation is in LyX.cpp
 extern void dispatch(FuncRequest const & action);
 
@@ -80,6 +80,7 @@ using support::subst;
 using support::sum;
 
 using std::endl;
+using std::find;
 using std::string;
 using std::istringstream;
 using std::ostream;
@@ -461,7 +462,7 @@ int InsetInclude::latex(Buffer const & buffer, odocstream & os,
                incfile = mangled;
        else if (!isValidLaTeXFilename(incfile)) {
                frontend::Alert::warning(_("Invalid filename"),
-                                        _("The following filename is likely to cause trouble "
+                                        _("The following filename is likely to cause trouble "
                                           "when running the exported file through LaTeX: ") +
                                            from_utf8(incfile));
        }
@@ -492,7 +493,7 @@ int InsetInclude::latex(Buffer const & buffer, odocstream & os,
                        Alert::warning(_("Different textclasses"), text);
                        //return 0;
                }
-               
+
                // Make sure modules used in child are all included in master
                //FIXME It might be worth loading the children's modules into the master
                //over in BufferParams rather than doing this check.
@@ -502,13 +503,13 @@ int InsetInclude::latex(Buffer const & buffer, odocstream & os,
                vector<string>::const_iterator end = childModules.end();
                for (; it != end; ++it) {
                        string const module = *it;
-                       vector<string>::const_iterator found = 
+                       vector<string>::const_iterator found =
                                find(masterModules.begin(), masterModules.end(), module);
                        if (found != masterModules.end()) {
                                docstring text = bformat(_("Included file `%1$s'\n"
                                                        "uses module `%2$s'\n"
                                                        "which is not used in parent file."),
-                                      makeDisplayPath(included_file.absFilename()), from_utf8(module));
+                                      makeDisplayPath(included_file.absFilename()), from_utf8(module));
                                Alert::warning(_("Module not found"), text);
                        }
                }
@@ -916,7 +917,7 @@ void InsetInclude::addToToc(TocList & toclist, Buffer const & buffer, ParConstIt
                        Toc & toc = toclist["listing"];
                        docstring const str = convert<docstring>(toc.size() + 1)
                                + ". " +  from_utf8(caption);
-                       // This inset does not have a valid ParConstIterator 
+                       // This inset does not have a valid ParConstIterator
                        // so it has to use the iterator of its parent paragraph
                        toc.push_back(TocItem(pit, 0, str));
                }
@@ -935,7 +936,7 @@ void InsetInclude::addToToc(TocList & toclist, Buffer const & buffer, ParConstIt
 }
 
 
-void InsetInclude::updateLabels(Buffer const & buffer, 
+void InsetInclude::updateLabels(Buffer const & buffer,
                                ParIterator const &)
 {
        Buffer const * const childbuffer = getChildBuffer(buffer, params_);
index 984bab1a601fd8c36911ce3a61fdf01366b89676..d9e05e6b2049ca596289366c20ac7b1222b485b6 100644 (file)
@@ -759,7 +759,7 @@ void InsetListingsParams::addParam(string const & key, string const & value)
        if (params_.find(key) != params_.end())
                // key=value,key=value1 is allowed in listings
                // use key_, key__, key___ etc to avoid name conflict
-               while (params_.find(keyname += '_') != params_.end());
+               while (params_.find(keyname += '_') != params_.end()) { }
        // check onoff flag
        // onoff parameter with value false
        if (!par_validator)
index ff89ddd931bc79b265dd8b576b6d6015bfab2108..47c50de74f72e328714187e9b4f3e760640b3b44 100644 (file)
@@ -875,7 +875,7 @@ bool Tabular::leftAlreadyDrawn(idx_type cell) const
                row_type row = cellRow(cell);
                while (--column &&
                           (cell_info[row][column].multicolumn ==
-                               Tabular::CELL_PART_OF_MULTICOLUMN));
+                               Tabular::CELL_PART_OF_MULTICOLUMN)) { }
                if (getAdditionalWidth(cell_info[row][column].cellno))
                        return false;
                return rightLine(cell_info[row][column].cellno);
index 0454cc388e4783b3e32af69d459a4d5c06f35fc5..d9dd7c52a4830825de9c78be5437d5c689ff1990 100644 (file)
@@ -1402,12 +1402,12 @@ bool InsetMathGrid::getStatus(Cursor & cur, FuncRequest const & cmd,
                                from_utf8(N_("Unknown tabular feature '%1$s'")), lyx::from_ascii(s)));
                }
 
-               status.setOnOff(s == "align-left"    && halign(cur.col()) == 'l'
-                          || s == "align-right"   && halign(cur.col()) == 'r'
-                          || s == "align-center"  && halign(cur.col()) == 'c'
-                          || s == "valign-top"    && valign() == 't'
-                          || s == "valign-bottom" && valign() == 'b'
-                          || s == "valign-middle" && valign() == 'm');
+               status.setOnOff((s == "align-left" && halign(cur.col()) == 'l')
+                          || (s == "align-right"   && halign(cur.col()) == 'r')
+                          || (s == "align-center"  && halign(cur.col()) == 'c')
+                          || (s == "valign-top"    && valign() == 't')
+                          || (s == "valign-bottom" && valign() == 'b')
+                          || (s == "valign-middle" && valign() == 'm'));
 
 #if 0
                // FIXME: What did this code do?
index 6f9a040f254c3823e7f7381ad84c116cecce0aef..8933d78f91747aa50c7e8378ff50593461f2c649 100644 (file)
@@ -207,8 +207,9 @@ TeXEnvironment(Buffer const & buf,
                texrow.newline();
        }
 
-       if (par != paragraphs.end())
+       if (par != paragraphs.end()) {
                LYXERR(Debug::LATEX) << "TeXEnvironment...done " << &*par << endl;
+       }
        return par;
 }
 
@@ -585,8 +586,9 @@ TeXOnePar(Buffer const & buf,
                texrow.newline();
        }
 
-       if (boost::next(pit) != paragraphs.end())
+       if (boost::next(pit) != paragraphs.end()) {
                LYXERR(Debug::LATEX) << "TeXOnePar...done " << &*boost::next(pit) << endl;
+       }
 
        return ++pit;
 }
index d7a6a799e6313e1e9d264e9ef665706ff7918b19..ef4670e575da4270b19badfc5bcfa3b095d1b874 100644 (file)
@@ -18,6 +18,7 @@
 
 #include "support/docstring.h"
 
+#include <cstring>
 #include <vector>
 
 
index 86b2e037fe33040dbe6a4e48d52abb8821d531ea..c47c95630a3a379a9884275e8522e0f5d1d7c416 100644 (file)
@@ -60,7 +60,7 @@ inline bool is_utf16(char_type c)
  * This does only exist because of performance reasons (a real conversion
  * using iconv is too slow on windows).
  */
-inline char_type const qchar_to_ucs4(QChar const & qchar)
+inline char_type qchar_to_ucs4(QChar const & qchar)
 {
        BOOST_ASSERT(is_utf16(static_cast<char_type>(qchar.unicode())));
        return static_cast<char_type>(qchar.unicode());
index 45b1b45e861d339d77c4352fc14ae8a5cee69fc9..ec6fca53898e38e4c00c490450417cee3cd398a5 100644 (file)
@@ -25,12 +25,13 @@ using std::string;
 
 bool rename(FileName const & from, FileName const & to)
 {
-       if (::rename(from.toFilesystemEncoding().c_str(), to.toFilesystemEncoding().c_str()) == -1)
+       if (::rename(from.toFilesystemEncoding().c_str(), to.toFilesystemEncoding().c_str()) == -1) {
                if (copy(from, to)) {
                        unlink(from);
                        return true;
                } else
                        return false;
+       }
        return true;
 }
 
index bb47315d43894c359b5715682994131907c022e3..b39c8c123f4416c877152aca081bab134449e713 100644 (file)
@@ -37,6 +37,7 @@ using std::string;
 using std::vector;
 using std::cerr;
 using std::endl;
+using std::find;
 
 using support::FileName;
 using support::libFileSearch;
@@ -99,7 +100,7 @@ void handle_opt(vector<string> & opts, char const * const * what, string & targe
        if (opts.empty())
                return;
 
-       for ( ; *what; ++what) {
+       for (; *what; ++what) {
                vector<string>::iterator it = find(opts.begin(), opts.end(), *what);
                if (it != opts.end()) {
                        //cerr << "### found option '" << *what << "'\n";