X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=libopenjpeg%2Fbio.c;h=9b6d694cdfd59e5380d9dc9ba9f30da6344d18e1;hb=44cec042941e7b96602b499bf0a554880e607c58;hp=2a305a7925555de77b8950ee690f13cbd46a3f7d;hpb=ed3aec55fdc1a598981823d7e40d078d5b08610b;p=openjpeg.git diff --git a/libopenjpeg/bio.c b/libopenjpeg/bio.c index 2a305a79..9b6d694c 100644 --- a/libopenjpeg/bio.c +++ b/libopenjpeg/bio.c @@ -42,7 +42,7 @@ Write a bit @param bio BIO handle @param b Bit to write (0 or 1) */ -static void bio_putbit(opj_bio_t *bio, int b); +static void bio_putbit(opj_bio_t *bio, unsigned int b); /** Read a bit @param bio BIO handle @@ -78,7 +78,7 @@ static int bio_byteout(opj_bio_t *bio) { if (bio->bp >= bio->end) { return 1; } - *bio->bp++ = bio->buf >> 8; + *bio->bp++ = (unsigned char)(bio->buf >> 8); return 0; } @@ -92,7 +92,7 @@ static int bio_bytein(opj_bio_t *bio) { return 0; } -static void bio_putbit(opj_bio_t *bio, int b) { +static void bio_putbit(opj_bio_t *bio, unsigned int b) { if (bio->ct == 0) { bio_byteout(bio); } @@ -114,7 +114,7 @@ static int bio_getbit(opj_bio_t *bio) { ========================================================== */ -opj_bio_t* bio_create() { +opj_bio_t* bio_create(void) { opj_bio_t *bio = (opj_bio_t*)opj_malloc(sizeof(opj_bio_t)); return bio; } @@ -125,7 +125,7 @@ void bio_destroy(opj_bio_t *bio) { } } -int bio_numbytes(opj_bio_t *bio) { +ptrdiff_t bio_numbytes(opj_bio_t *bio) { return (bio->bp - bio->start); }