Our website uses cookies to enhance your browsing experience.
Accept
to the top
>
>
>
Examples of errors detected by the V674…

Examples of errors detected by the V674 diagnostic

V674. Expression contains a suspicious mix of integer and real types.


Geant4 software

V674 The '1.1' literal of the 'double' type is compared to a value of the 'int' type. Consider inspecting the 'std::abs(ZBalance) > 1.1' expression. G4hadronic_deex_multifragmentation g4statmfmicropartition.cc 351


G4StatMFChannel * G4StatMFMicroPartition::ChooseZ(
  const G4double A0, const G4double Z0, const G4double MeanT)
// Gives fragments charges
{
  ....
  G4int ZBalance = 0;
  ....
  while (std::abs(ZBalance) > 1.1);
}

Similar errors can be found in some other places:

  • V674 The '1.5' literal of the 'double' type is compared to a value of the 'int' type. G4hadronic_mgt g4hadronicprocess.cc 222
  • V674 The '2.5' literal of the 'double' type is compared to a value of the 'int' type. G4hadronic_qmd g4tripathicrosssection.hh 59
  • V674 The '.99' literal of the 'double' type is compared to a value of the 'int' type. Consider inspecting the 'tZ < .99' expression. G4hadronic_crosec_ci g4qantibaryonplusnuclearcrosssection.cc 343
  • And 11 additional diagnostic messages.

Source Engine SDK

V674 The '0.00001' literal of the 'double' type is subtracted from a variable of the 'int' type. Consider inspecting the 'speedCopy -= 0.00001' expression. Client (HL2) c_te_bloodstream.cpp 141


void TE_BloodStream(....)
{
  ....
  int      speedCopy = amount;
  ....
  speedCopy -= 0.00001;// so last few will drip
  ....
}

Source Engine SDK

V674 The '-0.1' literal of the 'double' type is compared to a value of the 'int' type. Consider inspecting the 'step > - 0.1' expression. Client (HL2) prediction.cpp 977


#define  ON_EPSILON    0.1

void CPrediction::SetIdealPitch (....)
{
  int    step;
  ....
  step = floor_height[j] - floor_height[j-1];
  if (step > -ON_EPSILON && step < ON_EPSILON)
    continue;
  ....
}

Similar errors can be found in some other places:

  • V674 The '0.1' literal of the 'double' type is compared to a value of the 'int' type. Consider inspecting the 'step < 0.1' expression. Client (HL2) prediction.cpp 977
  • V674 The '0.1' literal of the 'double' type is compared to a value of the 'int' type. Consider inspecting the 'step - dir > 0.1' expression. Client (HL2) prediction.cpp 980
  • V674 The '-0.1' literal of the 'double' type is compared to a value of the 'int' type. Consider inspecting the 'step - dir < - 0.1' expression. Client (HL2) prediction.cpp 980
  • And 7 additional diagnostic messages.

FlightGear

V674 The '0.01' literal of the 'double' type is compared to a value of the 'int' type. Consider inspecting the 'range < 0.01' expression. navdb.cxx 172


static PositionedID readNavFromStream(....)
{
  ....
  int freq, range;
  ....
  if (range < 0.01) {
    range = defaultNavRange(ident, type);
  }
  ....
}

LibreOffice

V674 The '0.001' literal of the 'double' type is compared to a value of the 'long' type. Consider inspecting the 'pIndent->GetMRest() > 0.001' expression. lwpbulletstylemgr.cxx 177


sal_Int32 GetMRest() const {return m_nRest;}

OUString LwpBulletStyleMgr::RegisterBulletStyle(....)
{
  ....
  if (pIndent->GetMRest() > 0.001)
  ....
}

Godot Engine

V674 The '0.5' literal of the 'double' type is compared to a value of the 'int' type. tween.cpp 272


real_t _run_equation(...);

Variant Tween::_run_equation(InterpolateData& p_data)
{
  ....
  Variant result;
  ....
  switch(initial_val.get_type())
  {
  case Variant::BOOL:
    result = ((int) _run_equation(....)) >= 0.5;
    break;
  ....
  }
  ....
}

Unreal Engine 4

V674 The '0.01f' literal of the 'float' type is compared to a value of the 'unsigned char' type. Consider inspecting the 'SoftVert->InfluenceWeights[j] > 0.01f' expression. skeletalmeshtools.cpp 495


uint8 InfluenceWeights[MAX_TOTAL_INFLUENCES];

void CalcBoneVertInfos(....)
{
  ....
  if(SoftVert->InfluenceWeights[j] > 0.01f)
  {
    ....
  }
  ....
}

Open X-Ray Engine

V674 The '0.5f' literal of the 'float' type is compared to a value of the 'int' type. boneprotections.cpp 54


void SBoneProtections::reload(const shared_str& bone_sect,
                              IKinematics* kinematics)
{
  ....
  CInifile::Sect &protections = pSettings->r_section(bone_sect);
  for (CInifile::SectCIt i=protections.Data.begin();
       protections.Data.end() != i; ++i)
  {
    string256 buffer;
    BoneProtection BP;
    ....
    BP.BonePassBullet = (BOOL) (
                atoi(_GetItem(i->second.c_str(), 2, buffer))
                                                       > 0.5f);
    ....
  }
}

ICQ

V674 The '0.0001f' literal of the 'float' type is compared to a value of the 'int' type. Consider inspecting the '_actual_vol <= 0.0001f' expression. gui videopanel.cpp 190


