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

C API Find exported global by name #627

Merged
merged 1 commit into from
Nov 3, 2020
Merged

Conversation

gumb0
Copy link
Collaborator

@gumb0 gumb0 commented Oct 29, 2020

No description provided.

@codecov
Copy link

codecov bot commented Oct 29, 2020

Codecov Report

Merging #627 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #627   +/-   ##
=======================================
  Coverage   98.32%   98.33%           
=======================================
  Files          67       67           
  Lines        9493     9535   +42     
=======================================
+ Hits         9334     9376   +42     
  Misses        159      159           

@gumb0 gumb0 force-pushed the capi-find-exported-global branch 3 times, most recently from 4f6d0ca to 180b52b Compare October 29, 2020 11:27
@gumb0 gumb0 marked this pull request as ready for review October 29, 2020 11:27
@gumb0 gumb0 requested review from chfast and axic October 29, 2020 11:53
///
/// @param instance Pointer to instance.
/// @param name The global name. NULL-terminated string. Cannot be NULL.
/// @param out_global Pointer to output struct to store found global. Cannot be NULL.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any better best practice than prefixing it with out_?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not aware of any.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In most case we can come up with a sentinel values. E.g. here you can have

FizzyExternalGlobal fizzy_find_exported_global(
    FizzyInstance* instance, const char* name);

And then "not-found" can be represented by FizzyExternalGlobal{nullptr, FizzyValueTypeVoid}.

@gumb0 gumb0 merged commit 90ced51 into master Nov 3, 2020
@gumb0 gumb0 deleted the capi-find-exported-global branch November 3, 2020 11:20
@gumb0 gumb0 mentioned this pull request Nov 3, 2020
49 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants