proper c++-Style with many changes by orgua · Pull Request #26 · br3ttb/Arduino-PID-Library · GitHub
Skip to content

proper c++-Style with many changes#26

Open
orgua wants to merge 1 commit into
br3ttb:masterfrom
orgua:master
Open

proper c++-Style with many changes#26
orgua wants to merge 1 commit into
br3ttb:masterfrom
orgua:master

Conversation

@orgua

@orgua orgua commented Apr 28, 2015

Copy link
Copy Markdown

I implemented some compiler-optimizations and made a first attempt to get closer to recommended c++-style:

  • used constness wherever possible
  • cleaner constructor with proper initialized variables
  • replaced defines (preprocessor) by const type to get better compiler-errors
  • inlined the display-functions --> typically found in the header
  • made the class uncopyable to get no strange undefined behavior if someone tries it
  • controllerDirection and Mode have been int-type, but char will suffice

The changes are tested. My own code behaves the same and the examples still compile. Footprint of code & ram-usage is reduced.

- used constness wherever possible
- cleaner constructor with proper initialized variables
- replaced defines (preprocessor) by const type to get better
compiler-errors
- inlined the display-functions --> typically found in the header
- made the class uncopyable to get no strange undefined behavior if
someone tries it
- controllerDirection and Mode have been int-type, but char will suffice
@orgua

orgua commented May 13, 2015

Copy link
Copy Markdown
Author

@arielbernal

Copy link
Copy Markdown

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.

3 participants