use restrict keyword where ever possible

Reference: http://cellperformance.beyond3d.com/articles/2006/05/demystifying-the-restrict-keyword.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>