Skip to content

Commit

Permalink
fix a few -Wsign-compare warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Dane Springmeyer committed May 19, 2014
1 parent 84fdc9e commit d3d0704
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ifeq (sizes,$(firstword $(MAKECMDGOALS)))
.PHONY: $(RUN_ARGS)
endif

all: out/bench-variant
all: out/bench-variant out/unique_ptr_test out/unique_ptr_test out/recursive_wrapper_test out/binary_visitor_test

out/bench-variant-debug: Makefile test/bench_variant.cpp variant.hpp
mkdir -p ./out
Expand Down
2 changes: 1 addition & 1 deletion test/binary_visitor_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ struct javascript_equal

}

int main (int argc, char** argv)
int main (/*int argc, char** argv*/)
{
//typedef util::variant<int, std::string> variant_type;
typedef util::variant<bool, int64_t, uint64_t, double, std::string> variant_type;
Expand Down
6 changes: 3 additions & 3 deletions test/recursive_wrapper_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ int main (int argc, char** argv)
return EXIT_FAILURE;
}

std::size_t const NUM_ITER = std::stoll(argv[1]);
const std::size_t NUM_ITER = static_cast<std::size_t>(std::stol(argv[1]));

test::expression result(util::recursive_wrapper<test::binary_op<test::sub> >(
test::binary_op<test::sub>(
Expand All @@ -119,9 +119,9 @@ int main (int argc, char** argv)
{
boost::timer::auto_cpu_timer t;
std::size_t total = 0;
for (int i = 0; i < NUM_ITER; ++i)
for (std::size_t i = 0; i < NUM_ITER; ++i)
{
total +=util::apply_visitor(result, test::calculator());
total += static_cast<std::size_t>(util::apply_visitor(result, test::calculator()));
}
std::cerr << "total=" << total << std::endl;
}
Expand Down
6 changes: 3 additions & 3 deletions test/unique_ptr_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ int main (int argc, char** argv)
return EXIT_FAILURE;
}

std::size_t const NUM_ITER = std::stoll(argv[1]);
const std::size_t NUM_ITER = static_cast<std::size_t>(std::stol(argv[1]));

test::expression sum(std::unique_ptr<test::binary_op<test::add>>(new test::binary_op<test::add>(2,3)));
test::expression result(std::unique_ptr<test::binary_op<test::sub>>(new test::binary_op<test::sub>(std::move(sum),10)));
Expand All @@ -113,9 +113,9 @@ int main (int argc, char** argv)
{
boost::timer::auto_cpu_timer t;
std::size_t total = 0;
for (int i = 0; i < NUM_ITER; ++i)
for (std::size_t i = 0; i < NUM_ITER; ++i)
{
total +=util::apply_visitor(result, test::calculator());
total += static_cast<std::size_t>(util::apply_visitor(result, test::calculator()));
}
std::cerr << "total=" << total << std::endl;
}
Expand Down

0 comments on commit d3d0704

Please sign in to comment.