multiline comments

C code posted by Avi
created at 08 Apr 11:11, updated at 09 Apr 16:00

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
CDcmImage* misc::RetrieveAndMaybeCreateDcmImage(
  CDcmSeries* a_pSeries,
  const std::string& a_sImgUID,
  size_t a_nImageIdx
)
{
  const bool bMakeItFail = false; //true;
  if ( bMakeItFail)
  {
    const bool bFailAlways = true; //false;
    if ( bFailAlways )
      return 0;
    else
    {
      static size_t nCalls = 0;
      if ( nCalls == std::numeric_limits< size_t >::max() )
        nCalls = 0; // Reset if necessary
      const size_t N = 10; // One call out of N will be forced to fail
      if ( ++nCalls % N == 0 )
        return 0;
    }
  }
  ···/···
}
558 Bytes in 3 ms with coderay