summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorMathieu Malaterre <mathieu.malaterre@gmail.com>2014-02-24 08:52:44 +0000
committerMathieu Malaterre <mathieu.malaterre@gmail.com>2014-02-24 08:52:44 +0000
commit33d8f08964ca48183241d680ccd692378e25cc70 (patch)
tree68cc37e8c5dca2fdf0e2fd3c9b962654cfe1ac67 /src/lib
parente826e9281e084032815c05830d6e4b2fa584f722 (diff)
[trunk] Fix a warning about type conversion. Use a trick where unsigned wrapping is legal
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/openjp2/bio.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/openjp2/bio.c b/src/lib/openjp2/bio.c
index 797e01e1..213a9941 100644
--- a/src/lib/openjp2/bio.c
+++ b/src/lib/openjp2/bio.c
@@ -146,17 +146,17 @@ void opj_bio_init_dec(opj_bio_t *bio, OPJ_BYTE *bp, OPJ_UINT32 len) {
}
void opj_bio_write(opj_bio_t *bio, OPJ_UINT32 v, OPJ_UINT32 n) {
- OPJ_INT32 i;
- for (i = n - 1; i >= 0; i--) {
+ OPJ_UINT32 i;
+ for (i = n - 1; i < n; i--) {
opj_bio_putbit(bio, (v >> i) & 1);
}
}
OPJ_UINT32 opj_bio_read(opj_bio_t *bio, OPJ_UINT32 n) {
- OPJ_INT32 i;
+ OPJ_UINT32 i;
OPJ_UINT32 v;
v = 0;
- for (i = n - 1; i >= 0; i--) {
+ for (i = n - 1; i < n; i--) {
v += opj_bio_getbit(bio) << i;
}
return v;