*/
/*
- * $Id: jpc_enc.c,v 1.3 2005/06/08 17:39:37 malaterre Exp $
+ * $Id: jpc_enc.c,v 1.5 2005/06/11 02:05:20 malaterre Exp $
*/
/******************************************************************************\
if (cp) {
jpc_enc_cp_destroy(cp);
}
+ (void)ret; /* ret' is assigned a value that is never used in function cp_create */
return 0;
}
} 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;
}
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)) {
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;
int adjust;
int j;
int absbandno;
- long numbytes;
long tilehdrlen;
long tilelen;
jpc_enc_tile_t *tile;
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();
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])) {