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

Coarse grained, initial sanitization #1

Merged
merged 12 commits into from
Jul 30, 2018
Merged

Coarse grained, initial sanitization #1

merged 12 commits into from
Jul 30, 2018

Conversation

nazavode
Copy link

@nazavode nazavode commented Jul 29, 2018

This PR introduces some basic sanitizations applied while studying the code base.

This is related to forthelols/4nxt#85

As suggested by FSF, added an updated version of the LGPLv2 license file,
the original one was outdated.
All preprocessor definitions beginning with a double underscore followed by an uppercase character (in regex terms: "__([A-Z]+)") are techically undefined behaviour due to the fact that the C and C++ standards reserve all macros in that form for standard purposes. All inclusion guards are replaced with with safer alternatives.
Just to avoid confusion, normalized all line terminations to UNIX (Visual Studio can handle both).
Fixed all inclusion guard macros just to avoid nightmare bugs in the
future (there are lots of headers with same name and guards in different
inclusion paths). Fix has been applied with:

$ clang-tidy -checks="-*,llvm-header-guard" -fix
@nazavode nazavode self-assigned this Jul 29, 2018
Copy link

@alalazo alalazo left a comment

Choose a reason for hiding this comment

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

I had a look yesterday. LGTM.

@alalazo
Copy link

alalazo commented Jul 29, 2018

I tried to compile the code for Unix. make exits with non zero, but all the relevant libraries (e.g the Unix virtual driver) are there. I could start the TestMasterSlave application only after moving the libcanfestival_can_virtual.so to the place where the application expects it. It seems to run indefinitely, without exiting and with an output like:

...
TestSlave_post_TPDO
OnMasterMap1Update:1
1->[ 0  ]id:00 SYNC  rtr:0 len:0
TestMaster_post_sync
Master: 1 1 0 0 1 0 1 0 16 ff00ff00 abcd 2323 2322
TestMaster_post_TPDO MasterSyncCount = 1092 
TestSlave_post_sync
Slave: 1 1 0 0 1 0 1 0 16 ff00ff00 abcd 129 2326 
0->[ 1  ]id:02 PDO1tx  rtr:0 len:6 53 10 00 ff 00 ff
0->[ 1  ]id:02 PDO2tx  rtr:0 len:2 cd ab
TestSlave_post_TPDO
OnMasterMap1Update:1
1->[ 0  ]id:00 SYNC  rtr:0 len:0
TestMaster_post_sync
Master: 1 1 0 0 1 0 1 0 16 ff00ff00 abcd 2323 2322
TestMaster_post_TPDO MasterSyncCount = 1093 
TestSlave_post_sync
Slave: 1 1 0 0 1 0 1 0 16 ff00ff00 abcd 129 2327 
0->[ 1  ]id:02 PDO1tx  rtr:0 len:6 53 10 00 ff 00 ff
0->[ 1  ]id:02 PDO2tx  rtr:0 len:2 cd ab
TestSlave_post_TPDO
0->[ 1  ]id:02 EMCY  rtr:0 len:8 00 42 08 00 00 00 00 00
0->[ 1  ]id:02 EMCY  rtr:0 len:8 00 00 00 00 00 00 00 00
OnMasterMap1Update:1
Master received EMCY message. Node: 02  ErrorCode: 4200  ErrorRegister: 08
Master received EMCY message. Node: 02  ErrorCode: 0000  ErrorRegister: 00
1->[ 0  ]id:00 SYNC  rtr:0 len:0
TestMaster_post_sync
Master: 1 1 0 0 1 0 1 0 16 ff00ff00 abcd 2323 2322
TestMaster_post_TPDO MasterSyncCount = 1094 
TestSlave_post_sync

...

@nazavode
Copy link
Author

@alalazo just obtained the same result on master, my guess is that the original build system needs to be somehow tweaked by the user before any actual use.

@alalazo
Copy link

alalazo commented Jul 29, 2018

just obtained the same result on master, my guess is that the original build system needs to be somehow tweaked by the user before any actual use.

My impression too.

@nazavode nazavode merged commit bc9546e into develop Jul 30, 2018
@nazavode nazavode deleted the feature/cleanup branch July 30, 2018 22:30
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