From 4ca760d9c93eb36559aadcc7c22ceddbb8a1d84f Mon Sep 17 00:00:00 2001 From: "marina.kolpakova" Date: Thu, 6 Dec 2012 13:04:26 +0400 Subject: [PATCH] debug output information. --- apps/sft/include/sft/common.hpp | 10 ++++++++++ apps/sft/octave.cpp | 8 ++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/apps/sft/include/sft/common.hpp b/apps/sft/include/sft/common.hpp index e1ad526..25bd699 100644 --- a/apps/sft/include/sft/common.hpp +++ b/apps/sft/include/sft/common.hpp @@ -56,5 +56,15 @@ namespace sft typedef std::vector svector; } +// used for noisy printfs +#define WITH_DEBUG_OUT + +#if defined WITH_DEBUG_OUT +# include +# define dprintf(format, ...) \ + do { printf(format, ##__VA_ARGS__); } while (0) +#else +# define dprintf(format, ...) +#endif #endif \ No newline at end of file diff --git a/apps/sft/octave.cpp b/apps/sft/octave.cpp index c8004b7..613d4c6 100644 --- a/apps/sft/octave.cpp +++ b/apps/sft/octave.cpp @@ -147,7 +147,7 @@ void glob(const string& path, svector& ret) for(uint i = 0; i < glob_result.gl_pathc; ++i) { ret.push_back(std::string(glob_result.gl_pathv[i])); - // dprintf("%s\n", ret[i].c_str()); + dprintf("%s\n", ret[i].c_str()); } globfree(&glob_result); @@ -158,12 +158,12 @@ void glob(const string& path, svector& ret) // 2. negatives: /octave_/neg/*.png Dataset::Dataset(const string& path, const int oct) { - // dprintf("%s\n", "get dataset file names..."); + dprintf("%s\n", "get dataset file names..."); - // dprintf("%s\n", "Positives globbing..."); + dprintf("%s\n", "Positives globbing..."); glob(path + "/pos/octave_" + itoa(oct) + "/*.png", pos); - // dprintf("%s\n", "Negatives globbing..."); + dprintf("%s\n", "Negatives globbing..."); glob(path + "/neg/octave_" + itoa(oct) + "/*.png", neg); // Check: files not empty -- 2.7.4