guess at a fix for an lvalue cast error

this should allow for compilation with clang and newer versions of gcc