Examples of errors detected by the V548 diagnostic.


V548. Consider reviewing type casting. TYPE X[][] in not equivalent to TYPE **X.


Haiku Operation System

V548 Consider reviewing type casting. TYPE X[][] in not equivalent to TYPE **X. RAW.cpp 1668


void
DCRaw::_AdobeCoefficients(const char *make, const char *model)
{
  static const struct {
    const char *prefix;
    short black, trans[12];
  } table[] = {
    { "Canon EOS D2000", 0,
      { 24542,-10860,-3401,-1490,11370,-297,2858,-605,3225 }},
    { "Canon EOS D6000", 0,
      { 20482,-7172,-3125,-1033,10410,-285,2542,226,3136 }},
    ....
  };
  double cameraXYZ[4][3];

  for (uint32 i = 0; i < sizeof table / sizeof *table; i++) {
    if (!strncasecmp(model, table[i].prefix, strlen(....))) {
      if (table[i].black)
        fMeta.black = table[i].black;
      for (uint32 j = 0; j < 12; j++) {
        ((double**)cameraXYZ)[0][j] = table[i].trans[j] /10000.0;
      }
      _CameraXYZCoefficients(cameraXYZ);
      break;
    }
  }
}


Do you make errors in the code?

Check your code
with PVS-Studio

Static code analysis
for C, C++, and C#

goto PVS-Studio;