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

C code style format and checks #20

Merged
merged 5 commits into from
May 21, 2019
Merged

C code style format and checks #20

merged 5 commits into from
May 21, 2019

Conversation

PFigs
Copy link
Contributor

@PFigs PFigs commented May 9, 2019

This commit updates the travis pipeline to
check violations of the c code standard.

It also adds a script to apply the style to
any .c or .h file in the project.

This commit updates the travis pipeline to
check violations of the c code standard.

It also adds a script to apply the style to
any .c or .h file in the project.
.ci/style-check.sh Show resolved Hide resolved
.ci/apply-style.sh Show resolved Hide resolved
.ci/apply-style.sh Show resolved Hide resolved
@PFigs PFigs requested a review from GwendalRaoul May 9, 2019 14:01
&travel_time,
&qos,
&hop_count);
r = sd_bus_message_read(
Copy link
Contributor

Choose a reason for hiding this comment

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

In this case, could you remove clang formatting?
All those parameters are more readable with one on each line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It actually makes no sense shy the format is being applied like this :(

{
int r;
/* Release the GIL. It will be acquire by the callback
* It make this thread totally independant from python code
*/
Py_BEGIN_ALLOW_THREADS
for (;;)
Py_BEGIN_ALLOW_THREADS for (;;)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is it put on same line?

travel_time,
qos,
hop_count);
r = sd_bus_message_append(
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, it would be better to keep one on each line

@@ -84,7 +82,8 @@ int main(int argc, char *argv[])
break;
case 'i':
/* Get the sink id to generate service name */
sink_id = strtoul(optarg, NULL, 0);;
sink_id = strtoul(optarg, NULL, 0);
;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can be removed ;-)

SD_BUS_PROPERTY("ProcessedLen", "u", NULL, offsetof(sink_otap_t, processed_len), 0),
SD_BUS_PROPERTY("ProcessedCrc", "q", NULL, offsetof(sink_otap_t, processed_crc), 0),
SD_BUS_PROPERTY("ProcessedSeq", "y", NULL, offsetof(sink_otap_t, processed_seq), 0),
SD_BUS_PROPERTY("StoredLen", "u", NULL, offsetof(sink_otap_t, stored_len), 0),
Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer the old allignement here

@PFigs PFigs force-pushed the apply-clang-format branch from dbe166b to f900e5a Compare May 21, 2019 07:10
@PFigs PFigs merged commit 57f3875 into master May 21, 2019
@PFigs PFigs deleted the apply-clang-format branch May 21, 2019 11:09
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