Skip to content

removing compiler warnings by making the interface accept pointers#672

Merged
K20shores merged 4 commits intomainfrom
166-refactor-utils-api-to-clean-up-warnings
Nov 18, 2025
Merged

removing compiler warnings by making the interface accept pointers#672
K20shores merged 4 commits intomainfrom
166-refactor-utils-api-to-clean-up-warnings

Conversation

@K20shores
Copy link
Copy Markdown
Collaborator

Closes #166

Any interface that was returning a stack variable previously now returns void and accepts a pointer instead

@K20shores K20shores linked an issue Nov 14, 2025 that may be closed by this pull request
@github-actions
Copy link
Copy Markdown
Contributor

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Nov 14, 2025

Codecov Report

❌ Patch coverage is 56.86275% with 330 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.26%. Comparing base (a2843ce) to head (dcb6536).

Files with missing lines Patch % Lines
src/tuvx/interface_util.F90 10.75% 83 Missing ⚠️
src/tuvx/radiator_map.cpp 24.19% 47 Missing ⚠️
src/tuvx/profile_map.cpp 21.27% 37 Missing ⚠️
src/tuvx/grid_map.cpp 21.42% 33 Missing ⚠️
src/tuvx/radiator.cpp 30.23% 30 Missing ⚠️
src/tuvx/profile.cpp 39.13% 28 Missing ⚠️
src/tuvx/grid.cpp 44.82% 16 Missing ⚠️
src/tuvx/tuvx.cpp 48.00% 13 Missing ⚠️
src/tuvx/interface_profile.F90 90.90% 12 Missing ⚠️
src/tuvx/interface_grid.F90 87.20% 11 Missing ⚠️
... and 5 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #672      +/-   ##
==========================================
+ Coverage   76.93%   78.26%   +1.32%     
==========================================
  Files          54       54              
  Lines        7259     7192      -67     
==========================================
+ Hits         5585     5629      +44     
+ Misses       1674     1563     -111     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the C/C++ interface to eliminate compiler warnings by changing functions that return stack-allocated variables to void functions that accept pointer parameters instead. The changes affect error handling, string creation, mapping construction, and several TUV-x interface functions.

Key Changes:

  • Modified CreateString, NoError, ToError, and ToMapping functions to accept output pointers instead of returning values
  • Updated TUV-x ordering functions (GetPhotolysisRateConstantsOrdering, GetHeatingRatesOrdering, GetDoseRatesOrdering) to accept output parameters
  • Updated Fortran interfaces to match the new C function signatures
  • Modified all call sites throughout the codebase to use the new interfaces
  • Updated test cases to reflect the new function signatures

Reviewed Changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/util.cpp Refactored utility functions to accept output pointers
src/tuvx/tuvx_c_interface.cpp Updated TUV-x C interface functions to match new signatures
src/tuvx/tuvx.cpp Modified TUV-x class methods to use new error/string interfaces
src/tuvx/radiator_map.cpp Updated error handling to use pointer-based functions
src/tuvx/radiator.cpp Updated error handling to use pointer-based functions
src/tuvx/profile_map.cpp Updated error handling to use pointer-based functions
src/tuvx/profile.cpp Updated error handling and string retrieval to use pointers
src/tuvx/grid_map.cpp Updated error handling to use pointer-based functions
src/tuvx/grid.cpp Updated error handling and string retrieval to use pointers
src/tuvx/interface_util.F90 Changed Fortran interface for CreateString from function to subroutine
src/tuvx/interface_profile.F90 Changed Fortran interfaces for string getters from functions to subroutines
src/tuvx/interface_grid.F90 Changed Fortran interfaces for string getters from functions to subroutines
src/tuvx/interface.F90 Changed TUV-x ordering functions from functions to subroutines
fortran/util.F90 Updated Fortran wrapper to use new CreateString signature
fortran/tuvx/tuvx.F90 Updated Fortran wrapper to use new ordering function signatures
src/test/unit/*.cpp Updated test code to use new function signatures
include/musica/*.hpp Updated header files with new function signatures
src/micm/*.cpp Updated MICM code to use new error/string interfaces

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@K20shores K20shores merged commit b055e00 into main Nov 18, 2025
81 of 84 checks passed
@K20shores K20shores deleted the 166-refactor-utils-api-to-clean-up-warnings branch November 18, 2025 15:21
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.

Refactor utils api to clean up warnings

4 participants