diff options
| author | Edward Welbourne <edward.welbourne@qt.io> | 2023-01-11 20:49:34 +0100 |
|---|---|---|
| committer | Edward Welbourne <edward.welbourne@qt.io> | 2023-01-31 17:35:13 +0100 |
| commit | 1cc4ca3e2c91201a4b223d78daf2481f67e402fb (patch) | |
| tree | 205538b509f2583ecba5a945f3da3d5992c6f5b8 /examples/opengl/contextinfo/widget.cpp | |
| parent | 1737dfa34a38aea05f70b0a1610cb5c3a2eb565c (diff) | |
Avoid overflow when computing remainders from QRoundingDown::qDiv()
For a value in the partial interval just before the type's minimum,
multiplying the qDiv() result back up by the factor overflows; so take
care to adjust the values away from the bound. Introduce qDivMod() to
take care of that; in due course, we can also use it where both
quotient and remainder are wanted.
Done-With: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: I541dae559f4f13ddec5b14376d3e22790b78311a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'examples/opengl/contextinfo/widget.cpp')
0 files changed, 0 insertions, 0 deletions
