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

General code cleanup from Clion-Tidy warnings #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ctadlock
Copy link

@ctadlock ctadlock commented Jan 5, 2023

There are several more warnings that should be looked at, particularly narrowing of data types.

@WanaGo WanaGo requested a review from tonton81 January 15, 2023 20:19
@James-4DSystems
Copy link

Hello ctadlock, thanks for submitted this pull request.

Doing some basic checks, the changes you have proposed fails to compile on boards such as the Arduino Uno, and Arduino Mega, and possibly others.
Do you have a suggestion for the changes you have made, to enable it to compile on all the popular Arduino boards?
It does seem to compile and work fine with an older SAM based Arduino Due, and a ESP32 board, however the older 'legacy' Arduino boards it will not compile for.

At this time we cannot merge your request - please do advise if you have any suggestions.

@James-4DSystems James-4DSystems removed the request for review from tonton81 January 16, 2023 18:44
@James-4DSystems
Copy link

Hello again Ctaglock,

For some tests I changed in the .cpp file the header to be this

#if defined (AVR)
   #include <math.h>
   #include <string.h>
#else
   #include <cmath>
   #include <cstring>
#endif

And now it compiles fine for Uno, Mega, ESP32, Due etc.

Just wondering if you can explain what the reason was to change from math.h to cmath, and string.h to cstring, in the first place?

Going one step back again and just simply having

#include <math.h>
#include <string.h>

Seems to work for all of them too.

If you can explain this, that would be great information to have. Is there something specific in these 2 new includes that the originals did not have?

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