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

d.legend.vect: Reduce scope of 'bg_w' variable in draw.c #3980

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

ShubhamDesai
Copy link
Contributor

Description:

This pull request reduces the scope of the 'bg_w' variable in d.legend.vect/draw.c.

Changes Made:

  • Moved bg_w declaration to where it is first used in d.legend.vect/draw.c.

This change addresses the following cppcheck warning:

display/d.legend.vect/draw.c:46:26: style: The scope of the variable 'bg_w' can be reduced. [variableScope]
double margin, bg_h, bg_w;

@github-actions github-actions bot added C Related code is in C module display labels Jul 3, 2024
Copy link
Member

@echoix echoix left a comment

Choose a reason for hiding this comment

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

Looks correct, indeed that variable starts being used near the end of the function.

@echoix echoix merged commit 79726a0 into OSGeo:main Jul 4, 2024
26 checks passed
@echoix echoix added this to the 8.5.0 milestone Jul 4, 2024
a0x8o pushed a commit to a0x8o/grass that referenced this pull request Jul 23, 2024
Reduce scope of 'bg_w' variable in d.legend.vect/draw.c

Co-authored-by: Shubham Vasudeo Desai <sdesai8@vclvm178-253.vcl.ncsu.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C Related code is in C display module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants