Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly marshal optional int #906

Merged
merged 11 commits into from Feb 24, 2016

Conversation

Projects
None yet
2 participants
@eggrobin
Copy link
Member

commented Feb 23, 2016

Fix #905 as well as a typo (mean_value instead of mean_radius).
See the changes to the generated code.

BodyProcessor insert_body = body => {
Log.Info("Inserting " + body.name + "...");

This comment has been minimized.

Copy link
@pleroy

pleroy Feb 23, 2016

Member

You don't want to keep this?

This comment has been minimized.

Copy link
@eggrobin

eggrobin Feb 24, 2016

Author Member

Oops.

gravitational_parameter:
gravity_model.GetValue("gravitational_parameter"),
mean_radius:
gravity_model.GetValue("mean_value"),

This comment has been minimized.

Copy link
@pleroy
return instance_;
}

public void CleanUpManagedData(object ManagedObj) {}

This comment has been minimized.

Copy link
@pleroy

pleroy Feb 23, 2016

Member

managed_objects

This comment has been minimized.

Copy link
@eggrobin

eggrobin Feb 24, 2016

Author Member

Done.


public void CleanUpManagedData(object ManagedObj) {}

public void CleanUpNativeData(IntPtr pNativeData) {

This comment has been minimized.

Copy link
@pleroy

pleroy Feb 23, 2016

Member

native_data (just say nem to Hungarian).

This comment has been minimized.

Copy link
@eggrobin

eggrobin Feb 24, 2016

Author Member

Done.

return -1;
}

public IntPtr MarshalManagedToNative(object ManagedObj) {

This comment has been minimized.

Copy link
@pleroy

pleroy Feb 23, 2016

Member

managed_object

This comment has been minimized.

Copy link
@eggrobin

eggrobin Feb 24, 2016

Author Member

Done.

// specifically, |T?| is boxed to either |T| or |null|, depending on whether
// it has a value. In the latter case, we lose the type information, so we
// cannot test whether |object is T?|. Instead we check whether
// |object == null|, if it it's not, we check that it's a |T|.

This comment has been minimized.

Copy link
@pleroy

pleroy Feb 23, 2016

Member

if it is not

This comment has been minimized.

Copy link
@eggrobin

eggrobin Feb 24, 2016

Author Member

Done.

return ptr;
}

public object MarshalNativeToManaged(IntPtr pNativeData) {

This comment has been minimized.

Copy link
@pleroy

pleroy Feb 23, 2016

Member

native_data

This comment has been minimized.

Copy link
@eggrobin

eggrobin Feb 24, 2016

Author Member

Done.

@pleroy pleroy added the LGTM label Feb 23, 2016

eggrobin added a commit that referenced this pull request Feb 24, 2016

Merge pull request #906 from eggrobin/905
Properly marshal optional int

@eggrobin eggrobin merged commit 1298cff into mockingbirdnest:master Feb 24, 2016

1 check passed

default Build finished. 1139 tests run, 0 skipped, 0 failed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.