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

large timeout values trigger compilation warning. #198

Closed
cornfeedhobo opened this issue Jan 8, 2025 · 1 comment · Fixed by #199
Closed

large timeout values trigger compilation warning. #198

cornfeedhobo opened this issue Jan 8, 2025 · 1 comment · Fixed by #199

Comments

@cornfeedhobo
Copy link
Contributor

cornfeedhobo commented Jan 8, 2025

When setting

#define SCREENSAVER_B_MAX_TIME_SEC 3600

I get this warning

/mnt/src/defaults.c:44:59: warning: integer overflow in expression of type 'int' results in '-694967296' [-Woverflow]
   44 |                 .max_time_us = SCREENSAVER_B_MAX_TIME_SEC * 1000000,

It's an easy fix, enforce 64 bit precision at assignment:

                .max_time_us = (uint64_t)SCREENSAVER_B_MAX_TIME_SEC * 1000000,

This needs to be done for

  • SCREENSAVER_(A|B)_IDLE_TIME_SEC
  • SCREENSAVER_(A|B)_MAX_TIME_SEC
@cornfeedhobo
Copy link
Contributor Author

I think there might be more going on here. I noticed that my device doesn't respect SCREENSAVER_(A|B)_MAX_TIME_SEC.

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 a pull request may close this issue.

1 participant