Logo Search packages:      
Sourcecode: cbmconvert version File versions  Download package

static void ssort ( void   )  [static]

Shell Sort algorithm from "C Programmer's Library" by Purdum, Leslie and Stegemoller

Definition at line 120 of file unarc.c.

References hc, hl, and hv.

Referenced by GetHeader().

{
  int m;
  int h,i,j,k;

  m = sizeof hl;

  while (m >>= 1) {
    k = (sizeof hl) - m;
    j = 1;
    do {
      i = j;
      do {
      h = i + m;
      if (hl[h - 1] > hl[i - 1]) {
        unsigned long t;
        unsigned char u;
        t = hc[i - 1], hc[i - 1] = hc[h - 1], hc[h - 1] = t;
        u = hv[i - 1], hv[i - 1] = hv[h - 1], hv[h - 1] = u;
        u = hl[i - 1], hl[i - 1] = hl[h - 1], hl[h - 1] = u;
        i -= m;
      }
      else
        break;
      } while (i >= 1);
      j += 1;
    } while(j <= k);
  }
}


Generated by  Doxygen 1.6.0   Back to index