wolfpld / etcpak

The fastest ETC compressor on the planet
Other
229 stars 41 forks source link

Narrowing type 'int' to 'uint32_t' #11

Closed fire closed 3 years ago

fire commented 3 years ago
b"thirdparty\\etcpak\\BlockData.cpp:356:9: error: non-constant-expression cannot be narrowed from type 'unsigned long long' to 'uint32_t' (aka 'unsigned int') in initializer list [-Wc++11-narrowing]\r\n        cr0 | ( cg0 << 8 ) | ( cb0 << 16 ) | 0xFF000000,\r\n        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\nthirdparty\\etcpak\\BlockData.cpp:356:9: note: insert an explicit cast to silence this issue\r\n        cr0 | ( cg0 << 8 ) | ( cb0 << 16 ) | 0xFF000000,\r\n        
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n        static_cast<uint32_t>(
         )\r\nthirdparty\\etcpak\\BlockData.cpp:358:9: error: non-constant-expression cannot be narrowed from type 'unsigned long long' to 'uint32_t' (aka 'unsigned int') in initializer list [-Wc++11-narrowing]\r\n        cr1 | ( cg1 << 8 ) | ( cb1 << 16 ) | 0xFF000000,\r\n        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\nthirdparty\\etcpak\\BlockData.cpp:358:9: note: insert an explicit cast to silence this issue\r\n        cr1 | ( cg1 << 8 ) | ( cb1 << 16 ) | 0xFF000000,\r\n        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n        static_cast<uint32_t>(    
                     )\r\nthirdparty\\etcpak\\BlockData.cpp:411:9: error: non-constant-expression cannot be narrowed from type 'unsigned long long' to 'uint32_t' (aka 'unsigned int') in initializer list [-Wc++11-narrowing]\r\n        cr0 | ( cg0 << 8 ) | ( cb0 << 16 ),\r\n        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\nthirdparty\\etcpak\\BlockData.cpp:411:9: note: insert an explicit cast to silence this issue\r\n        cr0 | ( cg0 << 8 ) | ( cb0 << 16 ),\r\n        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n        static_cast<uint32_t>(            )\r\nthirdparty\\etcpak\\BlockData.cpp:412:9: error: non-constant-expression cannot be narrowed from type 'int' to 'uint32_t' (aka 'unsigned int') in initializer list [-Wc++11-narrowing]\r\n        c2r | ( c2g << 8 ) | ( c2b << 16 ),\r\n        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\nthirdparty\\etcpak\\BlockData.cpp:412:9: note: insert an explicit cast to silence this issue\r\n        c2r | ( c2g << 8 ) | ( c2b << 16 
),\r\n        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n        static_cast<uint32_t>(            )\r\nthirdparty\\etcpak\\BlockData.cpp:413:9: error: non-constant-expression cannot be narrowed from type 'unsigned long long' to 'uint32_t' (aka 'unsigned int') in initializer list [-Wc++11-narrowing]\r\n        cr1 | ( cg1 << 8 ) | ( cb1 << 16 ),\r\n        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\nthirdparty\\etcpak\\BlockData.cpp:413:9: note: insert an explicit cast to silence this issue\r\n        cr1 | ( cg1 << 8 ) | ( cb1 << 16 ),\r\n        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n 
       static_cast<uint32_t>(            )\r\nthirdparty\\etcpak\\BlockData.cpp:414:9: error: non-constant-expression cannot be narrowed from type 'int' to 'uint32_t' (aka 'unsigned int') in initializer list [-Wc++11-narrowing]\r\n        c3r | ( c3g << 8 ) | ( c3b << 16 )\r\n        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\nthirdparty\\etcpak\\BlockData.cpp:414:9: note: insert an explicit cast to silence this issue\r\n        c3r | ( c3g << 8 ) | ( c3b << 16 )\r\n        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n        static_cast<uint32_t>(            )\r\nthirdparty\\etcpak\\BlockData.cpp:458:9: error: non-constant-expression cannot be narrowed from type 'int' to 'uint32_t' 
(aka 'unsigned int') in initializer list [-Wc++11-narrowing]\r\n        clampu8( r0 + table59T58H[codeword] ) | ( clampu8( g0 + table59T58H[codeword] ) << 8 ) | ( clampu8( b0 + table59T58H[codeword] ) << 16 ),\r\n        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\nthirdparty\\etcpak\\BlockData.cpp:458:9: note: insert an explicit cast to silence this issue\r\n        clampu8( r0 + table59T58H[codeword] ) | ( clampu8( g0 + table59T58H[codeword] ) << 8 ) | ( clampu8( b0 + table59T58H[codeword] ) << 16 ),\r\n        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n        static_cast<uint32_t>(
                         )\r\nthirdparty\\etcpak\\BlockData.cpp:459:9: error: non-constant-expression cannot be narrowed from type 'int' to 'uint32_t' (aka 'unsigned int') in initializer list [-Wc++11-narrowing]\r\n        clampu8( r0 - table59T58H[codeword] ) | ( clampu8( g0 - table59T58H[codeword] ) << 8 ) | ( clampu8( b0 - table59T58H[codeword] ) << 16 ),\r\n        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\nthirdparty\\etcpak\\BlockData.cpp:459:9: note: insert an explicit cast to silence this issue\r\n        clampu8( r0 - table59T58H[codeword] ) | ( clampu8( g0 - table59T58H[codeword] ) << 8 ) | ( clampu8( b0 - table59T58H[codeword] ) << 16 ),\r\n        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n        static_cast<uint32_t>(
                                                                               )\r\nthirdparty\\etcpak\\BlockData.cpp:460:9: error: non-constant-expression cannot be narrowed from type 'int' to 
