Fix gcc build: preserve const qualifier when casting input values.

Noticed by:	bz@
Submitted by:	dim@