Skip to content

Maintenance / Minor changes#1272

Merged
bcoconni merged 3 commits intoJSBSim-Team:masterfrom
bcoconni:Maintenance
May 3, 2025
Merged

Maintenance / Minor changes#1272
bcoconni merged 3 commits intoJSBSim-Team:masterfrom
bcoconni:Maintenance

Conversation

@bcoconni
Copy link
Member

@bcoconni bcoconni commented May 2, 2025

This PR brings a number of minor changes and fixes:

  • Fix the computation of the constant minDewPoint in FGStandardAtmosphere where the minus sign in the formula was misplaced.
  • Remove the exception handlers around getenv because getenv has a no throw guarantee.
  • Use std::string for the buffer of  FGLogConsole. We do not need all the features of std::ostringstream

@codecov
Copy link

codecov bot commented May 2, 2025

Codecov Report

Attention: Patch coverage is 82.60870% with 4 lines in your changes missing coverage. Please review.

Project coverage is 24.76%. Comparing base (a222488) to head (4ab961c).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/FGFDMExec.cpp 60.00% 2 Missing ⚠️
src/input_output/FGXMLElement.cpp 50.00% 1 Missing ⚠️
src/models/atmosphere/FGStandardAtmosphere.cpp 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1272      +/-   ##
==========================================
- Coverage   24.77%   24.76%   -0.01%     
==========================================
  Files         169      169              
  Lines       19598    19598              
==========================================
- Hits         4855     4854       -1     
- Misses      14743    14744       +1     

☔ 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.

@seanmcleod70
Copy link
Contributor

Looks good. I see you're using some new C++17 constructs, init-statement in some of the if statements 😉

I guess no-one noticed the minimum dew point issue, since even the correct minimum dew point temperature is fairly close to absolute zero.

@bcoconni
Copy link
Member Author

bcoconni commented May 3, 2025

Looks good. I see you're using some new C++17 constructs, init-statement in some of the if statements 😉

Yep ! Thank you for letting me know about this feature 👍

I guess no-one noticed the minimum dew point issue, since even the correct minimum dew point temperature is fairly close to absolute zero.

Indeed but I figured this out while investigating this issue from FlightGear where users are complaining JSBSim is issuing too many console messages. It was incidental because it does not fix the issue but it is a bug anyway.

In addition, the FlightGear devs are concerned that I am submitting the fix to FlightGear before it is included in JSBSim. Hence this PR which will sync both code bases.

@bcoconni bcoconni merged commit bc97e17 into JSBSim-Team:master May 3, 2025
49 of 51 checks passed
@bcoconni bcoconni deleted the Maintenance branch May 3, 2025 13:38
@seanmcleod70
Copy link
Contributor

Yep ! Thank you for letting me know about this feature

Hmm, I'm a bit confused. When I looked at your commit I noticed the extra statements in some of the if statements, which I wasn't familiar with, so I took a look at the C++ standard https://en.cppreference.com/w/cpp/language/if and noticed:

init-statement | - | (since C++17)

So by using the init-statment option in the if statements you let me know about the feature, available from C++17, rather than the other way round.

@bcoconni
Copy link
Member Author

bcoconni commented May 3, 2025

you let me know about the feature, available from C++17, rather than the other way round.

No, no you mentioned it first: #1094 (comment) 😉 I remember that because your post made me make a mental note that this syntax could be convenient.

@seanmcleod70
Copy link
Contributor

Aaaah, yes, you're right, my memory is fading 😉

bcoconni added a commit to bcoconni/jsbsim that referenced this pull request Jun 7, 2025
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