diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2012-03-07 17:19:18 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2012-03-07 17:19:18 +0000 |
| commit | 2eb76fb0bd4b8572866d3c2390eaa82747890292 (patch) | |
| tree | 673eb8fdedd2cc54fd48347fb59cc5e1e20f8508 /src/trace | |
| parent | Translations. Greek translation update by Dimitris Spingos. (diff) | |
| download | inkscape-2eb76fb0bd4b8572866d3c2390eaa82747890292.tar.gz inkscape-2eb76fb0bd4b8572866d3c2390eaa82747890292.zip | |
cppcheck
(bzr r11052)
Diffstat (limited to 'src/trace')
| -rw-r--r-- | src/trace/potrace/decompose.cpp | 7 | ||||
| -rw-r--r-- | src/trace/potrace/greymap.cpp | 4 | ||||
| -rw-r--r-- | src/trace/potrace/progress.h | 4 |
3 files changed, 4 insertions, 11 deletions
diff --git a/src/trace/potrace/decompose.cpp b/src/trace/potrace/decompose.cpp index 708c17106..6c27a7ebf 100644 --- a/src/trace/potrace/decompose.cpp +++ b/src/trace/potrace/decompose.cpp @@ -21,12 +21,9 @@ /* set the excess padding to 0 */ static void bm_clearexcess(potrace_bitmap_t *bm) { - potrace_word mask; - int y; - if (bm->w % BM_WORDBITS != 0) { - mask = BM_ALLBITS << (BM_WORDBITS - (bm->w % BM_WORDBITS)); - for (y=0; y<bm->h; y++) { + potrace_word mask = BM_ALLBITS << (BM_WORDBITS - (bm->w % BM_WORDBITS)); + for (int y=0; y<bm->h; y++) { *bm_index(bm, bm->w, y) &= mask; } } diff --git a/src/trace/potrace/greymap.cpp b/src/trace/potrace/greymap.cpp index 2495575e8..e116021c1 100644 --- a/src/trace/potrace/greymap.cpp +++ b/src/trace/potrace/greymap.cpp @@ -61,12 +61,10 @@ greymap_t *gm_dup(greymap_t *gm) { /* clear the given greymap to color b. */ void gm_clear(greymap_t *gm, int b) { - int i; - if (b==0) { memset(gm->map, 0, gm->w*gm->h*sizeof(signed short int)); } else { - for (i=0; i<gm->w*gm->h; i++) { + for (int i=0; i<gm->w*gm->h; i++) { gm->map[i] = b; } } diff --git a/src/trace/potrace/progress.h b/src/trace/potrace/progress.h index 93a1fa3f0..3e1dfb34e 100644 --- a/src/trace/potrace/progress.h +++ b/src/trace/potrace/progress.h @@ -26,10 +26,8 @@ typedef struct progress_s progress_t; given in the 0.0-1.0 range, which will be scaled and translated to the progress object's range. */ static inline void progress_update(double d, progress_t *prog) { - double d_scaled; - if (prog != NULL && prog->callback != NULL) { - d_scaled = prog->min * (1-d) + prog->max * d; + double 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); prog->d_prev = d_scaled; |
