Skip to content

Fix signed/unsigned type mismatch in DpcProcessor::ComputeResultImages#22

Draft
Copilot wants to merge 4 commits intoissue19_conanfrom
copilot/sub-pr-21
Draft

Fix signed/unsigned type mismatch in DpcProcessor::ComputeResultImages#22
Copilot wants to merge 4 commits intoissue19_conanfrom
copilot/sub-pr-21

Conversation

Copy link
Copy Markdown

Copilot AI commented Dec 4, 2025

Addresses feedback on PR #21 regarding incorrect type conversion in nGIProcessor.cpp line 281. The variable N was changed from size_t to ptrdiff_t with an explicit cast, creating an unnecessary signed/unsigned mismatch with the return type of openbeamDC.Size().

Changes

  • Reverted N to const size_t to match Size() return type
  • Removed unnecessary static_cast<ptrdiff_t> from variable initialization
  • Added explicit cast in OpenMP loop condition: i<static_cast<ptrdiff_t>(N)
// Before
const ptrdiff_t N=static_cast<ptrdiff_t>(openbeamDC.Size());
#pragma omp parallel for
for (ptrdiff_t i=0; i<N; i++)

// After
const size_t N=openbeamDC.Size();
#pragma omp parallel for
for (ptrdiff_t i=0; i<static_cast<ptrdiff_t>(N); i++)

This approach keeps the type conversion localized to where OpenMP requires ptrdiff_t for the loop variable, consistent with existing patterns in the codebase (line 233).


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits December 4, 2025 12:45
Co-authored-by: anderskaestner <11174364+anderskaestner@users.noreply.github.com>
Co-authored-by: anderskaestner <11174364+anderskaestner@users.noreply.github.com>
Co-authored-by: anderskaestner <11174364+anderskaestner@users.noreply.github.com>
Copilot AI changed the title [WIP] Update conan Pull Request based on feedback Fix signed/unsigned type mismatch in DpcProcessor::ComputeResultImages Dec 4, 2025
Copilot AI requested a review from anderskaestner December 4, 2025 12:49
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