summaryrefslogtreecommitdiff
path: root/src/lib/emile
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2016-12-15 11:17:34 -0800
committerCedric BAIL <cedric@osg.samsung.com>2016-12-15 11:17:34 -0800
commite12d59e21684afae6ecbffa142cd6fec446295cd (patch)
treeeab1242c69938214bf4b568c4c50bbddf80b8949 /src/lib/emile
parent8a57cb44b21626da0db36b434850e68ecd0ec67d (diff)
emile: reduce the amount of clobbered variable.
Diffstat (limited to 'src/lib/emile')
-rw-r--r--src/lib/emile/emile_image.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/src/lib/emile/emile_image.c b/src/lib/emile/emile_image.c
index e04df4c1af..da17464396 100644
--- a/src/lib/emile/emile_image.c
+++ b/src/lib/emile/emile_image.c
@@ -1380,7 +1380,7 @@ _emile_jpeg_head(Emile_Image *image,
1380 unsigned int property_size, 1380 unsigned int property_size,
1381 Emile_Image_Load_Error *error) 1381 Emile_Image_Load_Error *error)
1382{ 1382{
1383 Emile_Image_Load_Opts *opts = NULL; 1383 volatile Emile_Image_Load_Opts *opts = (image->load_opts) ? &image->opts : NULL;
1384 const unsigned char *m; 1384 const unsigned char *m;
1385 unsigned int scalew, scaleh; 1385 unsigned int scalew, scaleh;
1386 struct jpeg_decompress_struct cinfo; 1386 struct jpeg_decompress_struct cinfo;
@@ -1388,9 +1388,9 @@ _emile_jpeg_head(Emile_Image *image,
1388 unsigned int length; 1388 unsigned int length;
1389 1389
1390 /* for rotation decoding */ 1390 /* for rotation decoding */
1391 int degree = 0; 1391 volatile int degree = 0;
1392 Eina_Bool change_wh = EINA_FALSE; 1392 volatile Eina_Bool change_wh = EINA_FALSE;
1393 unsigned int load_opts_w = 0, load_opts_h = 0; 1393 volatile unsigned int load_opts_w = 0, load_opts_h = 0;
1394 1394
1395 if (sizeof(Emile_Image_Property) != property_size) 1395 if (sizeof(Emile_Image_Property) != property_size)
1396 return EINA_FALSE; 1396 return EINA_FALSE;
@@ -1399,9 +1399,6 @@ _emile_jpeg_head(Emile_Image *image,
1399 if (!m) 1399 if (!m)
1400 return EINA_FALSE; 1400 return EINA_FALSE;
1401 1401
1402 if (image->load_opts)
1403 opts = &image->opts;
1404
1405 memset(&cinfo, 0, sizeof(cinfo)); 1402 memset(&cinfo, 0, sizeof(cinfo));
1406 cinfo.err = jpeg_std_error(&(jerr.pub)); 1403 cinfo.err = jpeg_std_error(&(jerr.pub));
1407 cinfo.client_data = NULL; 1404 cinfo.client_data = NULL;
@@ -1629,17 +1626,18 @@ _emile_jpeg_data(Emile_Image *image,
1629 Emile_Image_Load_Error *error) 1626 Emile_Image_Load_Error *error)
1630{ 1627{
1631 /* Handle RGB, ARGB, GRY and AGRY */ 1628 /* Handle RGB, ARGB, GRY and AGRY */
1632 Emile_Image_Load_Opts *opts = NULL; 1629 volatile Emile_Image_Load_Opts *opts = (image->load_opts) ? &image->opts : NULL;
1633 unsigned int w, h; 1630 unsigned int w, h;
1634 struct jpeg_decompress_struct cinfo; 1631 struct jpeg_decompress_struct cinfo;
1635 struct _JPEG_error_mgr jerr; 1632 struct _JPEG_error_mgr jerr;
1636 const unsigned char *m = NULL; 1633 const unsigned char *m = NULL;
1637 uint8_t *ptr, *line[16], *data; 1634 uint8_t *ptr, *line[16], *data;
1638 uint32_t *ptr2 = NULL, *ptr_rotate = NULL; 1635 volatile uint32_t *ptr2 = NULL;
1636 uint32_t *ptr_rotate = NULL;
1639 uint16_t *ptrag = NULL, *ptrag_rotate = NULL; 1637 uint16_t *ptrag = NULL, *ptrag_rotate = NULL;
1640 uint8_t *ptrg = NULL, *ptrg_rotate = NULL; 1638 uint8_t *ptrg = NULL, *ptrg_rotate = NULL;
1641 unsigned int x, y, l, i, scans; 1639 unsigned int x, y, l, i, scans;
1642 int region = 0; 1640 volatile int region = 0;
1643 /* rotation setting */ 1641 /* rotation setting */
1644 unsigned int ie_w = 0, ie_h = 0; 1642 unsigned int ie_w = 0, ie_h = 0;
1645 struct 1643 struct
@@ -1648,12 +1646,12 @@ _emile_jpeg_data(Emile_Image *image,
1648 } opts_region = {0, 0, 0, 0}; 1646 } opts_region = {0, 0, 0, 0};
1649 volatile int degree = 0; 1647 volatile int degree = 0;
1650 volatile Eina_Bool change_wh = EINA_FALSE; 1648 volatile Eina_Bool change_wh = EINA_FALSE;
1651 Eina_Bool line_done = EINA_FALSE; 1649 volatile Eina_Bool line_done = EINA_FALSE;
1652 Eina_Bool ptrg_free = EINA_FALSE; 1650 volatile Eina_Bool ptrg_free = EINA_FALSE;
1653 Eina_Bool ptrag_free = EINA_FALSE; 1651 volatile Eina_Bool ptrag_free = EINA_FALSE;
1654 Eina_Bool r = EINA_FALSE; 1652 volatile Eina_Bool r = EINA_FALSE;
1655 unsigned int length; 1653 unsigned int length;
1656 unsigned short count = 0; 1654 volatile unsigned short count = 0;
1657 1655
1658 if (sizeof(Emile_Image_Property) != property_size) 1656 if (sizeof(Emile_Image_Property) != property_size)
1659 return EINA_FALSE; 1657 return EINA_FALSE;
@@ -1662,9 +1660,6 @@ _emile_jpeg_data(Emile_Image *image,
1662 if (!m) 1660 if (!m)
1663 return EINA_FALSE; 1661 return EINA_FALSE;
1664 1662
1665 if (image->load_opts)
1666 opts = &image->opts;
1667
1668 memset(&cinfo, 0, sizeof(cinfo)); 1663 memset(&cinfo, 0, sizeof(cinfo));
1669 if (prop->rotated) 1664 if (prop->rotated)
1670 { 1665 {
@@ -1854,7 +1849,7 @@ _emile_jpeg_data(Emile_Image *image,
1854 else 1849 else
1855 { 1850 {
1856 ptr2 = malloc(w * h * sizeof(uint32_t)); 1851 ptr2 = malloc(w * h * sizeof(uint32_t));
1857 ptr_rotate = ptr2; 1852 ptr_rotate = (uint32_t*) ptr2;
1858 } 1853 }
1859 } 1854 }
1860 else 1855 else