X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2Fgdcmjasper%2Fsrc%2Flibjasper%2Fjpc%2Fjpc_enc.c;h=ec13ad23b274fdf7ff75ed5efd51e3aaac2f83dc;hb=1b14200990537794a9f66d43c89b030459237edc;hp=9a6916a93d396f84c9fecf2db73fffe3b5bf7970;hpb=cf6d10959e9a3a98b2ed7afff6db0e21ca4544bb;p=gdcm.git diff --git a/src/gdcmjasper/src/libjasper/jpc/jpc_enc.c b/src/gdcmjasper/src/libjasper/jpc/jpc_enc.c index 9a6916a9..ec13ad23 100644 --- a/src/gdcmjasper/src/libjasper/jpc/jpc_enc.c +++ b/src/gdcmjasper/src/libjasper/jpc/jpc_enc.c @@ -62,7 +62,7 @@ */ /* - * $Id: jpc_enc.c,v 1.2 2005/06/07 19:22:42 malaterre Exp $ + * $Id: jpc_enc.c,v 1.5 2005/06/11 02:05:20 malaterre Exp $ */ /******************************************************************************\ @@ -768,6 +768,7 @@ error: if (cp) { jpc_enc_cp_destroy(cp); } + (void)ret; /* ret' is assigned a value that is never used in function cp_create */ return 0; } @@ -797,9 +798,10 @@ int ratestrtosize(char *s, uint_fast32_t rawsize, uint_fast32_t *size) } else if (f > 1.0) { *size = rawsize + 1; } else { - *size = f * rawsize; + *size = (uint_fast32_t)(f * rawsize); } } + (void)cp; /* 'cp' is assigned a value that is never used in function ratestrtosize */ return 0; } @@ -1035,8 +1037,8 @@ startoff = jas_stream_getrwcount(enc->out); cod->mctrans = (cp->tcp.mctid != JPC_MCT_NONE); if (tccp->csty & JPC_COX_PRT) { for (rlvlno = 0; rlvlno < tccp->maxrlvls; ++rlvlno) { - cod->compparms.rlvls[rlvlno].parwidthval = tccp->prcwidthexpns[rlvlno]; - cod->compparms.rlvls[rlvlno].parheightval = tccp->prcheightexpns[rlvlno]; + cod->compparms.rlvls[rlvlno].parwidthval = (uint_fast8_t)tccp->prcwidthexpns[rlvlno]; + cod->compparms.rlvls[rlvlno].parheightval = (uint_fast8_t)tccp->prcheightexpns[rlvlno]; } } if (jpc_putms(enc->out, enc->cstate, enc->mrk)) { @@ -1096,14 +1098,13 @@ startoff = jas_stream_getrwcount(enc->out); enc->mainbodysize = UINT_FAST32_MAX; } + (void)mctsynweight; /* 'mctsynweight' is assigned a value that is never used in function jpc_enc_encodemainhdr */ return 0; } static int jpc_enc_encodemainbody(jpc_enc_t *enc) { int tileno; - int tilex; - int tiley; int i; jpc_sot_t *sot; jpc_enc_tcmpt_t *comp; @@ -1117,7 +1118,6 @@ static int jpc_enc_encodemainbody(jpc_enc_t *enc) int adjust; int j; int absbandno; - long numbytes; long tilehdrlen; long tilelen; jpc_enc_tile_t *tile; @@ -1139,12 +1139,7 @@ int numgbits; cp = enc->cp; - /* Avoid compile warnings. */ - numbytes = 0; - for (tileno = 0; tileno < JAS_CAST(int, cp->numtiles); ++tileno) { - tilex = tileno % cp->numhtiles; - tiley = tileno / cp->numhtiles; if (!(enc->curtile = jpc_enc_tile_create(enc->cp, enc->image, tileno))) { abort(); @@ -1394,14 +1389,14 @@ if (jpc_enc_enccblks(enc)) { rho = (double) (tile->brx - tile->tlx) * (tile->bry - tile->tly) / ((cp->refgrdwidth - cp->imgareatlx) * (cp->refgrdheight - cp->imgareatly)); - tile->rawsize = cp->rawsize * rho; + tile->rawsize = (uint_fast32_t)(cp->rawsize * rho); for (lyrno = 0; lyrno < tile->numlyrs - 1; ++lyrno) { - tile->lyrsizes[lyrno] = tile->rawsize * jpc_fixtodbl( - cp->tcp.ilyrrates[lyrno]); + tile->lyrsizes[lyrno] = (uint_fast32_t)(tile->rawsize * jpc_fixtodbl( + cp->tcp.ilyrrates[lyrno])); } - tile->lyrsizes[tile->numlyrs - 1] = (cp->totalsize != UINT_FAST32_MAX) ? - (rho * enc->mainbodysize) : UINT_FAST32_MAX; + tile->lyrsizes[tile->numlyrs - 1] = (uint_fast32_t)((cp->totalsize != UINT_FAST32_MAX) ? + (rho * enc->mainbodysize) : UINT_FAST32_MAX); for (lyrno = 0; lyrno < tile->numlyrs; ++lyrno) { if (tile->lyrsizes[lyrno] != UINT_FAST32_MAX) { if (tilehdrlen <= JAS_CAST(long, tile->lyrsizes[lyrno])) { @@ -2505,7 +2500,7 @@ static jpc_enc_cblk_t *cblk_create(jpc_enc_cblk_t *cblk, jpc_enc_cp_t *cp, jpc_e uint_fast32_t cblkno; uint_fast32_t tlcblktlx; uint_fast32_t tlcblktly; - // unused: + /* unused:*/ (void)cp; cblkno = cblk - prc->cblks;