Menu

cppcheck not recognizing that a parameter can be marked const

2021-11-04
2021-11-04
  • Tobias Markus

    Tobias Markus - 2021-11-04

    In the attached file, in line 119, the parameter c can be passed as const ref

    ColorOKLCh lab_to_lch(ColorOKLab& c)
    {
      return ColorOKLCh{c.L, sqrtf(c.a * c.a + c.b * c.b), atan2f(c.b, c.a)};
    }
    

    cppcheck 2.5 somehow misses that.

     
  • Tobias Markus

    Tobias Markus - 2021-11-04

    The same is true for the functions

    srgb_to_linear_srgb
    linear_srgb_to_srgb
    linear_srgb_to_oklab

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.