You've already forked libjpeg-turbo
mirror of
https://github.com/libjpeg-turbo/libjpeg-turbo.git
synced 2026-10-23 11:48:53 +03:00
turbojpeg.h: Parenthesize TJSCALED() dimension arg
This ensures that, for example, TJSCALED(dim0 + dim1, sf) will evaluate to (((dim0 + dim1) * sf.num + sf.denom - 1) / sf.denom) rather than ((dim0 + (dim1 * sf.num) + sf.denom - 1) / sf.denom)
This commit is contained in:
@@ -594,7 +594,7 @@ typedef void* tjhandle;
|
||||
* factor. This macro performs the integer equivalent of <tt>ceil(dimension *
|
||||
* scalingFactor)</tt>.
|
||||
*/
|
||||
#define TJSCALED(dimension, scalingFactor) ((dimension * scalingFactor.num \
|
||||
#define TJSCALED(dimension, scalingFactor) (((dimension) * scalingFactor.num \
|
||||
+ scalingFactor.denom - 1) / scalingFactor.denom)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user