@@ -191,9 +191,9 @@ fn write_fn<W: Write>(mut writer: W, function: &Function, class_name: &str) -> R
191
191
write ! ( writer, r#"var result = new {return_type}("# ) ?;
192
192
} else {
193
193
write ! ( writer, "var result = " ) ?;
194
- if return_type_ll == "UIntPtr" {
194
+ if return_type_ll == "UIntPtr" && return_type == "ulong" {
195
195
write ! ( writer, "(ulong)" ) ?;
196
- } else if return_type_ll == "IntPtr" {
196
+ } else if return_type_ll == "IntPtr" && return_type == "long" {
197
197
write ! ( writer, "(long)" ) ?;
198
198
}
199
199
}
@@ -211,12 +211,12 @@ fn write_fn<W: Write>(mut writer: W, function: &Function, class_name: &str) -> R
211
211
"{}" ,
212
212
if name == "this" {
213
213
"this.ptr" . to_string( )
214
+ } else if typ. is_custom {
215
+ format!( "{}.ptr" , name. to_lower_camel_case( ) )
214
216
} else if ty_name == "UIntPtr" {
215
217
format!( "(UIntPtr){}" , name. to_lower_camel_case( ) )
216
218
} else if ty_name == "IntPtr" {
217
219
format!( "(IntPtr){}" , name. to_lower_camel_case( ) )
218
- } else if typ. is_custom {
219
- format!( "{}.ptr" , name. to_lower_camel_case( ) )
220
220
} else {
221
221
name. to_lower_camel_case( )
222
222
}
@@ -416,7 +416,7 @@ namespace LiveSplitCore
416
416
try
417
417
{
418
418
Marshal.Copy(data, 0, pnt, data.Length);
419
- return Parse(pnt, data.Length, loadFilesPath);
419
+ return Parse(pnt, (ulong) data.Length, loadFilesPath);
420
420
}
421
421
finally
422
422
{
0 commit comments