Reverted the changes made in the last commit

The commit is breaking builds at runtime because the casting is needed because the
now pointer type is interpretted as an offset on the GL side.
merged upstream/develop with size_t prev