'uint32_t' (aka 'unsigned int') in initializer list [-Wc++11-narrowing]\r\n        clampu8( r1 + 
table59T58H[codeword] ) | ( clampu8( g1 + table59T58H[codeword] ) << 8 ) | ( clampu8( b1 + table59T58H[codeword] ) << 16 ),\r\n        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\nthirdparty\\etcpak\\BlockData.cpp:460:9: note: insert an explicit cast to silence this issue\r\n        clampu8( 
r1 + table59T58H[codeword] ) | ( clampu8( g1 + table59T58H[codeword] ) << 8 ) | ( clampu8( b1 + table59T58H[codeword] ) << 16 ),\r\n        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n        static_cast<uint32_t>(
                                    )\r\nthirdparty\\etcpak\\BlockData.cpp:461:9: error: non-constant-expression cannot be narrowed from type 'int' to 'uint32_t' (aka 'unsigned int') in initializer list [-Wc++11-narrowing]\r\n        clampu8( r1 - table59T58H[codeword] ) | ( clampu8( g1 - table59T58H[codeword] ) << 8 ) | ( clampu8( b1 - table59T58H[codeword] ) << 16 )\r\n        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\nthirdparty\\etcpak\\BlockData.cpp:461:9: note: insert an explicit cast to silence this issue\r\n        clampu8( r1 - table59T58H[codeword] ) | ( clampu8( g1 - table59T58H[codeword] ) << 8 ) | ( clampu8( b1 - table59T58H[codeword] ) << 16 )\r\n        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n        static_cast<uint32_t>(
                                                                                        )\r\nthirdparty\\etcpak\\BlockData.cpp:505:9: error: non-constant-expression cannot be narrowed from type 
'int' to 'uint32_t' (aka 'unsigned int') in initializer list [-Wc++11-narrowing]\r\n        clampu8( r0 + table59T58H[codeword] ) | ( clampu8( g0 + table59T58H[codeword] ) << 8 ) | ( clampu8( b0 + table59T58H[codeword] ) << 16 ),\r\n        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\nthirdparty\\etcpak\\BlockData.cpp:505:9: note: insert an explicit cast to silence this issue\r\n        
clampu8( r0 + table59T58H[codeword] ) | ( clampu8( g0 + table59T58H[codeword] ) << 8 ) | ( clampu8( b0 + table59T58H[codeword] ) << 16 ),\r\n        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n  
      static_cast<uint32_t>(
                                             )\r\nthirdparty\\etcpak\\BlockData.cpp:506:9: error: non-constant-expression cannot be narrowed from type 'int' to 'uint32_t' (aka 'unsigned int') in initializer list [-Wc++11-narrowing]\r\n        clampu8( r0 - table59T58H[codeword] ) | ( clampu8( g0 - table59T58H[codeword] ) << 8 ) | ( clampu8( b0 - table59T58H[codeword] ) << 16 ),\r\n    
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\nthirdparty\\etcpak\\BlockData.cpp:506:9: note: insert an explicit cast to silence this issue\r\n        clampu8( r0 - table59T58H[codeword] ) | ( clampu8( g0 - table59T58H[codeword] ) << 8 ) | ( clampu8( b0 - table59T58H[codeword] ) << 16 ),\r\n        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n        static_cast<uint32_t>(

  )\r\nthirdparty\\etcpak\\BlockData.cpp:507:9: error: non-constant-expression cannot be narrowed from type 'int' to 'uint32_t' (aka 'unsigned int') in initializer list [-Wc++11-narrowing]\r\n  
      clampu8( r1 + table59T58H[codeword] ) | ( clampu8( g1 + table59T58H[codeword] ) << 8 ) | ( 
clampu8( b1 + table59T58H[codeword] ) << 16 ),\r\n        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\nthirdparty\\etcpak\\BlockData.cpp:507:9: note: insert an explicit cast to silence this issue\r\n        clampu8( r1 + table59T58H[codeword] ) | ( clampu8( g1 + table59T58H[codeword] ) << 8 ) | ( clampu8( b1 + table59T58H[codeword] ) << 16 ),\r\n        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n        static_cast<uint32_t>(
8:9: error: non-constant-expression cannot be narrowed from type 'int' to 'uint32_t' (aka 'unsigned int') in initializer list [-Wc++11-narrowing]\r\n        clampu8( r1 - table59T58H[codeword] ) | ( clampu8( g1 - table59T58H[codeword] ) << 8 ) | ( clampu8( b1 - table59T58H[codeword] ) << 16 )\r\n        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\nthirdparty\\etcpak\\BlockData.cpp:508:9: note: insert an explicit cast to silence this issue\r\n        clampu8( r1 - table59T58H[codeword] ) | ( clampu8( g1 - table59T58H[codeword] ) << 8 ) | ( clampu8( b1 - table59T58H[codeword] ) << 16 )\r\n        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n        static_cast<uint32_t>(      

[ 52%]     )\r\n14 errors generated.\r\n"

Sorry about the scrambled output.

fire commented 3 years ago

https://github.com/wolfpld/etcpak/blob/master/BlockData.cpp#L444-L449

See log https://github.com/godotengine/godot/pull/47370/checks?check_run_id=2284055458.

fire commented 3 years ago

Solved this another way. See review on https://github.com/godotengine/godot/pull/47370 for details.