Skip to content

Commit

Permalink
Making cpplint happier.
Browse files Browse the repository at this point in the history
  • Loading branch information
bingmann committed May 21, 2015
1 parent c5c9a81 commit 85a1b93
Show file tree
Hide file tree
Showing 14 changed files with 58 additions and 59 deletions.
2 changes: 1 addition & 1 deletion CPPLINT.cfg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
filter=-legal/copyright,-whitespace/braces,-whitespace/newline,-build/c++11,-whitespace/line_length,-whitespace/indent,-runtime/references,-whitespace/comments,-runtime/int,-build/header_guard,-whitespace/operators,-readability/braces
filter=-legal/copyright,-whitespace/braces,-whitespace/newline,-build/c++11,-whitespace/line_length,-whitespace/indent,-runtime/references,-whitespace/comments,-runtime/int,-build/header_guard,-whitespace/operators,-readability/braces,-runtime/threadsafe_fn,-build/include
9 changes: 4 additions & 5 deletions speedtest/speedtest-tune.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,17 @@
* this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/

#include <string>
#include <stdlib.h>
#include <sys/time.h>

#include <fstream>
#include <iostream>
#include <iomanip>
#include <string>
#include <cstdlib>
#include <cassert>

#include <stx/btree_multiset.h>

#include <assert.h>

// *** Settings

/// maximum number of items to insert
Expand Down Expand Up @@ -174,7 +173,7 @@ void testrunner_loop(std::ostream& os, unsigned int insertnum, unsigned int slot
// discard and repeat if test took less than one second.
if ((ts2 - ts1) < 1.0) repeatuntil *= 2;
}
while ((ts2 - ts1) < 1.0);
while ((ts2 - ts1) < 1.0); // NOLINT

os << std::fixed << std::setprecision(10)
<< insertnum << " " << slots << " " << ((ts2 - ts1) / runs) << std::endl;
Expand Down
9 changes: 4 additions & 5 deletions speedtest/speedtest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@
* this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/

#include <string>
#include <stdlib.h>
#include <sys/time.h>

#include <fstream>
#include <iostream>
#include <iomanip>
#include <string>
#include <cstdlib>
#include <cassert>

#include <set>
#include <ext/hash_set>
Expand All @@ -36,8 +37,6 @@
#include <tr1/unordered_map>
#include <stx/btree_multimap.h>

#include <assert.h>

// *** Settings

/// starting number of items to insert
Expand Down Expand Up @@ -334,7 +333,7 @@ void testrunner_loop(std::ostream& os, unsigned int items)
// discard and repeat if test took less than one second.
if ((ts2 - ts1) < 1.0) repeatuntil *= 2;
}
while ((ts2 - ts1) < 1.0);
while ((ts2 - ts1) < 1.0); // NOLINT

os << std::fixed << std::setprecision(10)
<< ((ts2 - ts1) / runs) << " " << std::flush;
Expand Down
8 changes: 4 additions & 4 deletions testsuite/BoundTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
* this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/

#include "tpunit.h"

#include <stdlib.h>

#include <stx/btree_multimap.h>

#include <cstdlib>
#include <set>

#include "tpunit.h"

