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)
diff --git a/turbojpeg.h b/turbojpeg.h
index 951112b..4b41093 100644
--- a/turbojpeg.h
+++ b/turbojpeg.h
@@ -493,7 +493,7 @@
* 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)