View | Details | Raw Unified | Return to bug 2754
Collapse All | Expand All

(-)a/src/lte/model/lte-asn1-header.cc (-7 / +2 lines)
 Lines 321-333    Link Here 
321
321
322
void Asn1Header::SerializeInteger (int n, int nmin, int nmax) const
322
void Asn1Header::SerializeInteger (int n, int nmin, int nmax) const
323
{
323
{
324
  // Misusage check: Ensure nmax>nmin ...
324
  NS_ASSERT_MSG (nmin <= n && n <= nmax,
325
  if (nmin > nmax)
325
                 "Integer " << n << " is outside range [" << nmin << ", " << nmax << "]");
326
    {
327
      int aux = nmin;
328
      nmin = nmax;
329
      nmax = aux;
330
    }
331
326
332
  // Clause 11.5.3 ITU-T X.691
327
  // Clause 11.5.3 ITU-T X.691
333
  int range = nmax - nmin + 1;
328
  int range = nmax - nmin + 1;

Return to bug 2754