comparison tools/lib64gfx.c @ 2344:13e54305e5fc

Move two memsets to later in the function.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 25 Sep 2019 12:13:28 +0300
parents 94a653883a32
children fe025c461760
comparison
equal deleted inserted replaced
2343:94a653883a32 2344:13e54305e5fc
1402 { 1402 {
1403 DMC64GetPixelFunc getPixel; 1403 DMC64GetPixelFunc getPixel;
1404 DMC64ScanLine scan; 1404 DMC64ScanLine scan;
1405 1405
1406 (void) spec; 1406 (void) spec;
1407 dmMemset(dst->data, 0, dst->size);
1408 dmMemset(&scan, 0, sizeof(scan));
1409 1407
1410 // Check pixel getter function 1408 // Check pixel getter function
1411 if (src->fmt->getPixel != NULL) 1409 if (src->fmt->getPixel != NULL)
1412 getPixel = src->fmt->getPixel; 1410 getPixel = src->fmt->getPixel;
1413 else 1411 else
1422 return dmError(DMERR_INVALID_DATA, 1420 return dmError(DMERR_INVALID_DATA,
1423 "Invalid bitmap image type/fmt=0x%x.\n", 1421 "Invalid bitmap image type/fmt=0x%x.\n",
1424 src->extraInfo[D64_EI_MODE]); 1422 src->extraInfo[D64_EI_MODE]);
1425 } 1423 }
1426 1424
1425 dmMemset(dst->data, 0, dst->size);
1426 dmMemset(&scan, 0, sizeof(scan));
1427
1427 // Perform conversion 1428 // Perform conversion
1428 for (int yc = 0; yc < dst->height; yc++) 1429 for (int yc = 0; yc < dst->height; yc++)
1429 { 1430 {
1430 scan.col = dst->data + (yc * dst->pitch); 1431 scan.col = dst->data + (yc * dst->pitch);
1431 for (int xc = 0; xc < dst->width; xc++, scan.col++) 1432 for (int xc = 0; xc < dst->width; xc++, scan.col++)