Skip to content

Conversation

@gunterkoenigsmann
Copy link

cppcheck is a popular tool that performs static code analysis outputting warnings if constructs are error-prone or do not make sense. In the project wxMaxima some of these warnings have proven to be extremely useful . Getting rid of any warnings that can be fixed makes things easier for users who want cppcheck to find bugs in their code.

This commit resolves the following warnings:

  nanosvg.h:829: style: Variable 'data' is reassigned a value before the old one has been used.
  nanosvg.h:2907: style: Variable 'fp' is reassigned a value before the old one has been used.

The cause of these warnings is that both variables are set to NULL and then assigned a different value to - which is no bug but adds an unnecessary assignment to the code.

cppcheck is a popular tool that performs static code analysis
outputting warnings if constructs are error-prone or do not make
sense. Currently nanosvg produces many warnings, though, making
spotting real errors in a project harder than necessary.

This commit resolves the following warings:

  nanosvg.h:829: style: Variable 'data' is reassigned a value before the old one has been used.
  nanosvg.h:2907: style: Variable 'fp' is reassigned a value before the old one has been used.

The cause of these warnings is that both variables are set to
NULL and then assigned a different value to - which is no bug
but adds an unnecessary assignment to the code.
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.

1 participant