News for hackers. Stuff that matters.
Re:Code != computer science by nitrogen on Tuesday December 24, 2013 @02:43PM (#6960812)
A little whitespace goes a long way. Were the list elements also stored in sequence in some array, or is ->lnk a two-element array with the forward and backward pointers?
Re:Code != computer science by NAFV_P on Tuesday December 24, 2013 @06:29PM (#6961551)
The latter applies here, this is the node:

  typedef struct dll__ {
      struct dll__ *lnk[2];
      void *dat;
  }ndi;
I've seen some examples on the web, but I haven't seen it done this way. I have a suspicion it might be slower than the traditional technique, but I'll have to check that. What is not evident from the code snippet is that I'm trying to make the code handle both fixed end and looped lists.