Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit resolves a couple problems.
First, it changes the return type of NoteGetMs. NoteGetMs is simply a wrapper around the user-supplied millisecond timer hook. The prototype for this hook specifies that it should return a uint32_t yet NoteGetMs's return type is long unsigned int. This commit changes the return type of NoteGetMs to uint32_t.
Second, there are many places in the code where we are comparing and assigning millisecond timer values (i.e. gotten via NoteGetMs) to size_t variables. This is a bug. On some platforms (e.g. the Arduino Uno), size_t is 16 bits, so assigning one of these 32-bit millisecond timer values to a 16-bit variable can lead to undefined behavior when the timer value is larger than what can fit into 16 bits. This commit fixes all these bugs by using uint32_t instead of size_t.