Add casting to const

The included test is derived from a real world case
which would lead to warnings in GCC if the pointer
wouldn't be explicitly casted to const.
Merge pull request #204 from vmx/constcast

Add casting to const