From dc04c2a317d9e7ea799d78d5b4e9bf28997ca46f Mon Sep 17 00:00:00 2001 From: sgimenez Date: Fri, 23 Jan 2009 21:55:34 +0000 Subject: [PATCH] small cleanup in src/trace (warnings and trailing spaces) --- src/trace/siox.cpp | 32 +++++++++++++++----------------- src/trace/siox.h | 6 +++--- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/trace/siox.cpp b/src/trace/siox.cpp index adddd5f44..b3404fc00 100644 --- a/src/trace/siox.cpp +++ b/src/trace/siox.cpp @@ -119,7 +119,7 @@ void CieLab::init() _clab_inited_ = true; } } - + /** @@ -380,7 +380,7 @@ SioxImage::~SioxImage() /** * Error logging */ -void SioxImage::error(char *fmt, ...) +void SioxImage::error(const char *fmt, ...) { char msgbuf[256]; va_list args; @@ -430,7 +430,7 @@ void SioxImage::setPixel(unsigned int x, return; } unsigned long offset = width * y + x; - pixdata[offset] = pixval; + pixdata[offset] = pixval; } /** @@ -438,8 +438,8 @@ void SioxImage::setPixel(unsigned int x, * If the coordinates are out of range, do nothing. */ void SioxImage::setPixel(unsigned int x, unsigned int y, - unsigned int a, - unsigned int r, + unsigned int a, + unsigned int r, unsigned int g, unsigned int b) { @@ -472,7 +472,7 @@ unsigned int SioxImage::getPixel(unsigned int x, unsigned int y) return 0L; } unsigned long offset = width * y + x; - return pixdata[offset]; + return pixdata[offset]; } /** @@ -498,7 +498,7 @@ void SioxImage::setConfidence(unsigned int x, return; } unsigned long offset = width * y + x; - cmdata[offset] = confval; + cmdata[offset] = confval; } /** @@ -514,7 +514,7 @@ float SioxImage::getConfidence(unsigned int x, unsigned int y) return 0.0; } unsigned long offset = width * y + x; - return cmdata[offset]; + return cmdata[offset]; } /** @@ -718,7 +718,7 @@ const float Siox::CERTAIN_FOREGROUND_CONFIDENCE=1.0f; */ const float Siox::FOREGROUND_CONFIDENCE=0.8f; -/** +/** * Confidence for foreground or background type being equally likely. */ const float Siox::UNKNOWN_REGION_CONFIDENCE=0.5f; @@ -764,7 +764,7 @@ Siox::~Siox() /** * Error logging */ -void Siox::error(char *fmt, ...) +void Siox::error(const char *fmt, ...) { char msgbuf[256]; va_list args; @@ -781,7 +781,7 @@ void Siox::error(char *fmt, ...) /** * Trace logging */ -void Siox::trace(char *fmt, ...) +void Siox::trace(const char *fmt, ...) { char msgbuf[256]; va_list args; @@ -944,14 +944,14 @@ SioxImage Siox::extractForeground(const SioxImage &originalImage, trace("### Analyzing image"); std::map hs; - + unsigned int progressResolution = pixelCount / 10; for (unsigned int i=0; i &inputVec, { error("Could not allocate buffer for signature"); return false; - } + } for (unsigned int i=0 ; i < length ; i++) input[i] = inputVec[i]; @@ -1643,7 +1641,7 @@ void Siox::normalizeMatrix(float *cm, int cmSize) float max= -1000000.0f; for (int i=0; i max) max=cm[i]; - + //good to use STL, but max() is not iterative //float max = *std::max(cm, cm + cmSize); diff --git a/src/trace/siox.h b/src/trace/siox.h index 42fd30421..6b7256fe0 100644 --- a/src/trace/siox.h +++ b/src/trace/siox.h @@ -374,7 +374,7 @@ private: /** * Error logging */ - void error(char *fmt, ...) G_GNUC_PRINTF(2,3); + void error(const char *fmt, ...) G_GNUC_PRINTF(2,3); }; @@ -562,12 +562,12 @@ private: /** * Error logging */ - void error(char *fmt, ...) G_GNUC_PRINTF(2,3); + void error(const char *fmt, ...) G_GNUC_PRINTF(2,3); /** * Trace logging */ - void trace(char *fmt, ...) G_GNUC_PRINTF(2,3); + void trace(const char *fmt, ...) G_GNUC_PRINTF(2,3); /** * Stage 1 of the color signature work. 'dims' will be either -- 2.30.2