On Mon, Sep 24, 2012 at 1:04 PM, Richard Heck <rgh...@lyx.org> wrote: > On 09/23/2012 04:54 PM, Jean-Marc Lasgouttes wrote: >> >> Le 23/09/12 00:06, Scott Kostyshak a écrit : >>>> >>>> How many users *compile* anything :) >>> >>> >>> True. And out of those who do, how many look at the warnings? :) >> >> >> Personally, I still think that removing warnings in branch matters. >> > Yes, I think it's worth doing, but not if it's the kind of thing that has > any > chance of causing problems. I think that was the issue.
OK. I'm trying to stay away from branch as much as possible for now. But attached are the three patches. Can someone check them and make sure they are risk free? Thanks, Scott
From 877398ce2faa5751a62639c9c20978eb3ff33c35 Mon Sep 17 00:00:00 2001 From: Scott Kostyshak <skost...@lyx.org> Date: Sun, 23 Sep 2012 04:58:19 -0400 Subject: [PATCH 1/3] Remove unused function find_matching_brace find_matching_brace came over from a backport and is not being used. --- src/lyxfind.cpp | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index f2c941b..a103d76 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -562,27 +562,6 @@ string apply_escapes(string s, Escapes const & escape_map) return s; } -/** Return the position of the closing brace matching the open one at s[pos], - ** or s.size() if not found. - **/ -static size_t find_matching_brace(string const & s, size_t pos) -{ - LASSERT(s[pos] == '{', /* */); - int open_braces = 1; - for (++pos; pos < s.size(); ++pos) { - if (s[pos] == '\\') - ++pos; - else if (s[pos] == '{') - ++open_braces; - else if (s[pos] == '}') { - --open_braces; - if (open_braces == 0) - return pos; - } - } - return s.size(); -} - /// Within \regexp{} apply get_lyx_unescapes() only (i.e., preserve regexp semantics of the string), /// while outside apply get_lyx_unescapes()+get_regexp_escapes(). /// If match_latex is true, then apply regexp_latex_escapes() to \regexp{} contents as well. -- 1.7.9.5
From b7582fc12ac0b8130ff26f7a735b12e200e5a714 Mon Sep 17 00:00:00 2001 From: Scott Kostyshak <skost...@lyx.org> Date: Thu, 27 Sep 2012 06:26:46 -0400 Subject: [PATCH 2/3] Get rid of unused variable to eliminate warning The variable 'c' in Lexer::Pimpl::setFile was not being used. --- src/Lexer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Lexer.cpp b/src/Lexer.cpp index d824da0..664e1b9 100644 --- a/src/Lexer.cpp +++ b/src/Lexer.cpp @@ -274,9 +274,9 @@ bool Lexer::Pimpl::setFile(FileName const & filename) // Skip byte order mark. if (is.peek() == 0xef) { - int c = is.get(); + is.get(); if (is.peek() == 0xbb) { - c = is.get(); + is.get(); LASSERT(is.get() == 0xbf, /**/); } else is.unget(); -- 1.7.9.5
From 4dfa0d7641b40eede22dd2da19da4ff83ef6a470 Mon Sep 17 00:00:00 2001 From: Scott Kostyshak <skost...@lyx.org> Date: Thu, 27 Sep 2012 06:29:27 -0400 Subject: [PATCH 3/3] Use a return value to report an unsuccessful write Use a return value in LyXComm::loadFilesInOtherInstance to give an error for a failed write to pipe. --- src/Server.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Server.cpp b/src/Server.cpp index 7ec096e..09a8734 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -1015,7 +1015,8 @@ bool LyXComm::loadFilesInOtherInstance() break; string const cmd = "LYXCMD:pipe:file-open:" + fname.absFileName() + '\n'; - ::write(pipefd, cmd.c_str(), cmd.length()); + if (::write(pipefd, cmd.c_str(), cmd.length()) < 0) + LYXERR0("Cannot write to pipe!"); ::close(pipefd); ++loaded_files; it = theFilesToLoad().erase(it); -- 1.7.9.5