Fix warnings about non-standard use of variable length structs wrt ring buffer. Add some comments about the ring algorithm.