Fix compiler complaints, remove unneeded variable
Before this commit, compiler complained about no return function that
actually is void and a function that has no return value so defaults to
int (but has no return x; at the end). This commit fixes it.
Also it removes XCF_PTR_ERROR.