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

refactoring: positioning of mixed_checker addressing duplicateExpression warning #3366

Merged
merged 1 commit into from
Jan 26, 2024

Conversation

Sharansrj567
Copy link
Contributor

This pull request addresses a code clarity enhancement in the file graphics.c where the yarr array is utilized to store y-coordinates for drawing polygons. The modification aims to improve the understanding of the code by adjusting the assignment of values to yarr[2] based on the parity of the loop index.

Reasons:

Correction for Checkerboard Pattern: In the context of the surrounding code, this adjustment ensures the correct positioning of the checkerboard pattern by modifying the calculation of the y-coordinate.
Code Clarity: The change is made to address the duplicateExpression warning flagged by cppcheck and to enhance the clarity of the code.
Coding Standards: Additionally, the modified code adheres to the existing coding standards.

Testing:
Manual testing has been performed both before and after making the changes to ensure that the behavior of the code remains unchanged.
A screenshot of the changes made is attached to provide a visual reference for the modification.

code

IMG_20240113_184445

IMG_20240113_184428

@github-actions github-actions bot added C Related code is in C module display labels Jan 16, 2024
Copy link
Contributor

@nilason nilason left a comment

Choose a reason for hiding this comment

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

With your present proposed changes I get the following result:

barscale

By keeping the original logic, with my suggested change, it works (without duplicateExpression warning).

display/d.barscale/draw_scale.c Outdated Show resolved Hide resolved
@petrasovaa petrasovaa merged commit 3693974 into OSGeo:main Jan 26, 2024
23 checks passed
@neteler neteler added this to the 8.4.0 milestone Jan 26, 2024
@neteler neteler changed the title refactor: positioning of mixed_checker addressing duplicateExpression warning refactoring: positioning of mixed_checker addressing duplicateExpression warning Jun 15, 2024
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.

4 participants