[BACK]Return to midi.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / sndiod

Diff for /src/usr.bin/sndiod/midi.c between version 1.11 and 1.12

version 1.11, 2015/11/22 16:42:22 version 1.12, 2015/11/23 09:48:25
Line 426 
Line 426 
 struct port *  struct port *
 port_new(char *path, unsigned int mode, int hold)  port_new(char *path, unsigned int mode, int hold)
 {  {
         struct port *c, **pc;          struct port *c;
   
         c = xmalloc(sizeof(struct port));          c = xmalloc(sizeof(struct port));
         c->path = path;          c->path = path;
Line 434 
Line 434 
         c->hold = hold;          c->hold = hold;
         c->midi = midi_new(&port_midiops, c, mode);          c->midi = midi_new(&port_midiops, c, mode);
         c->num = midi_portnum++;          c->num = midi_portnum++;
         for (pc = &port_list; *pc != NULL; pc = &(*pc)->next)          c->next = port_list;
                 ; /* nothing */          port_list = c;
         c->next = NULL;  
         *pc = c;  
         return c;          return c;
 }  }
   
Line 502 
Line 500 
         struct port *p;          struct port *p;
   
         for (p = port_list; p != NULL; p = p->next) {          for (p = port_list; p != NULL; p = p->next) {
                 if (num-- == 0)                  if (p->num == num)
                         return p;                          return p;
         }          }
         return NULL;          return NULL;

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12