Casts for [mc]alloc to fix compiler error with g++
Merge pull request #27 from uhertlein/master

Thanks.