cancel
Showing results for 
Search instead for 
Did you mean: 

Gfx 4.24.1, warning in CWRUtil::toQ5(T) [with T = float]

ferro
Senior III

Dear Gfx Team,

CWRUtil::toQ5 causes Cube compiler giving this warning

c:\TouchGFX\4.24.1\touchgfx\framework\include\touchgfx\widgets\canvas\CWRUtil.hpp

 

../touchgfx/widgets/canvas/CWRUtil.hpp: In instantiation of 'static touchgfx::CWRUtil::Q5 touchgfx::CWRUtil::toQ5(T) [with T = float]':
../touchgfx/widgets/canvas/Canvas.hpp:120:36:   required from here
../touchgfx/widgets/canvas/CWRUtil.hpp:518:31: warning: arithmetic between floating-point type 'float' and enumeration type 'touchgfx::Rasterizer::<unnamed enum>' is deprecated [-Wdeprecated-enum-float-conversion]
  518 |         return Q5((int)(value * Rasterizer::POLY_BASE_SIZE));
      |                        ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

 

Could you possibly cast Rasterizer::POLY_BASE_SIZE to the static_cast<T> :

 

static Q5 toQ5(T value)
{
    return Q5(static_cast<int>(value * static_cast<T>(Rasterizer::POLY_BASE_SIZE)));
}

 

 

ferro_0-1736248095880.png

 

What do you think ?

 

1 ACCEPTED SOLUTION

Accepted Solutions
GaetanGodart
ST Employee

Hello @ferro ,

 

Thank you for your feedback!
I will report it to the team and I will keep you updated.

I am personally unaware of this function, can you tell me in which file it is located?

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

View solution in original post

3 REPLIES 3
GaetanGodart
ST Employee

Hello @ferro ,

 

Thank you for your feedback!
I will report it to the team and I will keep you updated.

I am personally unaware of this function, can you tell me in which file it is located?

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

Hi @GaetanGodart 

"can you tell me in which file it is located?"

c:\TouchGFX\4.24.1\touchgfx\framework\include\touchgfx\widgets\canvas\CWRUtil.hpp

 

Thank you @ferro !

Gaetan Godart
Software engineer at ST (TouchGFX)