Clean up compiler warnings - #20
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to eliminate compiler warnings across the CT-HYB solver sources by removing unused locals, explicitly marking intentionally unused parameters, and updating loop counter types to better match container sizes. It also adjusts stream formatting handling around acceptance-statistics output.
Changes:
- Replace several
intloop counters withstd::size_twhen iterating over STL containers. - Remove unused local variables (e.g., in sector statistics and NFFT-related measurement code).
- Add explicit “intentionally unused” markers for some interface parameters and restore stream formatting state in evaluation output.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
hybupdates.cpp |
Uses std::size_t for acceptance-statistics loops and restores std::cout formatting after printing stats. |
hybmatrix.cpp |
Marks some unused parameters (void)parameter; in determinant-matrix update/remove paths. |
hybmatrix_nfft.cpp |
Removes unused timing/flags variables in NFFT measurement code paths. |
hyblocal.cpp |
Removes an unused local in sector statistics measurement. |
hybevaluate.cpp |
Marks unused solver_output in select evaluation functions; improves acceptance-statistics loop types and restores output formatting. |
hybconfig.cpp |
Uses std::size_t to iterate over hybmat_ for dumping weights. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+76
to
+77
| int tot_acc=0,cur_prec = std::cout.precision(); | ||
| for (int i=0;i<nacc.size();i++) tot_acc += nacc[i]; | ||
| for (std::size_t i=0;i<nacc.size();i++) tot_acc += nacc[i]; |
egull
force-pushed
the
source-warning-cleanup
branch
from
June 3, 2026 11:24
cc9f0ba to
c0bee5f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Verification
Note: a fresh warning build directly from current master with install_2 is blocked by the existing CMake/Boost imported-target issue addressed separately in PR #19.