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

More changes to size_t and int64_t types #38939

Merged
merged 1 commit into from
Feb 21, 2025
Merged

Conversation

rboston628
Copy link
Contributor

@rboston628 rboston628 commented Feb 20, 2025

Description of work

Summary of work

NexusClasses was originally written to work with napi,h, which uses standard int for all integer quantities. However, some of these quantities are better expressed as size_t. Some are better expressed as size_t but can't due to some compatibility expectations for negative numbers, and must be int64_t.

It seems some places in code were constrained by this limitation of NexusClasses to use ints. Several of these places were fixed by resetting types to a more appropriate type.

This should improve the overall code quality of Mantid, by allowing for easier setting of whole counting numbers with unsigned int types, or at least with double width ints.

Part of #38332

Compare and/or combine with #38805

Further detail of work

There should be no changes in this PR, except for:

  1. int changed to size_t or int64_t
  2. places with size_t and a <0 check fixed to avoid compiler and CppCheck warnings

This does not require release notes because it is an internal change invisible to users.

To test:

Make sure all existing tests pass.


Reviewer

Please comment on the points listed below (full description).
Your comments will be used as part of the gatekeeper process, so please comment clearly on what you have checked during your review. If changes are made to the PR during the review process then your final comment will be the most important for gatekeepers. In this comment you should make it clear why any earlier review is still valid, or confirm that all requested changes have been addressed.

Code Review

  • Is the code of an acceptable quality?
  • Does the code conform to the coding standards?
  • Are the unit tests small and test the class in isolation?
  • If there is GUI work does it follow the GUI standards?
  • If there are changes in the release notes then do they describe the changes appropriately?
  • Do the release notes conform to the release notes guide?

Functional Tests

  • Do changes function as described? Add comments below that describe the tests performed?
  • Do the changes handle unexpected situations, e.g. bad input?
  • Has the relevant (user and developer) documentation been added/updated?

Does everything look good? Mark the review as Approve. A member of @mantidproject/gatekeepers will take care of it.

Gatekeeper

If you need to request changes to a PR then please add a comment and set the review status to "Request changes". This will stop the PR from showing up in the list for other gatekeepers.

@rboston628 rboston628 added this to the Release 6.13 milestone Feb 20, 2025
@rboston628 rboston628 added ORNL Team Issues and pull requests managed by the ORNL development team Technical Debt Marks a piece of work to address technical debt introduced to solve a problem quickly labels Feb 20, 2025
@github-actions github-actions bot added the Has Conflicts Used by the bot to label pull requests that have conflicts label Feb 20, 2025
Copy link

👋 Hi, @rboston628,

Conflicts have been detected against the base branch. Please rebase your branch against the base branch.

@rboston628 rboston628 force-pushed the ewm9174-some-more-int-changes branch from cecc137 to 189e7fe Compare February 20, 2025 20:20
@github-actions github-actions bot removed the Has Conflicts Used by the bot to label pull requests that have conflicts label Feb 20, 2025
@peterfpeterson peterfpeterson changed the title More changes to propert integer type More changes to proper integer type Feb 20, 2025
@rboston628 rboston628 force-pushed the ewm9174-some-more-int-changes branch from 9bdfe5c to 6ff5bd8 Compare February 20, 2025 20:49
@github-actions github-actions bot added the Has Conflicts Used by the bot to label pull requests that have conflicts label Feb 20, 2025
Copy link

👋 Hi, @rboston628,

Conflicts have been detected against the base branch. Please rebase your branch against the base branch.

@rboston628 rboston628 force-pushed the ewm9174-some-more-int-changes branch from 6ff5bd8 to a186a7f Compare February 21, 2025 06:29
@github-actions github-actions bot removed the Has Conflicts Used by the bot to label pull requests that have conflicts label Feb 21, 2025
@rboston628 rboston628 marked this pull request as ready for review February 21, 2025 06:30
@peterfpeterson peterfpeterson changed the title More changes to proper integer type More changes to size_t and int64_t types Feb 21, 2025
Copy link
Member

@peterfpeterson peterfpeterson left a comment

Choose a reason for hiding this comment

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

Fairly mechanical changes to follow what has happened in NexusClasses

@jmborr jmborr merged commit f95a7de into main Feb 21, 2025
10 checks passed
@jmborr jmborr deleted the ewm9174-some-more-int-changes branch February 21, 2025 16:50
rboston628 pushed a commit that referenced this pull request Feb 21, 2025
…anges

More changes to size_t and int64_t types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ORNL Team Issues and pull requests managed by the ORNL development team Technical Debt Marks a piece of work to address technical debt introduced to solve a problem quickly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants