X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7da6ab6e2e1c5f468e29e14eac8e0cf6ca033207..0f314c30b8c4ffbd7d87146f72be7a061d506235:/src/common/quantize.cpp?ds=sidebyside diff --git a/src/common/quantize.cpp b/src/common/quantize.cpp index 736619734c..55fe0fc032 100644 --- a/src/common/quantize.cpp +++ b/src/common/quantize.cpp @@ -1302,7 +1302,6 @@ start_pass_2_quant (j_decompress_ptr cinfo, bool is_pre_scan) { my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; hist3d histogram = cquantize->histogram; - int i; if (is_pre_scan) { /* Set up method pointers */ @@ -1314,9 +1313,6 @@ start_pass_2_quant (j_decompress_ptr cinfo, bool is_pre_scan) cquantize->pub.color_quantize = pass2_fs_dither; cquantize->pub.finish_pass = finish_pass2; - /* Make sure color count is acceptable */ - i = cinfo->actual_number_of_colors; - { size_t arraysize = (size_t) ((cinfo->output_width + 2) * (3 * sizeof(FSERROR))); @@ -1334,7 +1330,7 @@ start_pass_2_quant (j_decompress_ptr cinfo, bool is_pre_scan) } /* Zero the histogram or inverse color map, if necessary */ if (cquantize->needs_zeroed) { - for (i = 0; i < HIST_C0_ELEMS; i++) { + for (int i = 0; i < HIST_C0_ELEMS; i++) { memset((void *) histogram[i], 0, HIST_C1_ELEMS*HIST_C2_ELEMS * sizeof(histcell)); } @@ -1510,8 +1506,6 @@ bool wxQuantize::Quantize(const wxImage& src, wxImage& dest, { int i; - int w = src.GetWidth(); - int h = src.GetHeight(); int windowsSystemColourCount = 20; @@ -1529,8 +1523,9 @@ bool wxQuantize::Quantize(const wxImage& src, wxImage& dest, #endif // create rows info: + int h = src.GetHeight(); + int w = src.GetWidth(); unsigned char **rows = new unsigned char *[h]; - h = src.GetHeight(), w = src.GetWidth(); unsigned char *imgdt = src.GetData(); for (i = 0; i < h; i++) rows[i] = imgdt + 3/*RGB*/ * w * i;