Assorted code cleanups
- Variable scope reduction as recommended by
cppcheck
- Remove unnecessary casts
- Remove unnecessary check for NULL pointer before calling
free()
- set_pixels: Mark pixels parameter as
const
- Use C99 designated struct initializers