Add explicit casts to external C function to make example compile with stricter compiler flags.