[trunk] According to JPIP/A.2.3 in class identifiers should be an unsigned integer. Since portion of codes was using Byte8_t and other was using int, pick Byte8_t as best matching type

This commit is contained in:
Mathieu Malaterre 2012-03-26 14:44:12 +00:00
parent cdf0d77b20
commit 2e493cb89a
8 changed files with 30 additions and 23 deletions

View File

@ -56,7 +56,7 @@ auxtrans_param_t init_aux_transport( int tcp_auxport, int udp_auxport)
auxtrans.udpauxport = udp_auxport;
if( 49152 <= tcp_auxport && tcp_auxport <= 65535)
auxtrans.tcplistensock = open_listeningsocket( tcp_auxport);
auxtrans.tcplistensock = open_listeningsocket( (uint16_t)tcp_auxport);
else
auxtrans.tcplistensock = -1;

View File

@ -360,27 +360,30 @@ void enqueue_precincts( int xmin, int xmax, int ymin, int ymax, int tile_id, int
/* MM: shouldnt xmin/xmax be Byte4_t instead ? */
if( xmin < 0 || xmax < 0 || ymin < 0 || ymax < 0)
return;
/* MM: I think the API should not really be int should it ? */
if( tile_id < 0 )
return;
for( c=0; c<codeidx->SIZ.Csiz; c++)
if( lastcomp == -1 /*all*/ || ( c<=lastcomp && comps[c])){
seq_id = 0;
for( res_lev=0, dec_lev=codeidx->COD.numOfdecomp; dec_lev>=level; res_lev++, dec_lev--){
XTsiz = get_tile_XSiz( codeidx->SIZ, tile_id, dec_lev);
YTsiz = get_tile_YSiz( codeidx->SIZ, tile_id, dec_lev);
XTsiz = get_tile_XSiz( codeidx->SIZ, (Byte4_t)tile_id, dec_lev);
YTsiz = get_tile_YSiz( codeidx->SIZ, (Byte4_t)tile_id, dec_lev);
XPsiz = ( codeidx->COD.Scod & 0x01) ? codeidx->COD.XPsiz[ res_lev] : XTsiz;
YPsiz = ( codeidx->COD.Scod & 0x01) ? codeidx->COD.YPsiz[ res_lev] : YTsiz;
for( u=0; u<ceil((double)YTsiz/(double)YPsiz); u++){
yminP = u*YPsiz;
ymaxP = (u+1)*YPsiz-1;
yminP = (Byte4_t)u*YPsiz;
ymaxP = (Byte4_t)(u+1)*YPsiz-1;
if( YTsiz <= ymaxP)
ymaxP = YTsiz-1;
for( v=0; v<ceil((double)XTsiz/(double)XPsiz); v++, seq_id++){
xminP = v*XPsiz;
xmaxP = (v+1)*XPsiz-1;
xminP = (Byte4_t)v*XPsiz;
xmaxP = (Byte4_t)(v+1)*XPsiz-1;
if( XTsiz <= xmaxP)
xmaxP = XTsiz-1;
@ -412,14 +415,16 @@ void enqueue_allprecincts( int tile_id, int level, int lastcomp, bool *comps, in
Byte4_t XPsiz, YPsiz;
codeidx = msgqueue->cachemodel->target->codeidx;
if( tile_id < 0 )
return;
for( c=0; c<codeidx->SIZ.Csiz; c++)
if( lastcomp == -1 /*all*/ || ( c<=lastcomp && comps[c])){
seq_id = 0;
for( res_lev=0, dec_lev=codeidx->COD.numOfdecomp; dec_lev>=level; res_lev++, dec_lev--){
XTsiz = get_tile_XSiz( codeidx->SIZ, tile_id, dec_lev);
YTsiz = get_tile_YSiz( codeidx->SIZ, tile_id, dec_lev);
XTsiz = get_tile_XSiz( codeidx->SIZ, (Byte4_t)tile_id, dec_lev);
YTsiz = get_tile_YSiz( codeidx->SIZ, (Byte4_t)tile_id, dec_lev);
XPsiz = ( codeidx->COD.Scod & 0x01) ? codeidx->COD.XPsiz[ res_lev] : XTsiz;
YPsiz = ( codeidx->COD.Scod & 0x01) ? codeidx->COD.YPsiz[ res_lev] : YTsiz;

View File

@ -33,6 +33,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <assert.h>
#ifdef SERVER
#include "fcgi_stdio.h"
@ -64,7 +66,7 @@ metadatalist_param_t * const_metadatalist( int fd)
box_param_t *box, *next;
placeholderlist_param_t *phldlist;
placeholder_param_t *phld;
int idx;
Byte8_t idx;
Byte8_t filesize;
if(!(filesize = (Byte8_t)get_filesize( fd)))
@ -120,7 +122,7 @@ void delete_metadatalist( metadatalist_param_t **list)
free( *list);
}
metadata_param_t * gene_metadata( int idx, boxlist_param_t *boxlist, placeholderlist_param_t *phldlist, boxcontents_param_t *boxcontents)
metadata_param_t * gene_metadata( Byte8_t idx, boxlist_param_t *boxlist, placeholderlist_param_t *phldlist, boxcontents_param_t *boxcontents)
{
metadata_param_t *bin;
@ -194,7 +196,7 @@ boxcontents_param_t * gene_boxcontents( OPJ_OFF_T offset, OPJ_SIZE_T length)
return contents;
}
metadata_param_t * search_metadata( int idx, metadatalist_param_t *list)
metadata_param_t * search_metadata( Byte8_t idx, metadatalist_param_t *list)
{
metadata_param_t *found;
@ -227,7 +229,7 @@ Byte8_t search_metadataidx( char boxtype[4], metadatalist_param_t *list)
box_param_t *box = ptr->boxlist->first;
while( box){
if( strncmp ( boxtype, box->type, 4) == 0)
return (Byte8_t)ptr->idx;
return ptr->idx;
box = box->next;
}
}

View File

@ -41,7 +41,7 @@ typedef struct boxcontents_param{
/** metadata-bin parameters*/
typedef struct metadata_param{
int idx; /**< index number*/
Byte8_t idx; /**< index number*/
boxlist_param_t *boxlist; /**< box list*/
placeholderlist_param_t *placeholderlist; /**< placeholder box list*/
boxcontents_param_t *boxcontents; /**< box contens in case of no boxlist and placeholderlist*/
@ -89,7 +89,7 @@ void delete_metadatalist( metadatalist_param_t **list);
* @param[in] boxcontents boxcontents pointer
* @return pointer to the generated metadata bin
*/
metadata_param_t * gene_metadata( int idx, boxlist_param_t *boxlist, placeholderlist_param_t *phldlist, boxcontents_param_t *boxcontents);
metadata_param_t * gene_metadata( Byte8_t idx, boxlist_param_t *boxlist, placeholderlist_param_t *phldlist, boxcontents_param_t *boxcontents);
/**
* delete a metadata bin
@ -127,7 +127,7 @@ void print_allmetadata( metadatalist_param_t *list);
* @param[in] list metadata-bin list pointer
* @return found metadata-bin pointer
*/
metadata_param_t * search_metadata( int idx, metadatalist_param_t *list);
metadata_param_t * search_metadata( Byte8_t idx, metadatalist_param_t *list);
/**

View File

@ -180,7 +180,7 @@ void enqueue_tileheader( int tile_id, msgqueue_param_t *msgqueue)
}
}
void enqueue_tile( int tile_id, int level, msgqueue_param_t *msgqueue)
void enqueue_tile( Byte4_t tile_id, int level, msgqueue_param_t *msgqueue)
{
cachemodel_param_t *cachemodel;
target_param_t *target;
@ -682,7 +682,7 @@ placeholder_param_t * parse_phld( Byte_t *datastream, Byte8_t metalength)
strcpy( phld->TBox, "phld");
phld->Flags = big4( datastream+8);
phld->OrigID = big8( datastream+12);
phld->OrigBHlen = metalength - 20;
phld->OrigBHlen = (Byte_t)(metalength - 20);
phld->OrigBH = (Byte_t *)malloc(phld->OrigBHlen);
memcpy( phld->OrigBH, datastream+20, phld->OrigBHlen);
phld->next = NULL;

View File

@ -54,7 +54,7 @@ typedef struct message_param{
Byte8_t bin_offset; /**< offset of the data in this message from the start of the data-bin*/
Byte8_t length; /**< message byte length*/
Byte8_t aux; /**<*/
Byte8_t res_offset; /**< offset in the resource*/
OPJ_OFF_T res_offset; /**< offset in the resource*/
placeholder_param_t *phld; /**< placeholder pointer in index*/
struct message_param *next; /**< pointer to the next message*/
} message_param_t;
@ -121,7 +121,7 @@ void enqueue_tileheader( int tile_id, msgqueue_param_t *msgqueue);
* @param[in] level decomposition level
* @param[in,out] msgqueue message queue pointer
*/
void enqueue_tile( int tile_id, int level, msgqueue_param_t *msgqueue);
void enqueue_tile( Byte4_t tile_id, int level, msgqueue_param_t *msgqueue);
/**
* enqueue precinct data-bin into message queue

View File

@ -74,7 +74,7 @@ void delete_placeholderlist( placeholderlist_param_t **list)
free( *list);
}
placeholder_param_t * gene_placeholder( box_param_t *box, int origID)
placeholder_param_t * gene_placeholder( box_param_t *box, Byte8_t origID)
{
placeholder_param_t *placeholder;
@ -85,7 +85,7 @@ placeholder_param_t * gene_placeholder( box_param_t *box, int origID)
placeholder->OrigID = origID;
placeholder->OrigBH = fetch_headbytes( box);
placeholder->OrigBHlen = box->headlen;
placeholder->LBox = 20+box->headlen;
placeholder->LBox = 20+(Byte4_t)box->headlen;
placeholder->next = NULL;
return placeholder;

View File

@ -84,7 +84,7 @@ void delete_placeholderlist( placeholderlist_param_t **list);
* @param[in] origID metadata-bin ID of the bin containing the contents of the original box
* @return pointer to the generated placeholder
*/
placeholder_param_t * gene_placeholder( box_param_t *box, int origID);
placeholder_param_t * gene_placeholder( box_param_t *box, Byte8_t origID);
/**