struct BoundTest : public tpunit::TestFixture
{
BoundTest() : tpunit::TestFixture(
Expand Down
10 changes: 5 additions & 5 deletions testsuite/BulkLoadTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
* this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/

#include "tpunit.h"

#include <stdlib.h>
#include <vector>

#include <stx/btree_multiset.h>
#include <stx/btree_multimap.h>
#include <stx/btree_map.h>

#include <cstdlib>
#include <vector>

#include "tpunit.h"

struct BulkLoadTest : public tpunit::TestFixture
{
BulkLoadTest() : tpunit::TestFixture(
Expand Down
7 changes: 3 additions & 4 deletions testsuite/DumpRestoreTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@
* this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/

#include "tpunit.h"

#include <stdlib.h>
#include <stx/btree_multiset.h>

#include <cstdlib>
#include <sstream>
#include <iostream>

#include <stx/btree_multiset.h>
#include "tpunit.h"

struct DumpRestoreTest : public tpunit::TestFixture
{
Expand Down
11 changes: 5 additions & 6 deletions testsuite/IteratorTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,16 @@
* this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/

#include "tpunit.h"

#include <stdlib.h>

#include <vector>

#include <stx/btree_multiset.h>
#include <stx/btree_multimap.h>
#include <stx/btree_map.h>
#include <stx/btree_set.h>

#include <cstdlib>
#include <vector>

#include "tpunit.h"

struct IteratorTest : public tpunit::TestFixture
{
IteratorTest() : tpunit::TestFixture(
Expand Down
10 changes: 5 additions & 5 deletions testsuite/LargeTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
* this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/

#include "tpunit.h"

#include <stdlib.h>
#include <time.h>

#include <stx/btree_multiset.h>

#include <cstdlib>
#include <ctime>
#include <set>

#include "tpunit.h"

struct LargeTest : public tpunit::TestFixture
{
LargeTest() : tpunit::TestFixture(
Expand Down
6 changes: 3 additions & 3 deletions testsuite/RelationTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
* this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/

#include "tpunit.h"
#include <stx/btree_multiset.h>

#include <stdlib.h>
#include <cstdlib>

#include <stx/btree_multiset.h>
#include "tpunit.h"

struct RelationTest : public tpunit::TestFixture
{
Expand Down
10 changes: 5 additions & 5 deletions testsuite/SimpleTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
* this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/

#include "tpunit.h"

#include <stdlib.h>
#include <inttypes.h>

#include <stx/btree_multiset.h>
#include <stx/btree_multimap.h>
#include <stx/btree_map.h>

#include <cstdlib>
#include <inttypes.h>

#include "tpunit.h"

template <int Slots>
struct SimpleTest : public tpunit::TestFixture
{
Expand Down
17 changes: 9 additions & 8 deletions testsuite/StructureTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
* this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/

#include "tpunit.h"
#include <stx/btree_multiset.h>

#include <stdlib.h>
#include <cstdlib>

#include <stx/btree_multiset.h>
#include "tpunit.h"

struct StructureTest : public tpunit::TestFixture
{
Expand All @@ -41,7 +41,7 @@ struct StructureTest : public tpunit::TestFixture
{ }

// also used as implicit conversion constructor
inline testdata(unsigned int _a)
explicit testdata(unsigned int _a)
: a(_a), b(0)
{ }
};
Expand All @@ -50,7 +50,7 @@ struct StructureTest : public tpunit::TestFixture
{
unsigned int somevalue;

inline testcomp(unsigned int sv)
explicit testcomp(unsigned int sv)
: somevalue(sv)
{ }

Expand Down Expand Up @@ -81,21 +81,22 @@ struct StructureTest : public tpunit::TestFixture
for (unsigned int i = 0; i < 320; i++)
{
ASSERT(bt.size() == i);
bt.insert(rand() % 100);
bt.insert(testdata(rand() % 100));
ASSERT(bt.size() == i + 1);
}

srand(34234235);
for (unsigned int i = 0; i < 320; i++)
{
ASSERT(bt.size() == 320 - i);
ASSERT(bt.erase_one(rand() % 100));
ASSERT(bt.erase_one(testdata(rand() % 100)));
ASSERT(bt.size() == 320 - i - 1);
}
}
} _StructureTest;

inline std::ostream& operator << (std::ostream& o, const struct StructureTest::testdata& t)
inline std::ostream& operator << (std::ostream& o,
const struct StructureTest::testdata& t)
{
return o << t.a;
}
Expand Down
8 changes: 4 additions & 4 deletions wxbtreedemo/WMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
* this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/

#include <wx/filedlg.h>
#include <wx/textfile.h>
#include <wx/tokenzr.h>

#include <map>
#include <vector>

#include "WMain.h"
#include "WTreeDrawing.h"

#include <wx/filedlg.h>
#include <wx/textfile.h>
#include <wx/tokenzr.h>

WMain::WMain()
: WMain_wxg(NULL, -1, wxT("STX B+ Tree Demo " VERSION " - http://panthema.net/"))
{
Expand Down
2 changes: 1 addition & 1 deletion wxbtreedemo/WMain.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ class BTreeBundle
}
}

throw (wxT("Program Error: could not find selected B+ tree"));
throw wxT("Program Error: could not find selected B+ tree");
}

// *** Marked Node Slots
Expand Down
8 changes: 5 additions & 3 deletions wxbtreedemo/WTreeDrawing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,11 @@ wxSize WTreeDrawing::BTreeOp_Draw::draw_tree(BTreeType& bt)
// set scroll bar extents
int scrx, scry;
w.GetViewStart(&scrx, &scry);
w.SetScrollbars(10, 10,
int(ts.GetWidth() / 10 * w.scalefactor),
int(ts.GetHeight() / 10 * w.scalefactor), scrx, scry);
w.SetScrollbars(
10, 10,
static_cast<int>(ts.GetWidth() / 10 * w.scalefactor),
static_cast<int>(ts.GetHeight() / 10 * w.scalefactor),
scrx, scry);
w.oldTreeSize = ts;
w.oldscalefactor = w.scalefactor;
}
Expand Down

0 comments on commit 85a1b93

Please sign in to comment.