Skip to content

Commit 3d01c0c

Browse files
author
Kasper Peeters
committed
Eliminated all clang warnings.
1 parent f8785a4 commit 3d01c0c

File tree

9 files changed

+27
-17
lines changed

9 files changed

+27
-17
lines changed

gui/window.cc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,8 @@ VisualCell *NotebookCanvas::add_cell(Glib::RefPtr<DataCell> dc, Glib::RefPtr<Dat
488488
std::ostringstream fstr;
489489
fstr << THEFONT << " " << 12+(doc.font_step*2);
490490
newcell->inbox=manage( new ExpressionInput(dc->textbuf, fstr.str()) );
491-
Gtk::VBox::BoxList::iterator newit=bl.insert(gtkit, *newcell->inbox);
491+
// Gtk::VBox::BoxList::iterator newit=
492+
bl.insert(gtkit, *newcell->inbox);
492493

493494
gtk_box_set_child_packing(((Gtk::Box *)(&scrollbox))->gobj(),
494495
((Gtk::Widget *)(newcell->inbox))->gobj(),
@@ -517,7 +518,8 @@ VisualCell *NotebookCanvas::add_cell(Glib::RefPtr<DataCell> dc, Glib::RefPtr<Dat
517518
case DataCell::c_texcomment:
518519
case DataCell::c_comment: {
519520
newcell->outbox=manage( new TeXView(dc->texbuf) );
520-
Gtk::VBox::BoxList::iterator newit=bl.insert(gtkit, *newcell->outbox);
521+
// Gtk::VBox::BoxList::iterator newit=
522+
bl.insert(gtkit, *newcell->outbox);
521523
// REPORT BUG: this sometimes segfaults
522524
// (*newit).set_options(Gtk::PACK_SHRINK);
523525
gtk_box_set_child_packing(((Gtk::Box *)(&scrollbox))->gobj(),
@@ -542,7 +544,8 @@ VisualCell *NotebookCanvas::add_cell(Glib::RefPtr<DataCell> dc, Glib::RefPtr<Dat
542544
sigc::bind(
543545
sigc::mem_fun(doc, &XCadabra::handle_tex_update_request), this, newcell));
544546

545-
Gtk::VBox::BoxList::iterator newit=bl.insert(gtkit, *newcell->texbox);
547+
// Gtk::VBox::BoxList::iterator newit=
548+
bl.insert(gtkit, *newcell->texbox);
546549

547550
gtk_box_set_child_packing(((Gtk::Box *)(&scrollbox))->gobj(),
548551
((Gtk::Widget *)(newcell->texbox))->gobj(),
@@ -1593,7 +1596,8 @@ Glib::RefPtr<DataCell> XCadabra::add_cell(Glib::RefPtr<DataCell> newcell, Glib::
15931596
}
15941597
}
15951598

1596-
Gtk::Allocation al=get_allocation();
1599+
// Gtk::Allocation al=
1600+
get_allocation();
15971601

15981602
try {
15991603
switch(newcell->cell_type) {
@@ -3284,7 +3288,7 @@ std::string XCadabra::load_config()
32843288
if(rl.size()>0 && rl[0]=='#')
32853289
continue;
32863290

3287-
unsigned int pos=rl.find(":=");
3291+
size_t pos=rl.find(":=");
32883292
if(pos==std::string::npos) {
32893293
str << "Error parsing ~/.xcadabra on line " << line << std::endl;
32903294
return str.str();

src/algorithm.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ void algorithm::pushup_multiplier(iterator it)
713713
// txtout << "PUSHUP: " << *it->name << std::endl;
714714
if(tr.is_valid(tr.parent(it))) {
715715
// txtout << "test propinherit" << std::endl;
716-
iterator tmp=tr.parent(it);
716+
// iterator tmp=tr.parent(it);
717717
// tmp not always valid?!? This one crashes hard with a loop!?!
718718
// txtout << " of " << *tmp->name << std::endl;
719719
const PropertyInherit *pin=properties::get<PropertyInherit>(tr.parent(it));
@@ -823,7 +823,7 @@ bool algorithm::check_consistency(iterator it) const
823823
w1.start();
824824
debugout << "checking consistency ... " << std::flush;
825825
assert(*it->name=="\\expression");
826-
iterator entry=it;
826+
// iterator entry=it;
827827
iterator end=it;
828828
end.skip_children();
829829
++end;

src/manipulator.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ bool manipulator::getline_precut(std::istream& str, std::string& buf)
283283
if(getline_precut_buffer.size()==0 || getline_was_eof) {
284284
std::string input_now;
285285
getline_was_eof=false;
286-
if(std::getline(str, input_now)==false)
286+
if(!std::getline(str, input_now))
287287
return false;
288288
getline_precut_buffer+=input_now;
289289
}
@@ -770,7 +770,8 @@ nset_t::iterator manipulator::collect_labels_(exptree& tr, exptree::iterator it)
770770
nset_t::iterator name=tr.child(sit,0)->name;
771771
// insert a label
772772
iterator lit=tr.insert(it, str_node("\\label", str_node::b_no));
773-
iterator nameit=tr.append_child(lit, str_node(*name, str_node::b_none));
773+
// iterator nameit=
774+
tr.append_child(lit, str_node(*name, str_node::b_none));
774775
// remove the declare node
775776
tr.flatten(sit);
776777
sit=tr.erase(sit);
@@ -1142,7 +1143,8 @@ exptree::iterator manipulator::run_procedure(exptree::iterator proc, long collec
11421143
collectcount=0;
11431144
collected=true;
11441145
txtout << "collecting terms; of " << expressions.number_of_children(act) << " terms ";
1145-
sibling_iterator from(expressions.begin(act)), to(sib);
1146+
// sibling_iterator from(expressions.begin(act)),
1147+
sibling_iterator to(sib);
11461148
collector.apply(act);
11471149
// collector.apply(from, to);
11481150
txtout << expressions.number_of_children(act) << " remain." << std::endl;

src/modules/algebra.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1303,7 +1303,7 @@ bool sumsort::should_swap(iterator obj, int subtree_comparison) const
13031303

13041304

13051305
prodsort::prodsort(exptree& tr, iterator it)
1306-
: algorithm(tr, it), ignore_numbers_(false)
1306+
: algorithm(tr, it) //, ignore_numbers_(false)
13071307
{
13081308
// if(has_argument("IgnoreNumbers")) {
13091309
// txtout << "ignoring numbers" << std::endl;
@@ -3241,6 +3241,8 @@ algorithm::result_t canonicalise::apply(iterator& it)
32413241
// num_to_tree_map.push_back(exptree(i2->first));
32423242
// num_to_tree_map.push_back(exptree(ii->first));
32433243
break;
3244+
default:
3245+
break;
32443246
}
32453247

32463248
vec_perm.push_back(ii->second+1);

src/modules/algebra.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ class prodsort : public algorithm {
287287
virtual result_t apply(iterator&);
288288

289289
private:
290-
bool ignore_numbers_;
290+
// bool ignore_numbers_;
291291
};
292292

293293
class spinorsort : public algorithm {

src/modules/substitute.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include "dummies.hh"
2525

2626
substitute::substitute(exptree& tr, iterator it)
27-
: algorithm(tr, it), start_reporting_outside(false), prodsort_(tr, it)
27+
: algorithm(tr, it), prodsort_(tr, it) // start_reporting_outside(false),
2828
{
2929
if(number_of_args()==0) {
3030
txtout << "substitute: need (list of) replacement rules." << std::endl;
@@ -535,7 +535,8 @@ algorithm::result_t vary::apply(iterator& it)
535535
if(fcit2->is_zero()==false && res==algorithm::l_applied) {
536536
expression_modified=true;
537537
// txtout << "new term\n";
538-
iterator newterm=result.append_child(newsum, it);
538+
// iterator newterm=
539+
result.append_child(newsum, it);
539540
}
540541

541542
// restore original

src/modules/substitute.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class substitute : public algorithm {
4848
std::vector<bool> lhs_contains_dummies, rhs_contains_dummies;
4949

5050
stopwatch tmr;
51-
bool start_reporting_outside;
51+
// bool start_reporting_outside;
5252

5353
// For object swap testing routines:
5454
prodsort prodsort_;

src/modules/tableaux.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ algorithm::result_t young_project_product::apply(iterator& it)
535535
// Distribute this projected factor over all existing terms in rep,
536536
sibling_iterator trm=rep.begin(topsum);
537537
while(trm!=rep.end(topsum)) {
538-
iterator tmp=trm;
538+
// iterator tmp=trm;
539539
sibling_iterator nxttrm=trm;
540540
++nxttrm;
541541

src/tree_regression_tests.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ int test2()
8787
h1 =tr.append_child(body, "h1");
8888
bh1 =tr.insert(h1,"before h1");
8989
sometext = tr.append_child(h1, "some text");
90-
tree<std::string>::sibling_iterator more_text=tr.append_child(body, "more text");
90+
// tree<std::string>::sibling_iterator more_text=
91+
tr.append_child(body, "more text");
9192

9293
res*=compare_tree("basic algorithms", tr, "extra\nhtml(body(before h1, h1(some text), more text))");
9394

0 commit comments

Comments
 (0)