....
int _actual_vol;
....
void Ui::VolumeControl::_updateSlider()
{
  ....
  if (_audioPlaybackDeviceMuted || _actual_vol <= 0.0001f) {
  ....
}

Similar errors can be found in some other places:

  • V674 The '0.0001f' literal of the 'float' type is compared to a value of the 'int' type. Consider inspecting the '_actual_vol <= 0.0001f' expression. gui videopanel.cpp 196
  • V674 The '0.0001f' literal of the 'float' type is compared to a value of the 'int' type. Consider inspecting the '_actual_vol <= 0.0001f' expression. gui videopanel.cpp 224
  • V674 The '0.0001f' literal of the 'float' type is compared to a value of the 'int' type. Consider inspecting the '_actual_vol <= 0.0001f' expression. gui videopanel.cpp 226
  • And 2 additional diagnostic messages.

CMaNGOS

V674 The '0.1f' literal of the 'float' type is compared to a value of the 'unsigned int' type. item_scripts.cpp 44


uint32 GetHealth()    const { return GetUInt32Value(...); }
uint32 GetMaxHealth() const { return GetUInt32Value(...); } // <=

bool ItemUse_item_orb_of_draconic_energy(....)
{
  ....
  if (pEmberstrife && pEmberstrife->HasAura(SPELL_DOMINION_SOUL)
      || pEmberstrife->GetHealth() /
         pEmberstrife->GetMaxHealth() > 0.1f)               // <=
  {
    ....
    return true;
  }
  return false;
}

Tizen

V674 The '0.5' literal of the 'double' type is assigned to a variable of the 'int' type. Consider inspecting the '= 0.5' expression. add-viewer.c 824


static void preview_down_cb(....)
{
  ....
  int delay = 0.5;                            // <=
  double fdelay;
  fdelay = ((double)delay / 1000.0f);
  DbgPrint("Long press: %lf\n", fdelay);
  ....
}

The default value was 500 milliseconds. Correct variant: int delay = 500;


EFL Core Libraries

V674 The '0.001' literal of the 'double' type is compared to a value of the 'int' type. Consider inspecting the 'abs(st->info.mx) > 0.001' expression. elm_gesture_layer.c 2533


extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__))
                         __attribute__ ((__const__)) ;

#define ELM_GESTURE_MINIMUM_MOMENTUM 0.001

typedef int Evas_Coord;

struct _Elm_Gesture_Momentum_Info
{
  ....
  Evas_Coord mx;
  Evas_Coord my;
  ....
};

static void
_momentum_test(....)
{
  ....
  if ((abs(st->info.mx) > ELM_GESTURE_MINIMUM_MOMENTUM) ||
      (abs(st->info.my) > ELM_GESTURE_MINIMUM_MOMENTUM))
    state_to_report = ELM_GESTURE_STATE_END;
  ....
}

Similar errors can be found in some other places:

  • V674 The '0.001' literal of the 'double' type is compared to a value of the 'int' type. Consider inspecting the 'abs(st->info.my) > 0.001' expression. elm_gesture_layer.c 2534

MuseScore

V674 The '-2.5' literal of the 'double' type is compared to a value of the 'int' type. Consider inspecting the 'alter < - 2.5' expression. importmxmlpass2.cpp 5253


void MusicXMLParserPass2::pitch(int& step, int& alter ....)
{
  ....
  alter = MxmlSupport::stringToInt(strAlter, &ok);
  if (!ok || alter < -2.5 || alter > 2.5) {
    logError(QString("invalid alter '%1'").arg(strAlter));
    ....
    alter = 0;
  }
  ....
}

Rosegarden

V674 The '0.1' literal of the 'double' type is compared to a value of the 'int' type. Consider inspecting the 'm_connectingLineLength > 0.1' expression. StaffLayout.cpp 1028


class StaffLayout
{
  ....
protected:
  int m_connectingLineLength;
  ....
}

int m_connectingLineLength;

void
StaffLayout::resizeStaffLineRow(int row, double x, double length)
{
  ....
  if (m_pageMode != LinearMode && m_connectingLineLength > 0.1) {
  ....
}

0 A.D.

V674 CWE-682 The '0.5' literal of the 'double' type is compared to a value of the 'int' type. Consider inspecting the 'bIsOrientationPreserving > 0.5' expression. MikktspaceWrap.cpp 137


typedef int tbool;

void MikkTSpace::setTSpace(....,
                           const tbool bIsOrientationPreserving,
                           ....)
{
  ....
  m_NewVertices.push_back(bIsOrientationPreserving > 0.5 ? 1.0f : (-1.0f));
  ....
}

Stellarium

V674 The literal '0.4' of 'double' type is being implicitly cast to 'int' type while calling the 'QColor' function. Inspect the first argument. SatellitesDialog.cpp 413


QColor(int r, int g, int b, int a = 255);

void SatellitesDialog::updateSatelliteData()
{
  ....
  // set default
  buttonColor = QColor(0.4, 0.4, 0.4);
  ....
}

close form

Fill out the form in 2 simple steps below:

Your contact information:

Step 1
Congratulations! This is your promo code!

Desired license type:

Step 2
Team license
Enterprise license
** By clicking this button you agree to our Privacy Policy statement
close form
Request our prices
New License
License Renewal
--Select currency--
USD
EUR
* By clicking this button you agree to our Privacy Policy statement

close form
Free PVS‑Studio license for Microsoft MVP specialists
* By clicking this button you agree to our Privacy Policy statement

close form
To get the licence for your open-source project, please fill out this form
* By clicking this button you agree to our Privacy Policy statement

close form
I am interested to try it on the platforms:
* By clicking this button you agree to our Privacy Policy statement

close form
check circle
Message submitted.

Your message has been sent. We will email you at


If you do not see the email in your inbox, please check if it is filtered to one of the following folders:

  • Promotion
  • Updates
  • Spam