From 5b9c3a02362645cf1095086d446e8eb0b0f75166 Mon Sep 17 00:00:00 2001 From: Andreas Schenk <andreas@localhost.localdomain> Date: Fri, 23 Aug 2013 11:17:03 -0400 Subject: [PATCH] removed unused variables and added static cast to silence warnings --- modules/conop/src/diag.cc | 2 +- modules/geom/tests/test_transform.cc | 11 ----------- modules/gfx/src/bitmap_io.cc | 5 ++--- modules/gfx/src/exporter.cc | 1 - modules/gfx/src/impl/backbone_trace.cc | 2 -- modules/gfx/src/impl/entity_detail.cc | 2 -- modules/gfx/src/render_options/render_options.cc | 1 - .../src/python_shell/python_namespace_tree_item.cc | 4 ---- modules/gui/src/widget_geom_handler.cc | 1 - modules/img/base/tests/test_value_holder.cc | 2 -- modules/io/pymod/export_mmcif_io.cc | 4 ---- modules/io/src/img/map_io_png_handler.cc | 3 +-- modules/io/src/mol/mmcif_reader.cc | 6 +++--- modules/mol/alg/src/lddt.cc | 3 --- 14 files changed, 7 insertions(+), 40 deletions(-) diff --git a/modules/conop/src/diag.cc b/modules/conop/src/diag.cc index 470673bf7..cf7147ede 100644 --- a/modules/conop/src/diag.cc +++ b/modules/conop/src/diag.cc @@ -79,7 +79,7 @@ String Diag::Format(bool colored) const char *end=NULL; long int id=strtol(start, &end, 10); assert(start!=end); - assert(id>=0 && id<strings.size()); + assert(id>=0 && static_cast<unsigned long>(id)<strings.size()); if (plural_s) { if (ints_[args_[id].index]!=1) { ss << "s"; diff --git a/modules/geom/tests/test_transform.cc b/modules/geom/tests/test_transform.cc index ae27fd594..8ac2ce97b 100644 --- a/modules/geom/tests/test_transform.cc +++ b/modules/geom/tests/test_transform.cc @@ -44,17 +44,6 @@ BOOST_AUTO_TEST_CASE(test_transform_essentials) tf.SetTrans(tra); tf.SetCenter(cen); - Mat4 tmat = - geom::Mat4(1.0,0.0,0.0,tra[0], - 0.0,1.0,0.0,tra[1], - 0.0,0.0,1.0,tra[2], - 0.0,0.0,0.0,1.0) * - geom::Mat4(rot) * - geom::Mat4(1.0,0.0,0.0,-cen[0], - 0.0,1.0,0.0,-cen[1], - 0.0,0.0,1.0,-cen[2], - 0.0,0.0,0.0,1.0); - BOOST_CHECK_EQUAL(tf.GetRot(), rot); BOOST_CHECK_EQUAL(tf.GetCenter(), cen); BOOST_CHECK_EQUAL(tf.GetTrans(), tra); diff --git a/modules/gfx/src/bitmap_io.cc b/modules/gfx/src/bitmap_io.cc index ab42f9de5..4245c32ec 100644 --- a/modules/gfx/src/bitmap_io.cc +++ b/modules/gfx/src/bitmap_io.cc @@ -114,7 +114,7 @@ Bitmap import_png(const String& filename) int png_transforms; png_bytep *row_pointers; png_uint_32 row,column,chn; - png_uint_32 width,height,bpp; + png_uint_32 width,height; if((fp=fopen(filename.c_str(),"rb"))==NULL) { LOG_ERROR("error opening " << filename); @@ -158,8 +158,7 @@ Bitmap import_png(const String& filename) width=(unsigned int)png_get_image_width(png_ptr, info_ptr); height=(unsigned int)png_get_image_height(png_ptr, info_ptr); - bpp=(unsigned int)png_get_bit_depth(png_ptr,info_ptr); - + boost::shared_array<unsigned char> data(new unsigned char[width*height*channels]); row_pointers = png_get_rows(png_ptr, info_ptr); diff --git a/modules/gfx/src/exporter.cc b/modules/gfx/src/exporter.cc index 28dbd9b69..5100490c1 100644 --- a/modules/gfx/src/exporter.cc +++ b/modules/gfx/src/exporter.cc @@ -28,7 +28,6 @@ namespace ost { namespace gfx { normal_tf_=geom::Mat3(); geom::Mat4 Tmat,Rmat,Smat,Cmat; if(to_origin_) { - geom::Vec3 trans=scene->GetTransform().GetTrans(); geom::Vec3 cen=scene->GetTransform().GetCenter(); vertex_tf_=geom::Mat4(scene->GetTransform().GetRot()) * geom::Mat4(scale_, 0.0, 0.0, 0.0, diff --git a/modules/gfx/src/impl/backbone_trace.cc b/modules/gfx/src/impl/backbone_trace.cc index efcd761a5..7f5cc8121 100644 --- a/modules/gfx/src/impl/backbone_trace.cc +++ b/modules/gfx/src/impl/backbone_trace.cc @@ -210,8 +210,6 @@ void BackboneTrace::PrepList(NodeEntryList& nelist) const // start loop with the second residue unsigned int i=1; for(;i<nelist.size()-1;++i) { - geom::Vec3 p10=p0-p1; - geom::Vec3 p12=p2-p1; dir=geom::Normalize(p2-p0); e1->direction = dir; orth=geom::Normalize(geom::Cross(dir,e1->normal)); diff --git a/modules/gfx/src/impl/entity_detail.cc b/modules/gfx/src/impl/entity_detail.cc index 407654cfc..7e7f65989 100644 --- a/modules/gfx/src/impl/entity_detail.cc +++ b/modules/gfx/src/impl/entity_detail.cc @@ -311,8 +311,6 @@ SplineEntryList Spline::Generate(const SplineEntryList& entry_list, int nsub, ui sublist.at(0).direction=geom::Normalize(p1-p0); unsigned int i=1; for(;i<sublist.size()-1;++i) { - geom::Vec3 p10 = p0-p1; - geom::Vec3 p12 = p2-p1; geom::Vec3 dir=geom::Normalize(p2-p0); sublist.at(i).direction=dir; geom::Vec3 orth=geom::Normalize(geom::Cross(dir,sublist[i].normal)); diff --git a/modules/gfx/src/render_options/render_options.cc b/modules/gfx/src/render_options/render_options.cc index 0c5597b33..660ffa894 100644 --- a/modules/gfx/src/render_options/render_options.cc +++ b/modules/gfx/src/render_options/render_options.cc @@ -51,7 +51,6 @@ bool RenderOptions::RemoveObserver(EntityP entity) void RenderOptions::NotifyStateChange() { - InputEvent event = InputEvent(INPUT_DEVICE_MOUSE,INPUT_COMMAND_REBUILD,0); EntityPObservers::const_iterator observers_it = this->observers_.begin() ; while( observers_it != this->observers_.end() ) { diff --git a/modules/gui/src/python_shell/python_namespace_tree_item.cc b/modules/gui/src/python_shell/python_namespace_tree_item.cc index b3e296090..e16bbede4 100644 --- a/modules/gui/src/python_shell/python_namespace_tree_item.cc +++ b/modules/gui/src/python_shell/python_namespace_tree_item.cc @@ -107,13 +107,9 @@ void PythonNamespaceTreeItem::FetchMore() continue; } bp::object child_namespace; - bool found=false; try{ String keystring=bp::extract<String>(keys[i]); child_namespace=namespace_.attr(keystring.c_str()); - if (bp::len(dir(child_namespace))>0) { - found=true; - } } catch(bp::error_already_set) { PyErr_Clear(); } diff --git a/modules/gui/src/widget_geom_handler.cc b/modules/gui/src/widget_geom_handler.cc index 431fd8ff1..efb6d752a 100644 --- a/modules/gui/src/widget_geom_handler.cc +++ b/modules/gui/src/widget_geom_handler.cc @@ -34,7 +34,6 @@ void WidgetGeomHandler::LoadGeom(const QString& prefix) settings.beginGroup(prefix+this->objectName()); if (settings.contains("pos") && settings.contains("size")) { QPoint pos = settings.value("pos").toPoint(); - QSize size = settings.value("size").toSize(); Qt::WindowStates state = Qt::WindowStates(settings.value("state").toInt()); widget_->move(pos); widget_->setWindowState(state); diff --git a/modules/img/base/tests/test_value_holder.cc b/modules/img/base/tests/test_value_holder.cc index f5b09f938..bd0cacbd6 100644 --- a/modules/img/base/tests/test_value_holder.cc +++ b/modules/img/base/tests/test_value_holder.cc @@ -91,8 +91,6 @@ test_suite* CreateValueHolderTest() { using namespace value_holder_test; - typedef boost::mpl::vector<Real, Complex> values; - test_suite* ts=BOOST_TEST_SUITE("ValueHolder Test"); ts->add( BOOST_TEST_CASE(ReadWrite<Real>) ); diff --git a/modules/io/pymod/export_mmcif_io.cc b/modules/io/pymod/export_mmcif_io.cc index d32133571..f798ba8c9 100644 --- a/modules/io/pymod/export_mmcif_io.cc +++ b/modules/io/pymod/export_mmcif_io.cc @@ -99,7 +99,6 @@ void export_mmcif_io() &MMCifInfoCitation::SetAuthorList) ; - typedef std::vector<MMCifInfoCitation> MMCifInfoCitationList; class_<std::vector<MMCifInfoCitation> >("MMCifInfoCitationList", init<>()) .def(vector_indexing_suite<std::vector<MMCifInfoCitation> >()) ; @@ -124,7 +123,6 @@ void export_mmcif_io() &MMCifInfoTransOp::SetMatrix) ; - typedef std::vector<MMCifInfoTransOp> MMCifInfoTransOpList; class_<std::vector<MMCifInfoTransOp> >("MMCifInfoTransOpList", init<>()) .def(vector_indexing_suite<std::vector<MMCifInfoTransOp> >()) ; @@ -134,7 +132,6 @@ void export_mmcif_io() .def(vector_indexing_suite<std::vector<MMCifInfoTransOpPtr>, true >()) ; - typedef std::vector<MMCifInfoTransOpPtrList > MMCifInfoTransOpPtrListList; class_<std::vector<MMCifInfoTransOpPtrList > >("MMCifInfoTransOpPtrListList", init<>()) .def(vector_indexing_suite<std::vector<MMCifInfoTransOpPtrList >, true >()) @@ -227,7 +224,6 @@ void export_mmcif_io() class_<MMCifInfoStructRefSeqDifs>("MMCifInfoStructRefSeqDifs", init<>()) .def(vector_indexing_suite<MMCifInfoStructRefSeqDifs, true>()) ; - typedef std::vector<MMCifInfoBioUnit> MMCifInfoBioUnitList; class_<std::vector<MMCifInfoBioUnit> >("MMCifInfoBioUnitList", init<>()) .def(vector_indexing_suite<std::vector<MMCifInfoBioUnit> >()) ; diff --git a/modules/io/src/img/map_io_png_handler.cc b/modules/io/src/img/map_io_png_handler.cc index d77db114b..61156a58b 100644 --- a/modules/io/src/img/map_io_png_handler.cc +++ b/modules/io/src/img/map_io_png_handler.cc @@ -111,7 +111,7 @@ void MapIOPngHandler::Import(img::MapHandle& image, std::istream& f,const ImageF png_bytep *row_pointers; png_uint_32 row,column; png_byte *png_data; - png_uint_32 width,height,bpp; + png_uint_32 width,height; std::ostringstream mesg; PNG form; @@ -156,7 +156,6 @@ void MapIOPngHandler::Import(img::MapHandle& image, std::istream& f,const ImageF width=(unsigned int)png_get_image_width(png_ptr, info_ptr); height=(unsigned int)png_get_image_height(png_ptr, info_ptr); - bpp=(unsigned int)png_get_bit_depth(png_ptr,info_ptr); // TODO 16 bit greyscale diff --git a/modules/io/src/mol/mmcif_reader.cc b/modules/io/src/mol/mmcif_reader.cc index 52cd7e1ae..619daac3c 100644 --- a/modules/io/src/mol/mmcif_reader.cc +++ b/modules/io/src/mol/mmcif_reader.cc @@ -374,9 +374,9 @@ bool MMCifReader::ParseAtomIdent(const std::vector<StringRef>& columns, return false; } - std::pair<bool, int> a_num = this->TryGetInt(columns[indices_[AS_ID]], - "atom_site.id", - profile_.fault_tolerant); // unit test + this->TryGetInt(columns[indices_[AS_ID]], + "atom_site.id", + profile_.fault_tolerant); // unit test alt_loc = columns[indices_[LABEL_ALT_ID]][0]; res_name = columns[indices_[LABEL_COMP_ID]]; diff --git a/modules/mol/alg/src/lddt.cc b/modules/mol/alg/src/lddt.cc index 2509a0af9..c4c9ba5aa 100644 --- a/modules/mol/alg/src/lddt.cc +++ b/modules/mol/alg/src/lddt.cc @@ -506,7 +506,6 @@ int main (int argc, char **argv) ResNum rnum = ritv.GetNumber(); bool assessed = false; String assessed_string="No"; - bool quality_problems = false; String quality_problems_string="No"; Real lddt_local = -1; String lddt_local_string="-"; @@ -519,12 +518,10 @@ int main (int argc, char **argv) } if (ritv.HasProp("stereo_chemical_violation_sidechain") || ritv.HasProp("steric_clash_sidechain")) { - quality_problems = true; quality_problems_string="Yes"; } if (ritv.HasProp("stereo_chemical_violation_backbone") || ritv.HasProp("steric_clash_backbone")) { - quality_problems = true; quality_problems_string="Yes+"; } -- GitLab