Add FOR_ALL_BUFFERS helper
FOR_ALL_BUFFERS use locally declared buffer pointer
Merge pull request #1024 from war1025/dev/for_all_buffers

Add FOR_ALL_BUFFERS helper