rtp: Fix compilation with non-C99 compilers

By moving variable declarations out of loop headers.
7 files changed