(file) Return to CodingGuidelines.htm CVS log (file) (dir) Up to [Pegasus] / pegasus / doc

Diff for /pegasus/doc/CodingGuidelines.htm between version 1.2 and 1.3

version 1.2, 2013/02/18 14:33:40 version 1.3, 2013/02/18 15:00:19
Line 105 
Line 105 
     <td>Adding section on Unused's (variables,     <td>Adding section on Unused's (variables,
       arguments, values etc.)</td>       arguments, values etc.)</td>
   </tr>   </tr>
     <tr>
       <td align="center">3.5</td>
       <td align="center">22 January 2013</td>
       <td align="center">Marek Szermutzky</td>
       <td>macro PEGASUS_FCT_EXECUTE_AND_ASSERT added</td>
     </tr>
 </table> </table>
 <p>&nbsp;</p> <p>&nbsp;</p>
 <hr> <hr>
Line 606 
Line 612 
 { {
 };</code></pre> };</code></pre>
   </li>   </li>
     <li>Avoid unused variables when the return value of a function is
       assigned to a variable only to be used to do an assert check
       with PEGASUS_ASSERT by instead using macro
       PEGASUS_FCT_EXECUTE_AND_ASSERT. It helps avoid such unused
       variables when PEGASUS_NOASSERTS is enabled (assertion
       disabled). PEGASUS_FCT_EXECUTE_AND_ASSERT compares the return
       value of function against VALUE for equalness but only if
       asserts are enabled. The Function FCT will always be called
       (equal if asserts enabled or disabled). Do this:
       <pre><code>PEGASUS_FCT_EXECUTE_AND_ASSERT(true, f());
       </code></pre>
       Not this:
       <pre><code>bool returnCode = f();<br>PEGASUS_ASSERT(true == returnCode);
       </code></pre>
     </li>
   
 </ol> </ol>
  
  


Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2