/* printf("cstr_info.packno %d\n", cstr_info.packno); //NMAX? */
lenp = -1;
- box = (opj_jp2_box_t *)opj_calloc( cstr_info.numcomps, sizeof(opj_jp2_box_t));
+ box = (opj_jp2_box_t *)opj_calloc( (size_t)cstr_info.numcomps, sizeof(opj_jp2_box_t));
for (i=0;i<2;i++){
if (i)
opj_write_manf( i, cstr_info.numcomps, box, cio, p_manager);
for (compno=0; compno<cstr_info.numcomps; compno++){
- box[compno].length = opj_write_ppixfaix( coff, compno, cstr_info, EPHused, j2klen, cio,p_manager);
+ box[compno].length = (OPJ_UINT32)opj_write_ppixfaix( coff, compno, cstr_info, EPHused, j2klen, cio,p_manager);
box[compno].type = JPIP_FAIX;
}
opj_free(box);
- return len;
+ return (int)len;
}
opj_event_mgr_t * p_manager )
{
OPJ_BYTE l_data_header [8];
- int tileno, version, i, nmax, size_of_coding; /* 4 or 8*/
+ OPJ_UINT32 tileno, version, i, nmax, size_of_coding; /* 4 or 8*/
OPJ_UINT32 len;
OPJ_OFF_T lenp;
opj_tile_info_t *tile_Idx;
opj_packet_info_t packet;
- int resno, precno, layno, num_packet;
+ int resno, precno, layno;
+ OPJ_UINT32 num_packet;
int numOfres, numOfprec, numOflayers;
packet.end_pos = packet.end_ph_pos = packet.start_pos = -1;
(void)EPHused; /* unused ? */
opj_stream_write_data(cio,l_data_header,1,p_manager);/* Version 0 = 4 bytes */
nmax = 0;
- for( i=0; i<=cstr_info.numdecompos[compno]; i++)
- nmax += cstr_info.tile[0].ph[i] * cstr_info.tile[0].pw[i] * cstr_info.numlayers;
+ for( i=0; i<=(OPJ_UINT32)cstr_info.numdecompos[compno]; i++)
+ nmax += (OPJ_UINT32)(cstr_info.tile[0].ph[i] * cstr_info.tile[0].pw[i] * cstr_info.numlayers);
opj_write_bytes(l_data_header,nmax,size_of_coding); /* NMAX */
opj_stream_write_data(cio,l_data_header,size_of_coding,p_manager);
- opj_write_bytes(l_data_header,cstr_info.tw*cstr_info.th,size_of_coding); /* M */
+ opj_write_bytes(l_data_header,(OPJ_UINT32)(cstr_info.tw*cstr_info.th),size_of_coding); /* M */
opj_stream_write_data(cio,l_data_header,size_of_coding,p_manager);
- for( tileno=0; tileno<cstr_info.tw*cstr_info.th; tileno++){
+ for( tileno=0; tileno<(OPJ_UINT32)(cstr_info.tw*cstr_info.th); tileno++){
tile_Idx = &cstr_info.tile[ tileno];
num_packet=0;
opj_stream_write_data(cio,l_data_header,4,p_manager);
opj_stream_seek(cio, lenp+len,p_manager);
- return len;
+ return (int)len;
}