Fix "dead store" warnings of Xcode analyze tool

This commit is contained in:
Stephan Witt 2015-10-09 08:08:49 +02:00
parent 912cdafb85
commit 77cc2c7c8c
8 changed files with 6 additions and 23 deletions

View File

@ -219,7 +219,7 @@ AspellConfig * AspellChecker::Private::getConfig(string const & lang, string con
} }
if (!have_dict) { if (!have_dict) {
// check for package data of OS installation // check for package data of OS installation
have_dict = checkAspellData(config, osPackageBase(), osPackageDataDirectory(), osPackageDictDirectory(), lang, variety); checkAspellData(config, osPackageBase(), osPackageDataDirectory(), osPackageDictDirectory(), lang, variety);
} }
return config ; return config ;
} }

View File

@ -413,8 +413,8 @@ TextClass::ReturnValues TextClass::read(Lexer & lexrc, ReadType rt)
} }
// used below to track whether we are in an IfStyle or IfCounter tag. // used below to track whether we are in an IfStyle or IfCounter tag.
bool ifstyle = false; bool ifstyle = false;
bool ifcounter = false; bool ifcounter = false;
switch (static_cast<TextClassTags>(le)) { switch (static_cast<TextClassTags>(le)) {
@ -508,9 +508,6 @@ TextClass::ReturnValues TextClass::read(Lexer & lexrc, ReadType rt)
Layout lay; Layout lay;
readStyle(lexrc, lay); readStyle(lexrc, lay);
} }
// reset flag
ifstyle = false;
break; break;
} }
@ -764,8 +761,6 @@ TextClass::ReturnValues TextClass::read(Lexer & lexrc, ReadType rt)
lexrc.printError("No name given for style: `$$Token'."); lexrc.printError("No name given for style: `$$Token'.");
error = true; error = true;
} }
// reset flag
ifcounter = false;
break; break;
case TC_TITLELATEXTYPE: case TC_TITLELATEXTYPE:

View File

@ -260,9 +260,6 @@ void GuiCitation::updateStyles(BiblioInfo const & bi)
return; return;
} }
if (!selectedLV->selectionModel()->selectedIndexes().empty())
curr = selectedLV->selectionModel()->selectedIndexes()[0].row();
static const size_t max_length = 80; static const size_t max_length = 80;
QStringList sty = citationStyles(bi, max_length); QStringList sty = citationStyles(bi, max_length);

View File

@ -2863,7 +2863,6 @@ QTreeWidgetItem * PrefShortcuts::insertShortcutItem(FuncRequest const & lfun,
QString const lfun_name = toqstr(from_utf8(action_name) QString const lfun_name = toqstr(from_utf8(action_name)
+ ' ' + lfun.argument()); + ' ' + lfun.argument());
QString const shortcut = toqstr(seq.print(KeySequence::ForGui)); QString const shortcut = toqstr(seq.print(KeySequence::ForGui));
KeyMap::ItemType item_tag = tag;
QTreeWidgetItem * newItem = 0; QTreeWidgetItem * newItem = 0;
// for unbind items, try to find an existing item in the system bind list // for unbind items, try to find an existing item in the system bind list
@ -2880,7 +2879,6 @@ QTreeWidgetItem * PrefShortcuts::insertShortcutItem(FuncRequest const & lfun,
// Such an item is not displayed to avoid confusion (what is // Such an item is not displayed to avoid confusion (what is
// unmatched removed?). // unmatched removed?).
if (!newItem) { if (!newItem) {
item_tag = KeyMap::UserExtraUnbind;
return 0; return 0;
} }
} }
@ -2913,7 +2911,7 @@ QTreeWidgetItem * PrefShortcuts::insertShortcutItem(FuncRequest const & lfun,
newItem->setText(1, shortcut); newItem->setText(1, shortcut);
// record BindFile representation to recover KeySequence when needed. // record BindFile representation to recover KeySequence when needed.
newItem->setData(1, Qt::UserRole, toqstr(seq.print(KeySequence::BindFile))); newItem->setData(1, Qt::UserRole, toqstr(seq.print(KeySequence::BindFile)));
setItemType(newItem, item_tag); setItemType(newItem, tag);
return newItem; return newItem;
} }

View File

@ -348,7 +348,6 @@ void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const
int const ww = max(textdim.wid, w); int const ww = max(textdim.wid, w);
pi.pain.rectText(x + (ww - w) / 2, y + desc + a, pi.pain.rectText(x + (ww - w) / 2, y + desc + a,
buttonLabel(bv), font, Color_none, Color_none); buttonLabel(bv), font, Color_none, Color_none);
desc += d;
} }
// a visual cue when the cursor is inside the inset // a visual cue when the cursor is inside the inset

View File

@ -616,10 +616,8 @@ void InsetExternal::setParams(InsetExternalParams const & p)
LASSERT(false, return); LASSERT(false, return);
break; break;
case PREVIEW_INSTANT: { case PREVIEW_INSTANT: {
//FIXME: why is the value below immediately forgotten?
RenderMonitoredPreview * preview_ptr = renderer_->asMonitoredPreview();
renderer_.reset(new RenderMonitoredPreview(this)); renderer_.reset(new RenderMonitoredPreview(this));
preview_ptr = renderer_->asMonitoredPreview(); RenderMonitoredPreview * preview_ptr = preview_ptr = renderer_->asMonitoredPreview();
preview_ptr->fileChanged(bind(&InsetExternal::fileChanged, this)); preview_ptr->fileChanged(bind(&InsetExternal::fileChanged, this));
if (preview_ptr->monitoring()) if (preview_ptr->monitoring())
preview_ptr->stopMonitoring(); preview_ptr->stopMonitoring();

View File

@ -6231,7 +6231,6 @@ bool InsetTabular::insertPlaintextString(BufferView & bv, docstring const & buf,
if (usePaste) { if (usePaste) {
paste_tabular.reset(new Tabular(buffer_, rows, maxCols)); paste_tabular.reset(new Tabular(buffer_, rows, maxCols));
loctab = paste_tabular.get(); loctab = paste_tabular.get();
cols = 0;
dirtyTabularStack(true); dirtyTabularStack(true);
} else { } else {
loctab = &tabular; loctab = &tabular;

View File

@ -592,7 +592,6 @@ string escape_for_regex(string s, bool match_latex)
} }
if (end_pos == s.size()) { if (end_pos == s.size()) {
s.replace(new_pos, end_pos - new_pos, t); s.replace(new_pos, end_pos - new_pos, t);
pos = s.size();
LYXERR(Debug::FIND, "Regexp after \\regexp{} removal: " << s); LYXERR(Debug::FIND, "Regexp after \\regexp{} removal: " << s);
break; break;
} }
@ -1224,12 +1223,10 @@ int findBackwardsAdv(DocIterator & cur, MatchStringAdv & match)
return 0; return 0;
cur.backwardPos(); cur.backwardPos();
DocIterator cur_orig(cur); DocIterator cur_orig(cur);
bool found_match;
bool pit_changed = false; bool pit_changed = false;
found_match = false;
do { do {
cur.pos() = 0; cur.pos() = 0;
found_match = match(cur, -1, false); bool found_match = match(cur, -1, false);
if (found_match) { if (found_match) {
if (pit_changed) if (pit_changed)