Advertisement
PVS-StudioWarnings

PVS-Studio warning V523 for Word11a

Nov 26th, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.78 KB | None | 0 0
  1. int TmcCharacterLooks(pcmb)
  2. CMB * pcmb;
  3. {
  4.   ....
  5.   if (qps < 0)
  6.   {
  7.     pcab->wCharQpsSpacing = -qps;
  8.     pcab->iCharIS = 2;
  9.   }
  10.   else  if (qps > 0)
  11.   {
  12.     pcab->iCharIS = 1;
  13.   }
  14.   else
  15.   {
  16.     pcab->iCharIS = 0;
  17.   }
  18.   ....
  19.   if (hps < 0)
  20.   {
  21.     pcab->wCharHpsPos = -hps;
  22.     pcab->iCharPos = 2;
  23.   }
  24.   else  if (hps > 0)
  25.   {
  26.     pcab->iCharPos = 1;
  27.   }
  28.   else
  29.   {
  30.     pcab->iCharPos = 1;
  31.   }
  32.   ....
  33. }
  34.  
  35. This suspicious code was found in Word11a project by PVS-Studio static code analyzer.
  36. Warning message is:
  37. V523 The 'then' statement is equivalent to the 'else' statement. dlglook1.c 873
  38.  
  39. PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement