summaryrefslogtreecommitdiffstats
path: root/src/sql/drivers/mysql/qsql_mysql.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-08-24 15:19:43 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2016-08-25 12:12:14 +0000
commit68c2bf1a1ab9a9764658860827ffa4b5eacd0833 (patch)
tree19c2f5280eef7ce719a231e822b9c79d79476329 /src/sql/drivers/mysql/qsql_mysql.cpp
parent882f344964aae5ac4c03f18209ea6256be5ee0ed (diff)
Correct use of qt_div_255
qt_div_255 does a fast rounded division, the form of rounding is however only valid for positive integers. Correct one case where it was used incorrectly and add it one place it would be valid, and adds a comment to the function. We were using the optimization (x*a + y*(255-a))/255 == (x-y)*a/255 + y but that makes the division by 255 potentially negative. Change-Id: Ie53aa82b66ef801f5d43f8d2ec48880cb4972f69 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/sql/drivers/mysql/qsql_mysql.cpp')
0 files changed, 0 insertions, 0 deletions