summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorMathieu Malaterre <mathieu.malaterre@gmail.com>2014-03-03 16:02:16 +0000
committerMathieu Malaterre <mathieu.malaterre@gmail.com>2014-03-03 16:02:16 +0000
commit765c4ab4f48e5bb9b02b8860400587e1ce97d9a5 (patch)
tree6d043a36a03299fd583bbfadfa4a73fa310e0098 /src/lib
parent24eca792ff2e70df7667ad43b415bd58f75a3a94 (diff)
[trunk] rework code to avoid a warning. this also remove a division and prefer bit-shift
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/openjp2/t2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/openjp2/t2.c b/src/lib/openjp2/t2.c
index 6aee8c72..0bda8be0 100644
--- a/src/lib/openjp2/t2.c
+++ b/src/lib/openjp2/t2.c
@@ -547,8 +547,13 @@ OPJ_BOOL opj_t2_encode_packet( OPJ_UINT32 tileno,
c[1] = 145;
c[2] = 0;
c[3] = 4;
+#if 0
c[4] = (tile->packno % 65536) / 256;
c[5] = (tile->packno % 65536) % 256;
+#else
+ c[4] = (tile->packno >> 8) & 0xff; /* packno is uint32_t */
+ c[5] = tile->packno & 0xff;
+#endif
c += 6;
length -= 6;
}