[trunk] finalize bio.c/.h related to the v2 style
authorMickael Savinaud <savmickael@users.noreply.github.com>
Wed, 24 Oct 2012 09:09:37 +0000 (09:09 +0000)
committerMickael Savinaud <savmickael@users.noreply.github.com>
Wed, 24 Oct 2012 09:09:37 +0000 (09:09 +0000)
src/lib/openjp2/bio.c
src/lib/openjp2/bio.h

index c3f9231487d5c7dade267899e3a6c9f4238b31f5..f4694069fba4e13991b0239f6ff738c56b771dc4 100644 (file)
@@ -78,7 +78,7 @@ opj_bool opj_bio_byteout(opj_bio_t *bio) {
        if (bio->bp >= bio->end) {
                return OPJ_FALSE;
        }
-       *bio->bp++ = (unsigned char)(bio->buf >> 8); /* TODO MSD: check this conversion */
+       *bio->bp++ = (OPJ_BYTE)(bio->buf >> 8);
        return OPJ_TRUE;
 }
 
@@ -94,7 +94,7 @@ opj_bool opj_bio_bytein(opj_bio_t *bio) {
 
 void opj_bio_putbit(opj_bio_t *bio, OPJ_UINT32 b) {
        if (bio->ct == 0) {
-               opj_bio_byteout(bio); /* TODO_MSD: check this line */
+               opj_bio_byteout(bio); /* MSD: why not check the return value of this function ? */
        }
        bio->ct--;
        bio->buf |= b << bio->ct;
@@ -102,7 +102,7 @@ void opj_bio_putbit(opj_bio_t *bio, OPJ_UINT32 b) {
 
 OPJ_UINT32 opj_bio_getbit(opj_bio_t *bio) {
        if (bio->ct == 0) {
-               opj_bio_bytein(bio); /* TODO_MSD: check this line */
+               opj_bio_bytein(bio); /* MSD: why not check the return value of this function ? */
        }
        bio->ct--;
        return (bio->buf >> bio->ct) & 1;
index 53e0f0db0fc625cf523e902d07e1f6740bbd667b..a69299b9dd439a261981f6002bb19f65bee4067d 100644 (file)
@@ -57,7 +57,7 @@ typedef struct opj_bio {
        /** temporary place where each byte is read or written */
        OPJ_UINT32 buf;
        /** coder : number of bits free to write. decoder : number of bits read */
-       int ct;
+       OPJ_UINT32 ct;
 } opj_bio_t;
 
 /** @name Exported functions */