From 988c405f79b5e5add8c9f07d9312ddd4670bf25b Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Wed, 20 Jun 2012 16:03:03 +0000 Subject: [PATCH] Fixed build with MSVC --- samples/c/contours.c | 6 ++++-- samples/c/fback_c.c | 4 ++-- samples/c/morphology.c | 6 ++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/samples/c/contours.c b/samples/c/contours.c index e53a25a..58939e4 100644 --- a/samples/c/contours.c +++ b/samples/c/contours.c @@ -19,10 +19,11 @@ CvSeq* contours = 0; static void on_trackbar(int pos) { - (void)pos; IplImage* cnt_img = cvCreateImage( cvSize(w,w), 8, 3 ); CvSeq* _contours = contours; int _levels = levels - 3; + (void)pos; + if( _levels <= 0 ) // get to the nearest face to make it look more funny _contours = _contours->h_next->h_next->h_next; cvZero( cnt_img ); @@ -53,13 +54,14 @@ static void findCComp( IplImage* img ) int main(int argc, char* argv[]) { - (void)argc; (void)argv; int i, j; CvMemStorage* storage = cvCreateMemStorage(0); IplImage* img = cvCreateImage( cvSize(w,w), 8, 1 ); IplImage* img32f = cvCreateImage( cvSize(w,w), IPL_DEPTH_32F, 1 ); IplImage* img32s = cvCreateImage( cvSize(w,w), IPL_DEPTH_32S, 1 ); IplImage* img3 = cvCreateImage( cvSize(w,w), 8, 3 ); + (void)argc; (void)argv; + help(); cvZero( img ); diff --git a/samples/c/fback_c.c b/samples/c/fback_c.c index 2a061e9..af613d2 100644 --- a/samples/c/fback_c.c +++ b/samples/c/fback_c.c @@ -16,8 +16,8 @@ static void help(void) static void drawOptFlowMap(const CvMat* flow, CvMat* cflowmap, int step, double scale, CvScalar color) { - (void)scale; int x, y; + (void)scale; for( y = 0; y < cflowmap->rows; y += step) for( x = 0; x < cflowmap->cols; x += step) { @@ -30,9 +30,9 @@ static void drawOptFlowMap(const CvMat* flow, CvMat* cflowmap, int step, int main( int argc, char** argv ) { - (void)argc; (void)argv; CvCapture* capture = cvCreateCameraCapture(0); CvMat* prevgray = 0, *gray = 0, *flow = 0, *cflow = 0; + (void)argc; (void)argv; help(); diff --git a/samples/c/morphology.c b/samples/c/morphology.c index ac89953..3071490 100644 --- a/samples/c/morphology.c +++ b/samples/c/morphology.c @@ -17,9 +17,10 @@ int erode_dilate_pos = 0; // callback function for open/close trackbar static void OpenClose(int pos) { - (void)pos; int n = open_close_pos - max_iters; int an = n > 0 ? n : -n; + (void)pos; + element = cvCreateStructuringElementEx( an*2+1, an*2+1, an, an, element_shape, 0 ); if( n < 0 ) { @@ -38,9 +39,10 @@ static void OpenClose(int pos) // callback function for erode/dilate trackbar static void ErodeDilate(int pos) { - (void)pos; int n = erode_dilate_pos - max_iters; int an = n > 0 ? n : -n; + (void)pos; + element = cvCreateStructuringElementEx( an*2+1, an*2+1, an, an, element_shape, 0 ); if( n < 0 ) { -- 2.7.4