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

feat: add C version of CPI program #6

Merged
merged 2 commits into from
Oct 10, 2024

Conversation

sonicfromnewyoke
Copy link
Contributor

No description provided.

Copy link
Owner

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Looks great! Just one little nit. Can you also add cpi to the list of C programs for CI at

program: [helloworld, transfer-lamports]

cpi/c/src/main.c Outdated
Comment on lines 43 to 45
uint8_t data[4 + 8];
*(uint16_t *)data = 8;
*(uint64_t *)(data + 4) = SIZE;
Copy link
Owner

Choose a reason for hiding this comment

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

nit: Can you add the comments from the original here?

Suggested change
uint8_t data[4 + 8];
*(uint16_t *)data = 8;
*(uint64_t *)(data + 4) = SIZE;
uint8_t data[4 + 8]; // Enough room for the Allocate instruction
*(uint16_t *)data = 8; // Allocate instruction enum value
*(uint64_t *)(data + 4) = SIZE; // Size to allocate

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added 7559567

@sonicfromnewyoke
Copy link
Contributor Author

Looks great! Just one little nit. Can you also add cpi to the list of C programs for CI at

program: [helloworld, transfer-lamports]

my bad 7559567

Copy link
Owner

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution again!

@joncinque joncinque merged commit 89efc3b into joncinque:main Oct 10, 2024
11 checks passed
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.

2 participants