diff options
author | Bert <ber.t@gmx.com> | 2011-09-06 11:04:47 +0200 |
---|---|---|
committer | Bert <ber.t@gmx.com> | 2011-09-06 11:04:47 +0200 |
commit | 14d1daf280f6912b33a57e802cc12a9ee96a3e4f (patch) | |
tree | 9eb1c93743081a444c154591a505d03bb75f207b | |
parent | 711494ad361dcce5075545b5886a5986f88b60ef (diff) |
Removed useless zl_cnt variable
-rw-r--r-- | image.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -34,14 +34,12 @@ enum { MIN_GIF_DELAY = 50 }; -int zl_cnt; float zoom_min; float zoom_max; void img_init(img_t *img, win_t *win) { - zl_cnt = sizeof(zoom_levels) / sizeof(zoom_levels[0]); zoom_min = zoom_levels[0] / 100.0; - zoom_max = zoom_levels[zl_cnt - 1] / 100.0; + zoom_max = zoom_levels[ARRLEN(zoom_levels) - 1] / 100.0; if (img) { img->im = NULL; @@ -442,7 +440,7 @@ int img_zoom_in(img_t *img, win_t *win) { if (!img || !img->im || !win) return 0; - for (i = 1; i < zl_cnt; i++) { + for (i = 1; i < ARRLEN(zoom_levels); i++) { if (zoom_levels[i] > img->zoom * 100.0) return img_zoom(img, win, zoom_levels[i] / 100.0); } @@ -455,7 +453,7 @@ int img_zoom_out(img_t *img, win_t *win) { if (!img || !img->im || !win) return 0; - for (i = zl_cnt - 2; i >= 0; i--) { + for (i = ARRLEN(zoom_levels) - 2; i >= 0; i--) { if (zoom_levels[i] < img->zoom * 100.0) return img_zoom(img, win, zoom_levels[i] / 100.0); } |