summaryrefslogtreecommitdiff
path: root/src/static_libs/rg_etc
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-04-21 19:36:05 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-04-21 20:11:02 +0900
commit97fd6614516cf80db57b8cb97c97b03c18724d89 (patch)
tree7ea78a5e55fdde35dd4496a986cac7f56a5b371a /src/static_libs/rg_etc
parent8fe89711ee9fcd74989d609edd05fe3f029884e9 (diff)
ETC1: Fix more clang warnings
Some of these are a bit pointless (eg. init with {0}) but at least this silences clang and helps reveal more potentially useful warnings.
Diffstat (limited to 'src/static_libs/rg_etc')
-rw-r--r--src/static_libs/rg_etc/rg_etc1.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/static_libs/rg_etc/rg_etc1.c b/src/static_libs/rg_etc/rg_etc1.c
index 16f0ef06d1..d3bc3901fb 100644
--- a/src/static_libs/rg_etc/rg_etc1.c
+++ b/src/static_libs/rg_etc/rg_etc1.c
@@ -1605,7 +1605,6 @@ rg_etc1_solution_coordinates_block_colors_get(const Etc1_Solution_Coordinates *c
1605 for (i = 0; i < 4; i++) 1605 for (i = 0; i < 4; i++)
1606 rg_etc1_color_quad_u8_init(&colors[i], br + pInten_table[i], bg + pInten_table[i], bb + pInten_table[i], 255); 1606 rg_etc1_color_quad_u8_init(&colors[i], br + pInten_table[i], bg + pInten_table[i], bb + pInten_table[i], 255);
1607} 1607}
1608#endif
1609 1608
1610static inline void 1609static inline void
1611rg_etc1_pack_params_clear(rg_etc1_pack_params *params) 1610rg_etc1_pack_params_clear(rg_etc1_pack_params *params)
@@ -1613,6 +1612,7 @@ rg_etc1_pack_params_clear(rg_etc1_pack_params *params)
1613 params->m_quality = rg_etc1_high_quality; 1612 params->m_quality = rg_etc1_high_quality;
1614 params->m_dithering = EINA_FALSE; 1613 params->m_dithering = EINA_FALSE;
1615} 1614}
1615#endif
1616 1616
1617static const int rg_etc1_default_scan_delta[] = { 0 }; 1617static const int rg_etc1_default_scan_delta[] = { 0 };
1618 1618
@@ -2115,7 +2115,7 @@ rg_etc1_optimizer_evaluate_solution_fast(rg_etc1_optimizer *optimizer, const Etc
2115 { 2115 {
2116 if (block_inten[0] > optimizer->m_pSorted_luma[n - 1]) 2116 if (block_inten[0] > optimizer->m_pSorted_luma[n - 1])
2117 { 2117 {
2118 const uint min_error = labs(block_inten[0] - optimizer->m_pSorted_luma[n - 1]); 2118 const uint min_error = labs((long) block_inten[0] - (long) optimizer->m_pSorted_luma[n - 1]);
2119 if (min_error >= trial_solution->m_error) 2119 if (min_error >= trial_solution->m_error)
2120 continue; 2120 continue;
2121 } 2121 }
@@ -2130,7 +2130,7 @@ rg_etc1_optimizer_evaluate_solution_fast(rg_etc1_optimizer *optimizer, const Etc
2130 { 2130 {
2131 if (optimizer->m_pSorted_luma[0] > block_inten[3]) 2131 if (optimizer->m_pSorted_luma[0] > block_inten[3])
2132 { 2132 {
2133 const uint min_error = labs(optimizer->m_pSorted_luma[0] - block_inten[3]); 2133 const uint min_error = labs((long) optimizer->m_pSorted_luma[0] - (long) block_inten[3]);
2134 if (min_error >= trial_solution->m_error) 2134 if (min_error >= trial_solution->m_error)
2135 continue; 2135 continue;
2136 } 2136 }
@@ -2581,9 +2581,9 @@ rg_etc1_pack_block(void* pETC1_block, const unsigned int* pSrc_pixels_BGRA, rg_e
2581 uint best_use_color4=EINA_FALSE; 2581 uint best_use_color4=EINA_FALSE;
2582 uint best_flip=EINA_FALSE; 2582 uint best_flip=EINA_FALSE;
2583 uint8 best_selectors[2][8]; 2583 uint8 best_selectors[2][8];
2584 rg_etc1_optimizer optimizer = { 0 }; 2584 rg_etc1_optimizer optimizer;
2585 rg_etc1_optimizer_results best_results[2] = { { 0 } }; 2585 rg_etc1_optimizer_results best_results[2];
2586 rg_etc1_optimizer_results results[3] = { { 0 } }; 2586 rg_etc1_optimizer_results results[3];
2587 rg_etc1_optimizer_params params; 2587 rg_etc1_optimizer_params params;
2588 uint i, flip; 2588 uint i, flip;
2589 uint8 selectors[3][8]; 2589 uint8 selectors[3][8];
@@ -2593,6 +2593,10 @@ rg_etc1_pack_block(void* pETC1_block, const unsigned int* pSrc_pixels_BGRA, rg_e
2593 static const int s_scan_delta_0_to_1[] = { -1, 0, 1 }; 2593 static const int s_scan_delta_0_to_1[] = { -1, 0, 1 };
2594 static const int s_scan_delta_0[] = { 0 }; 2594 static const int s_scan_delta_0[] = { 0 };
2595 2595
2596 memset(&optimizer, 0, sizeof(optimizer));
2597 memset(&best_results, 0, sizeof(best_results));
2598 memset(&results, 0, sizeof(results));
2599
2596#ifdef RG_ETC1_BUILD_DEBUG 2600#ifdef RG_ETC1_BUILD_DEBUG
2597 // Ensure all alpha values are 0xFF. 2601 // Ensure all alpha values are 0xFF.
2598 for (i = 0; i < 16; i++) 2602 for (i = 0; i < 16; i++)