diff options
| author | Nicolas Dufour <nicoduf@yahoo.fr> | 2011-04-14 06:29:21 +0000 |
|---|---|---|
| committer | JazzyNico <nicoduf@yahoo.fr> | 2011-04-14 06:29:21 +0000 |
| commit | de76d854317e700b1f0297c83f6a1cacc2ffa533 (patch) | |
| tree | 097e2cafc1ee46bc4aa1b9694626273fc1a3fdae /src/trace/potrace/progress.h | |
| parent | add expression evaluator for spinbox input boxes. also knows a little about u... (diff) | |
| download | inkscape-de76d854317e700b1f0297c83f6a1cacc2ffa533.tar.gz inkscape-de76d854317e700b1f0297c83f6a1cacc2ffa533.zip | |
Tracing. Potrace 1.9 update (see http://potrace.sourceforge.net/ChangeLog).
(bzr r10163)
Diffstat (limited to 'src/trace/potrace/progress.h')
| -rw-r--r-- | src/trace/potrace/progress.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/trace/potrace/progress.h b/src/trace/potrace/progress.h index 0e077430d..220639c6e 100644 --- a/src/trace/potrace/progress.h +++ b/src/trace/potrace/progress.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2007 Peter Selinger. +/* Copyright (C) 2001-2010 Peter Selinger. This file is part of Potrace. It is free software and it is covered by the GNU General Public License. See the file COPYING for details. */ @@ -28,7 +28,7 @@ typedef struct progress_s progress_t; static inline void progress_update(double d, progress_t *prog) { double d_scaled; - if (prog->callback != NULL) { + if (prog != NULL && prog->callback != NULL) { d_scaled = prog->min * (1-d) + prog->max * d; if (d == 1.0 || d_scaled >= prog->d_prev + prog->epsilon) { prog->callback(prog->min * (1-d) + prog->max * d, prog->data); @@ -43,7 +43,7 @@ static inline void progress_update(double d, progress_t *prog) { static inline void progress_subrange_start(double a, double b, const progress_t *prog, progress_t *sub) { double min, max; - if (prog->callback == NULL) { + if (prog == NULL || prog->callback == NULL) { sub->callback = NULL; return; } @@ -66,7 +66,7 @@ static inline void progress_subrange_start(double a, double b, const progress_t } static inline void progress_subrange_end(progress_t *prog, progress_t *sub) { - if (prog->callback != NULL) { + if (prog != NULL && prog->callback != NULL) { if (sub->callback == NULL) { progress_update(sub->b, prog); } else { |
