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

app_rpt.c: change timers of unnecessary long to int #471

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mkmer
Copy link
Collaborator

@mkmer mkmer commented Jan 28, 2025

Not sure how I missed the compiler warnings when I tested #457
The changed timers are unnecessarily long. We could alternately go with long for all timers if there is concern about expanding beyond 32767ms for any timer. Currently all of them appear to fit in an int.

The changed timers are unnecessarily of type long.
@Allan-N
Copy link
Collaborator

Allan-N commented Jan 28, 2025

We could alternately go with long for all timers if there is concern about expanding beyond 32767ms for any timer.

I think your math may be off. A [32-bit] "int" has a max value of 0x7FFFFFFF (2147483647). If that number is in "ms" then we would have 2147483647/1000 = 2147483 seconds (24+ days). As long as we're not computing how much time has elapsed at that scale we should be good.

@mkmer mkmer added the code quality Improvments around code quality without functional changes label Jan 30, 2025
@Allan-N Allan-N assigned Allan-N and mkmer and unassigned Allan-N Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality Improvments around code quality without functional changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants