Skip to content

Commit

Permalink
Improved whitespace to fix g++ 7 warning
Browse files Browse the repository at this point in the history
.../ros_comm/tools/rosbag_storage/src/view.cpp:249:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
     if ((bag.getMode() & bagmode::Read) != bagmode::Read)
     ^~
.../ros_comm/tools/rosbag_storage/src/view.cpp:252:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
  boost::function<bool(ConnectionInfo const*)> query = TrueQuery();
  ^~~~~
  • Loading branch information
racko committed Aug 12, 2017
1 parent 548cf9e commit 8741466
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tools/rosbag_storage/src/view.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) 2009, Willow Garage, Inc.
// All rights reserved.
//
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
Expand All @@ -12,7 +12,7 @@
// * Neither the name of Willow Garage, Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Expand Down Expand Up @@ -135,13 +135,13 @@ void View::iterator::increment() {
if (view_->reduce_overlap_)
{
std::multiset<IndexEntry>::const_iterator last_iter = iters_.back().iter;

while (iters_.back().iter == last_iter)
{
iters_.back().iter++;
if (iters_.back().iter == iters_.back().range->end)
iters_.pop_back();

std::sort(iters_.begin(), iters_.end(), ViewIterHelperCompare());
}

Expand All @@ -150,7 +150,7 @@ void View::iterator::increment() {
iters_.back().iter++;
if (iters_.back().iter == iters_.back().range->end)
iters_.pop_back();

std::sort(iters_.begin(), iters_.end(), ViewIterHelperCompare());
}
}
Expand All @@ -169,11 +169,11 @@ MessageInstance& View::iterator::dereference() const {
View::View(bool const& reduce_overlap) : view_revision_(0), size_cache_(0), size_revision_(0), reduce_overlap_(reduce_overlap) { }

View::View(Bag const& bag, ros::Time const& start_time, ros::Time const& end_time, bool const& reduce_overlap) : view_revision_(0), size_cache_(0), size_revision_(0), reduce_overlap_(reduce_overlap) {
addQuery(bag, start_time, end_time);
addQuery(bag, start_time, end_time);
}

View::View(Bag const& bag, boost::function<bool(ConnectionInfo const*)> query, ros::Time const& start_time, ros::Time const& end_time, bool const& reduce_overlap) : view_revision_(0), size_cache_(0), size_revision_(0), reduce_overlap_(reduce_overlap) {
addQuery(bag, query, start_time, end_time);
addQuery(bag, query, start_time, end_time);
}

View::~View() {
Expand Down Expand Up @@ -226,7 +226,7 @@ View::iterator View::begin() {
//! Default constructed iterator signifies end
View::iterator View::end() { return iterator(this, true); }

uint32_t View::size() {
uint32_t View::size() {

update();

Expand All @@ -249,7 +249,7 @@ void View::addQuery(Bag const& bag, ros::Time const& start_time, ros::Time const
if ((bag.getMode() & bagmode::Read) != bagmode::Read)
throw BagException("Bag not opened for reading");

boost::function<bool(ConnectionInfo const*)> query = TrueQuery();
boost::function<bool(ConnectionInfo const*)> query = TrueQuery();

queries_.push_back(new BagQuery(&bag, Query(query, start_time, end_time), bag.bag_revision_));

Expand Down Expand Up @@ -302,7 +302,7 @@ void View::updateQueries(BagQuery* q) {
bool found = false;
for (vector<MessageRange*>::iterator k = ranges_.begin(); k != ranges_.end(); k++) {
MessageRange* r = *k;

// If the topic and query are already in our ranges, we update
if (r->bag_query == q && r->connection_info->id == connection->id) {
r->begin = begin;
Expand Down

0 comments on commit 8741466

Please sign in to comment.