Closed ghost closed 11 years ago
Forgot to post the warnings:
s2tc_algorithm.cpp: In function ‘{anonymous}::color_t {anonymous}::make_color_t(int)’: s2tc_algorithm.cpp:60:23: warning: narrowing conversion of ‘(i >> 3)’ from ‘int’ to ‘signed char’ inside { } [-Wnarrowing] return (color_t) {i >> 3, i >> 2, i >> 3}; ^ s2tc_algorithm.cpp:60:31: warning: narrowing conversion of ‘(i >> 2)’ from ‘int’ to ‘signed char’ inside { } [-Wnarrowing] return (color_t) {i >> 3, i >> 2, i >> 3}; ^ s2tc_algorithm.cpp:60:39: warning: narrowing conversion of ‘(i >> 3)’ from ‘int’ to ‘signed char’ inside { } [-Wnarrowing] return (color_t) {i >> 3, i >> 2, i >> 3}; ^ s2tc_algorithm.cpp: In instantiation of ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int) [with int srccomps = 3; int alphabits = 1; DitherMode dither = (DitherMode)0u]’: s2tc_algorithm.cpp:1417:67: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, DitherMode) [with int srccomps = 3; int alphabits = 1]’ s2tc_algorithm.cpp:1435:54: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, int, DitherMode) [with int srccomps = 3]’ s2tc_algorithm.cpp:1453:54: required from here s2tc_algorithm.cpp:1288:12: warning: unused variable ‘alphadiffuse’ [-Wunused-variable] int alphadiffuse = 8 - alphabits; ^ s2tc_algorithm.cpp: In instantiation of ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int) [with int srccomps = 3; int alphabits = 1; DitherMode dither = (DitherMode)1u]’: s2tc_algorithm.cpp:1421:69: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, DitherMode) [with int srccomps = 3; int alphabits = 1]’ s2tc_algorithm.cpp:1435:54: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, int, DitherMode) [with int srccomps = 3]’ s2tc_algorithm.cpp:1453:54: required from here s2tc_algorithm.cpp:1288:12: warning: unused variable ‘alphadiffuse’ [-Wunused-variable] s2tc_algorithm.cpp: In instantiation of ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int) [with int srccomps = 3; int alphabits = 1; DitherMode dither = (DitherMode)2u]’: s2tc_algorithm.cpp:1424:77: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, DitherMode) [with int srccomps = 3; int alphabits = 1]’ s2tc_algorithm.cpp:1435:54: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, int, DitherMode) [with int srccomps = 3]’ s2tc_algorithm.cpp:1453:54: required from here s2tc_algorithm.cpp:1288:12: warning: unused variable ‘alphadiffuse’ [-Wunused-variable] s2tc_algorithm.cpp: In instantiation of ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int) [with int srccomps = 3; int alphabits = 4; DitherMode dither = (DitherMode)0u]’: s2tc_algorithm.cpp:1417:67: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, DitherMode) [with int srccomps = 3; int alphabits = 4]’ s2tc_algorithm.cpp:1438:54: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, int, DitherMode) [with int srccomps = 3]’ s2tc_algorithm.cpp:1453:54: required from here s2tc_algorithm.cpp:1288:12: warning: unused variable ‘alphadiffuse’ [-Wunused-variable] s2tc_algorithm.cpp: In instantiation of ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int) [with int srccomps = 3; int alphabits = 4; DitherMode dither = (DitherMode)1u]’: s2tc_algorithm.cpp:1421:69: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, DitherMode) [with int srccomps = 3; int alphabits = 4]’ s2tc_algorithm.cpp:1438:54: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, int, DitherMode) [with int srccomps = 3]’ s2tc_algorithm.cpp:1453:54: required from here s2tc_algorithm.cpp:1288:12: warning: unused variable ‘alphadiffuse’ [-Wunused-variable] s2tc_algorithm.cpp: In instantiation of ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int) [with int srccomps = 3; int alphabits = 4; DitherMode dither = (DitherMode)2u]’: s2tc_algorithm.cpp:1424:77: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, DitherMode) [with int srccomps = 3; int alphabits = 4]’ s2tc_algorithm.cpp:1438:54: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, int, DitherMode) [with int srccomps = 3]’ s2tc_algorithm.cpp:1453:54: required from here s2tc_algorithm.cpp:1288:12: warning: unused variable ‘alphadiffuse’ [-Wunused-variable] s2tc_algorithm.cpp: In instantiation of ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int) [with int srccomps = 3; int alphabits = 8; DitherMode dither = (DitherMode)0u]’: s2tc_algorithm.cpp:1417:67: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, DitherMode) [with int srccomps = 3; int alphabits = 8]’ s2tc_algorithm.cpp:1442:54: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, int, DitherMode) [with int srccomps = 3]’ s2tc_algorithm.cpp:1453:54: required from here s2tc_algorithm.cpp:1288:12: warning: unused variable ‘alphadiffuse’ [-Wunused-variable] s2tc_algorithm.cpp: In instantiation of ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int) [with int srccomps = 3; int alphabits = 8; DitherMode dither = (DitherMode)1u]’: s2tc_algorithm.cpp:1421:69: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, DitherMode) [with int srccomps = 3; int alphabits = 8]’ s2tc_algorithm.cpp:1442:54: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, int, DitherMode) [with int srccomps = 3]’ s2tc_algorithm.cpp:1453:54: required from here s2tc_algorithm.cpp:1288:12: warning: unused variable ‘alphadiffuse’ [-Wunused-variable] s2tc_algorithm.cpp: In instantiation of ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int) [with int srccomps = 3; int alphabits = 8; DitherMode dither = (DitherMode)2u]’: s2tc_algorithm.cpp:1424:77: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, DitherMode) [with int srccomps = 3; int alphabits = 8]’ s2tc_algorithm.cpp:1442:54: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, int, DitherMode) [with int srccomps = 3]’ s2tc_algorithm.cpp:1453:54: required from here s2tc_algorithm.cpp:1288:12: warning: unused variable ‘alphadiffuse’ [-Wunused-variable] s2tc_algorithm.cpp: In instantiation of ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int) [with int srccomps = 4; int alphabits = 1; DitherMode dither = (DitherMode)0u]’: s2tc_algorithm.cpp:1417:67: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, DitherMode) [with int srccomps = 4; int alphabits = 1]’ s2tc_algorithm.cpp:1435:54: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, int, DitherMode) [with int srccomps = 4]’ s2tc_algorithm.cpp:1457:54: required from here s2tc_algorithm.cpp:1288:12: warning: unused variable ‘alphadiffuse’ [-Wunused-variable] s2tc_algorithm.cpp: In instantiation of ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int) [with int srccomps = 4; int alphabits = 1; DitherMode dither = (DitherMode)1u]’: s2tc_algorithm.cpp:1421:69: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, DitherMode) [with int srccomps = 4; int alphabits = 1]’ s2tc_algorithm.cpp:1435:54: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, int, DitherMode) [with int srccomps = 4]’ s2tc_algorithm.cpp:1457:54: required from here s2tc_algorithm.cpp:1288:12: warning: unused variable ‘alphadiffuse’ [-Wunused-variable] s2tc_algorithm.cpp: In instantiation of ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int) [with int srccomps = 4; int alphabits = 1; DitherMode dither = (DitherMode)2u]’: s2tc_algorithm.cpp:1424:77: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, DitherMode) [with int srccomps = 4; int alphabits = 1]’ s2tc_algorithm.cpp:1435:54: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, int, DitherMode) [with int srccomps = 4]’ s2tc_algorithm.cpp:1457:54: required from here s2tc_algorithm.cpp:1288:12: warning: unused variable ‘alphadiffuse’ [-Wunused-variable] s2tc_algorithm.cpp: In instantiation of ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int) [with int srccomps = 4; int alphabits = 4; DitherMode dither = (DitherMode)0u]’: s2tc_algorithm.cpp:1417:67: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, DitherMode) [with int srccomps = 4; int alphabits = 4]’ s2tc_algorithm.cpp:1438:54: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, int, DitherMode) [with int srccomps = 4]’ s2tc_algorithm.cpp:1457:54: required from here s2tc_algorithm.cpp:1288:12: warning: unused variable ‘alphadiffuse’ [-Wunused-variable] s2tc_algorithm.cpp: In instantiation of ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int) [with int srccomps = 4; int alphabits = 4; DitherMode dither = (DitherMode)1u]’: s2tc_algorithm.cpp:1421:69: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, DitherMode) [with int srccomps = 4; int alphabits = 4]’ s2tc_algorithm.cpp:1438:54: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, int, DitherMode) [with int srccomps = 4]’ s2tc_algorithm.cpp:1457:54: required from here s2tc_algorithm.cpp:1288:12: warning: unused variable ‘alphadiffuse’ [-Wunused-variable] s2tc_algorithm.cpp: In instantiation of ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int) [with int srccomps = 4; int alphabits = 4; DitherMode dither = (DitherMode)2u]’: s2tc_algorithm.cpp:1424:77: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, DitherMode) [with int srccomps = 4; int alphabits = 4]’ s2tc_algorithm.cpp:1438:54: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, int, DitherMode) [with int srccomps = 4]’ s2tc_algorithm.cpp:1457:54: required from here s2tc_algorithm.cpp:1288:12: warning: unused variable ‘alphadiffuse’ [-Wunused-variable] s2tc_algorithm.cpp: In instantiation of ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int) [with int srccomps = 4; int alphabits = 8; DitherMode dither = (DitherMode)0u]’: s2tc_algorithm.cpp:1417:67: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, DitherMode) [with int srccomps = 4; int alphabits = 8]’ s2tc_algorithm.cpp:1442:54: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, int, DitherMode) [with int srccomps = 4]’ s2tc_algorithm.cpp:1457:54: required from here s2tc_algorithm.cpp:1288:12: warning: unused variable ‘alphadiffuse’ [-Wunused-variable] s2tc_algorithm.cpp: In instantiation of ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int) [with int srccomps = 4; int alphabits = 8; DitherMode dither = (DitherMode)1u]’: s2tc_algorithm.cpp:1421:69: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, DitherMode) [with int srccomps = 4; int alphabits = 8]’ s2tc_algorithm.cpp:1442:54: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, int, DitherMode) [with int srccomps = 4]’ s2tc_algorithm.cpp:1457:54: required from here s2tc_algorithm.cpp:1288:12: warning: unused variable ‘alphadiffuse’ [-Wunused-variable] s2tc_algorithm.cpp: In instantiation of ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int) [with int srccomps = 4; int alphabits = 8; DitherMode dither = (DitherMode)2u]’: s2tc_algorithm.cpp:1424:77: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, DitherMode) [with int srccomps = 4; int alphabits = 8]’ s2tc_algorithm.cpp:1442:54: required from ‘void {anonymous}::rgb565_image(unsigned char*, const unsigned char*, int, int, int, DitherMode) [with int srccomps = 4]’ s2tc_algorithm.cpp:1457:54: required from here s2tc_algorithm.cpp:1288:12: warning: unused variable ‘alphadiffuse’ [-Wunused-variable] s2tc_algorithm.cpp: In function ‘(anonymous namespace)::s2tc_dxt5_encode_alpha_refine_always(bitarray&, unsigned char const*, int, int, int, unsigned char&, unsigned char&)’: s2tc_algorithm.cpp:357:29: warning: ‘MEM[(const unsigned char *)&ramp + 2B]’ may be used uninitialized in this function [-Wmaybe-uninitialized] return (a - (int) b) * (a - (int) b); ^ s2tc_algorithm.cpp:708:17: note: ‘MEM[(const unsigned char *)&ramp + 2B]’ was declared here unsigned char ramp[2] = { ^ s2tc_algorithm.cpp:357:29: warning: ‘MEM[(const unsigned char *)&ramp + 3B]’ may be used uninitialized in this function [-Wmaybe-uninitialized] return (a - (int) b) * (a - (int) b); ^ s2tc_algorithm.cpp:708:17: note: ‘MEM[(const unsigned char *)&ramp + 3B]’ was declared here unsigned char ramp[2] = { ^ s2tc_algorithm.cpp:357:29: warning: ‘MEM[(const unsigned char *)&ramp + 4B]’ may be used uninitialized in this function [-Wmaybe-uninitialized] return (a - (int) b) * (a - (int) b); ^ s2tc_algorithm.cpp:708:17: note: ‘MEM[(const unsigned char *)&ramp + 4B]’ was declared here unsigned char ramp[2] = { ^ s2tc_algorithm.cpp:357:29: warning: ‘MEM[(const unsigned char *)&ramp + 5B]’ may be used uninitialized in this function [-Wmaybe-uninitialized] return (a - (int) b) * (a - (int) b); ^ s2tc_algorithm.cpp:708:17: note: ‘MEM[(const unsigned char *)&ramp + 5B]’ was declared here unsigned char ramp[2] = { ^
I got a lot of build warnings when trying to build s2tc. Here are my fixes: