Commit d92a1e52 authored by Roland Levillain's avatar Roland Levillain
Browse files

Address compiler warnings in Scribo.

	* scribo/debug/logger.hh
	(scribo::debug::internal::logger_::log) [!SCRIBO_NDEBUG]:
	Avoid warnings about unused arguments in non-debug mode.
	* scribo/layout/xy_cut.hh
	(scribo::layout::internal::compute_hist_info_h)
	(scribo::layout::internal::compute_hist_info_v):
	Use `def::coord' instead of `int' as coordinate type, to avoid
	comparisons between signed and unsigned values.
	* src/misc/rectangularity.cc (main)
	* tests/binarization/global_threshold.cc (main)
	* tests/layout/xy_cut.cc (main):
	Avoid warnings about unused arguments.
	* tests/core/object_groups.cc (main): Likewise.
	Use `unsigned' instead of `int' as count/id type, to avoid
	comparisons between signed and unsigned values.
parent 405e0aab
2014-06-27 Roland Levillain <roland@lrde.epita.fr>
Address compiler warnings in Scribo.
* scribo/debug/logger.hh
(scribo::debug::internal::logger_::log) [!SCRIBO_NDEBUG]:
Avoid warnings about unused arguments in non-debug mode.
* scribo/layout/xy_cut.hh
(scribo::layout::internal::compute_hist_info_h)
(scribo::layout::internal::compute_hist_info_v):
Use `def::coord' instead of `int' as coordinate type, to avoid
comparisons between signed and unsigned values.
* src/misc/rectangularity.cc (main)
* tests/binarization/global_threshold.cc (main)
* tests/layout/xy_cut.cc (main):
Avoid warnings about unused arguments.
* tests/core/object_groups.cc (main): Likewise.
Use `unsigned' instead of `int' as count/id type, to avoid
comparisons between signed and unsigned values.
2014-06-26 Roland Levillain <roland@lrde.epita.fr>
Make Scribo more compatible with BSD Make.
......
// Copyright (C) 2011, 2012, 2013 EPITA Research and Development
// Laboratory (LRDE)
// Copyright (C) 2011, 2012, 2013, 2014 EPITA Research and Development
// Laboratory (LRDE).
//
// This file is part of Olena.
//
......@@ -334,6 +334,10 @@ namespace scribo
void
logger_::log(VerboseMode mode, const std::string& text)
{
// Avoid warnings about unused arguments in non-debug mode.
(void) mode;
(void) text;
# ifndef SCRIBO_NDEBUG
if (verbose_mode_ < mode)
return;
......
// Copyright (C) 2013 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2013, 2014 EPITA Research and Development Laboratory (LRDE).
//
// This file is part of Olena.
//
......@@ -92,10 +92,10 @@ namespace scribo
unsigned accumulator = 0;
for (unsigned i = geom::min_row(input); i <= geom::max_row(input); ++i)
for (def::coord i = geom::min_row(input); i <= geom::max_row(input); ++i)
{
accumulator = 0;
for (unsigned j = geom::min_col(input); j <= geom::max_col(input); ++j)
for (def::coord j = geom::min_col(input); j <= geom::max_col(input); ++j)
{
if (input.at_(i, j))
++accumulator;
......@@ -124,10 +124,10 @@ namespace scribo
unsigned accumulator = 0;
for (unsigned j = geom::min_col(input); j <= geom::max_col(input); ++j)
for (def::coord j = geom::min_col(input); j <= geom::max_col(input); ++j)
{
accumulator = 0;
for (unsigned i = geom::min_row(input); i <= geom::max_row(input); ++i)
for (def::coord i = geom::min_row(input); i <= geom::max_row(input); ++i)
{
if (input.at_(i, j))
++accumulator;
......
......@@ -50,7 +50,7 @@
#include <scribo/make/debug_filename.hh>
int main(int argc, char *argv[])
int main(int /* argc */, char *argv[])
{
using namespace mln;
......
// Copyright (C) 2010, 2011 EPITA Research and Development Laboratory
// (LRDE)
// Copyright (C) 2010, 2011, 2014 EPITA Research and Development
// Laboratory (LRDE).
//
// This file is part of Olena.
//
......@@ -32,7 +32,7 @@
#include <scribo/binarization/global_threshold.hh>
int main(int argc, char *argv[])
int main()
{
using namespace mln;
......
// Copyright (C) 2011 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2011, 2014 EPITA Research and Development Laboratory (LRDE).
//
// This file is part of Olena.
//
......@@ -38,15 +38,16 @@
#include "tests/data.hh"
int main(int argc, char *argv[])
int main()
{
using namespace mln;
using namespace scribo;
std::string img = SCRIBO_IMG_DIR "/the_valleys.pbm";
static const int comp_to_group_ref[] = { 0, 1, 4, 2, 3, 2, 2, 4, 4, 2, 2, 2, 2 };
static const int pixel_area_ref[] = { 0, 3, 973, 39, 426 };
static const unsigned comp_to_group_ref[] =
{ 0, 1, 4, 2, 3, 2, 2, 4, 4, 2, 2, 2, 2 };
static const unsigned pixel_area_ref[] = { 0, 3, 973, 39, 426 };
static const box2d bbox_ref[] = {
box2d(),
make::box2d(0,91, 1,92),
......@@ -55,7 +56,7 @@ int main(int argc, char *argv[])
make::box2d(9,12, 36,64)
};
static const int comp_ids_count_ref[] = { 0, 1, 7, 1, 3 };
static const unsigned comp_ids_count_ref[] = { 0, 1, 7, 1, 3 };
static const int comp_ids_ref[][7] = {
{ 0, 0, 0, 0, 0, 0, 0 },
{ 1, 0, 0, 0, 0, 0, 0 },
......@@ -81,7 +82,7 @@ int main(int argc, char *argv[])
mln_assertion(group.comp_to_group().nelements() == 13);
// Checking comp_to_group()
for (int i = 0; i < group.comp_to_group().nelements(); ++i)
for (unsigned i = 0; i < group.comp_to_group().nelements(); ++i)
mln_assertion(group.comp_to_group()[i] == comp_to_group_ref[i]);
// Checking group info data.
......@@ -91,7 +92,8 @@ int main(int argc, char *argv[])
mln_assertion(group(g).is_valid());
mln_assertion(group(g).pixel_area() == pixel_area_ref[g]);
mln_assertion(group(g).bbox() == bbox_ref[g]);
mln_assertion(group(g).component_ids().nelements() == comp_ids_count_ref[g]);
mln_assertion(group(g).component_ids().nelements()
== comp_ids_count_ref[g]);
for_all_elements(e, group(g).component_ids())
mln_assertion(group(g).component_ids()[e] == comp_ids_ref[g][e]);
......
// Copyright (C) 2013 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2013, 2014 EPITA Research and Development Laboratory (LRDE).
//
// This file is part of Olena.
//
......@@ -34,7 +34,7 @@
using namespace mln;
int main(int argc, char** argv)
int main()
{
image2d<bool> input;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment