[Rewrite] Cast int32 overloads to native int

Int32 parameters should be converted to native int when
the native signature expects the latter.
Merge pull request #172 from thefiddler/intptr_fix

[Rewrite] Cast int32 overloads to native int