-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Remove FPP dependencies on native int types #2548
Remove FPP dependencies on native int types #2548
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
…-native-int-types
Note: There are many false-positive warnings due to (1) problems in F Prime that this PR is addressing or (2) problems with the static analysis. Dismissing these warnings one-by-one in the GUI is too painful. I gave up. (You have to click dismiss, wait a few seconds until it resets to the top of the changed file list, and scroll back manually to where you were.) |
It turns out that the static analysis does not work as expected with regard to fixed-width types. It seems that when you declare a variable
It wants |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Review need for pointer cast in model. If needed, switch to PlatformPointerCase
- Review type event counter derived types
Make them all enum store type, but keep queue size as it is. |
The event counters are for counting events emitted at runtime, for purposes of throttling. So I think they should be |
Add size type alias to Serializable Remove type aliases for generated code
With the change of |
@LeStarch I made the requested changes. I also had to introduce a type alias into |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the expected changes fixed!
Change Description
This PR makes changes necessary to remove the dependencies of the FPP model and generated C++ on the native int types
NATIVE_INT_TYPE
andNATIVE_UINT_TYPE
.Incidental changes:
I reformatted a few files via clang-format. We want to do this reformatting anyway on a larger scale. Reformatting is not the primary purpose of this PR, but the reformatting helped me understand the code. Since reformatting obscures change/delete info, I reformatted only hpp files, so you can still see the change/delete info in the corresponding cpp files.
I added some comments in
FpConfig.h
explaining what the configurations do.I renamed
FwBuffSizeType
toFwSizeStoreType
as discussed. I added a type alias forFwBuffSizeType
for backwards compatibility.Rationale
This is a first step in removing
NATIVE_INT_TYPE
andNATIVE_UINT_TYPE
from the code base.Next Steps
NATIVE_INT_TYPE
andNATIVE_UINT_TYPE
. At this time we can replaceNATIVE_INT_TYPE
withFwIndexType
in theportNum
arguments of the port handler implementations.NATIVE_INT_TYPE
andNATIVE_UINT_TYPE
from the code in this repo.FpConfig.h
, replace configurable types except for PlatformInt/Uint with fixed-width types, to eliminate static analysis warnings.Related Issues
nasa/fpp#391