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

fix some bounds checks in FGFCS #1191

Merged
merged 1 commit into from
Nov 24, 2024

Conversation

roccoblues
Copy link
Contributor

This looks like copy-n-paste leftovers.

@roccoblues roccoblues changed the title fix a bunch of bounds checks in FGFCS fix some bounds checks in FGFCS Nov 20, 2024
Copy link

codecov bot commented Nov 24, 2024

Codecov Report

Attention: Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Project coverage is 24.96%. Comparing base (bb4cd5b) to head (e67fc2b).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/models/FGFCS.cpp 0.00% 8 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1191   +/-   ##
=======================================
  Coverage   24.96%   24.96%           
=======================================
  Files         170      170           
  Lines       19283    19283           
=======================================
  Hits         4814     4814           
  Misses      14469    14469           

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


🚨 Try these New Features:

@bcoconni
Copy link
Member

Thanks for the PR @roccoblues

All these vectors are supposed to have the same size since their size increases simultaneously when FGFCS::AddThrottle is called.

jsbsim/src/models/FGFCS.cpp

Lines 697 to 710 in bb4cd5b

void FGFCS::AddThrottle(void)
{
ThrottleCmd.push_back(0.0);
ThrottlePos.push_back(0.0);
MixtureCmd.push_back(0.0); // assume throttle and mixture are coupled
MixturePos.push_back(0.0);
PropAdvanceCmd.push_back(0.0); // assume throttle and prop pitch are coupled
PropAdvance.push_back(0.0);
PropFeatherCmd.push_back(false);
PropFeather.push_back(false);
unsigned int num = (unsigned int)ThrottleCmd.size()-1;
bindThrottle(num);
}

However, it indeed improves the code legibility so PR merged.

@bcoconni bcoconni merged commit 9f64ced into JSBSim-Team:master Nov 24, 2024
29 checks passed
bcoconni pushed a commit to bcoconni/jsbsim that referenced this pull request Nov 24, 2024
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