Get rid of an unnecessary cast by declaring the right pointer type