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

Use 'enum' instead of int/#define for PREEMPT_TYPE and SCHEDULER_STATE. #5363

Merged
merged 2 commits into from
Sep 16, 2023

Conversation

davidpanderson
Copy link
Contributor

In theory we should do this for everything like this;
it provides some type checking and prevents passing the wrong type of value
(though I don't recall this ever happening).

Note: you can't parse_int() directly into an enum.
You have to parse into an int, then cast to enum.

Note 2: there's some funky perl code that scrapes common_defs.h
for #defines and makes them into python variables.
I think we can get rid of this.

Also added some comments.
No functional changes.

In theory we should do this for everything like this;
it provides some type checking and prevents passing the wrong type of value
(though I don't recall this ever happening).

Note: you can't parse_int() directly into an enum.
You have to parse into an int, then cast to enum.

Note 2: there's some funky perl code that scrapes common_defs.h
for #defines and makes them into python variables.
I think we can get rid of this.

Also added some comments.
No functional changes.
@codecov
Copy link

codecov bot commented Sep 16, 2023

Codecov Report

Merging #5363 (4bded80) into master (eac3e3a) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5363      +/-   ##
============================================
- Coverage     10.87%   10.87%   -0.01%     
  Complexity     1068     1068              
============================================
  Files           279      279              
  Lines         36059    36061       +2     
  Branches       8335     8335              
============================================
  Hits           3920     3920              
- Misses        31745    31747       +2     
  Partials        394      394              
Files Changed Coverage Δ
lib/common_defs.h 0.00% <ø> (ø)
lib/diagnostics.cpp 0.00% <ø> (ø)
lib/gui_rpc_client.h 0.00% <ø> (ø)
lib/gui_rpc_client_ops.cpp 0.00% <0.00%> (ø)

@AenBleidd AenBleidd merged commit b8aee78 into master Sep 16, 2023
47 of 48 checks passed
@AenBleidd AenBleidd deleted the dpa_enum branch September 16, 2023 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants