michaeltyson / TPCircularBuffer

A simple, fast circular buffer implementation
http://atastypixel.com/blog/a-simple-fast-circular-buffer-implementation-for-audio-processing/
839 stars 141 forks source link

Added more const qualifiers. #5

Closed jcbertin closed 9 years ago

michaeltyson commented 9 years ago

Hmm, I don't think this is really true to the const philosophy - if the returned pointer was a const void , it might make sense, but there's the full expectation that that memory will be written to, at least for the 'tail' method. I could probably get behind making the 'head' method const, and have it return a const void , but otherwise I think this is misleading.

jcbertin commented 9 years ago

Making the returned pointer a const void * does make sense only if the methods were changed to const methods, but in the patch I only change the buffer parameter to inform that the parameter is left untouched by these methods.