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

Clarify valid buffers #2138

Merged
merged 2 commits into from
Jul 18, 2023
Merged

Clarify valid buffers #2138

merged 2 commits into from
Jul 18, 2023

Conversation

bocchino
Copy link
Collaborator

Rationale:

  • A buffer is not valid if its data pointer is nullptr. Clarify the docs.
  • Provide an interface function to check the validity of a buffer. This is more convenient and less error-prone than forcing users to write out the logic every time. It also documents the definition of validity in the code.

@bocchino bocchino requested a review from LeStarch July 18, 2023 03:40
@@ -57,6 +57,10 @@
return (this->m_bufferData == src.m_bufferData) && (this->m_size == src.m_size) && (this->m_context == src.m_context);
}

bool Buffer::isValid() const {

Check notice

Code scanning / CodeQL

Use of basic integral type

isValid uses the basic integral type bool rather than a typedef with size and signedness.
@LeStarch LeStarch merged commit 6e799d8 into nasa:devel Jul 18, 2023
thomas-bc pushed a commit that referenced this pull request Aug 4, 2023
* Clarify valid buffers

* Revise Buffer SDD
thomas-bc added a commit that referenced this pull request Aug 4, 2023
@bocchino bocchino deleted the valid-buffer branch October 9, 2023 23:01
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