diff options
| author | Antonin Descampe <antonin@gmail.com> | 2016-01-25 23:22:06 +0100 |
|---|---|---|
| committer | Antonin Descampe <antonin@gmail.com> | 2016-01-25 23:22:06 +0100 |
| commit | 0febbff19e05cb1a6c2613eee76ad46a669c96cd (patch) | |
| tree | b6442d01348e2ba6404d0fd6abcc4eb6d6cc1390 /src/lib/openjpip/mhixbox_manager.c | |
| parent | bede1568b197021bb576b935422af6c1d0a79e21 (diff) | |
processed all c/h files through astyle with opj_astyle.cfgcodingstyle
Diffstat (limited to 'src/lib/openjpip/mhixbox_manager.c')
| -rw-r--r-- | src/lib/openjpip/mhixbox_manager.c | 136 |
1 files changed, 68 insertions, 68 deletions
diff --git a/src/lib/openjpip/mhixbox_manager.c b/src/lib/openjpip/mhixbox_manager.c index dcfcfac4..acbf2793 100644 --- a/src/lib/openjpip/mhixbox_manager.c +++ b/src/lib/openjpip/mhixbox_manager.c @@ -46,96 +46,96 @@ mhixbox_param_t * gene_mhixbox( box_param_t *box) { - mhixbox_param_t *mhix; - markeridx_param_t *mkridx, *lastmkidx; - OPJ_OFF_T pos = 0; - - mhix = ( mhixbox_param_t *)malloc( sizeof( mhixbox_param_t)); - - mhix->tlen = fetch_DBox8bytebigendian( box, (pos+=8)-8); - - mhix->first = lastmkidx = NULL; - while( (OPJ_SIZE_T)pos < get_DBoxlen( box)){ - - mkridx = ( markeridx_param_t *)malloc( sizeof( markeridx_param_t)); - mkridx->code = fetch_DBox2bytebigendian( box, (pos+=2)-2); - mkridx->num_remain = fetch_DBox2bytebigendian( box, (pos+=2)-2); - mkridx->offset = (OPJ_OFF_T)fetch_DBox8bytebigendian( box, (pos+=8)-8); - mkridx->length = fetch_DBox2bytebigendian( box, (pos+=2)-2); - mkridx->next = NULL; - - if( mhix->first) - lastmkidx->next = mkridx; - else - mhix->first = mkridx; - lastmkidx = mkridx; - } - return mhix; + mhixbox_param_t *mhix; + markeridx_param_t *mkridx, *lastmkidx; + OPJ_OFF_T pos = 0; + + mhix = ( mhixbox_param_t *)malloc( sizeof( mhixbox_param_t)); + + mhix->tlen = fetch_DBox8bytebigendian( box, (pos+=8)-8); + + mhix->first = lastmkidx = NULL; + while( (OPJ_SIZE_T)pos < get_DBoxlen( box)) { + + mkridx = ( markeridx_param_t *)malloc( sizeof( markeridx_param_t)); + mkridx->code = fetch_DBox2bytebigendian( box, (pos+=2)-2); + mkridx->num_remain = fetch_DBox2bytebigendian( box, (pos+=2)-2); + mkridx->offset = (OPJ_OFF_T)fetch_DBox8bytebigendian( box, (pos+=8)-8); + mkridx->length = fetch_DBox2bytebigendian( box, (pos+=2)-2); + mkridx->next = NULL; + + if( mhix->first) + lastmkidx->next = mkridx; + else + mhix->first = mkridx; + lastmkidx = mkridx; + } + return mhix; } markeridx_param_t * search_markeridx( Byte2_t code, mhixbox_param_t *mhix) { - markeridx_param_t *found; - - found = mhix->first; - - while( found != NULL){ - - if( code == found->code) - return found; - - found = found->next; - } - fprintf( FCGI_stderr, "Error: Marker index %#x not found\n", code); - - return NULL; + markeridx_param_t *found; + + found = mhix->first; + + while( found != NULL) { + + if( code == found->code) + return found; + + found = found->next; + } + fprintf( FCGI_stderr, "Error: Marker index %#x not found\n", code); + + return NULL; } void print_mhixbox( mhixbox_param_t *mhix) { - markeridx_param_t *ptr; - - fprintf( logstream, "mhix box info:\n"); - fprintf( logstream, "\t tlen: %#" PRIx64 "\n", mhix->tlen); - - ptr = mhix->first; - while( ptr != NULL){ - fprintf( logstream, "marker index info:\n" - "\t code: %#x\n" - "\t num_remain: %#x\n" - "\t offset: %#" PRIx64 "\n" - "\t length: %#x\n", ptr->code, ptr->num_remain, ptr->offset, ptr->length); - ptr=ptr->next; - } + markeridx_param_t *ptr; + + fprintf( logstream, "mhix box info:\n"); + fprintf( logstream, "\t tlen: %#" PRIx64 "\n", mhix->tlen); + + ptr = mhix->first; + while( ptr != NULL) { + fprintf( logstream, "marker index info:\n" + "\t code: %#x\n" + "\t num_remain: %#x\n" + "\t offset: %#" PRIx64 "\n" + "\t length: %#x\n", ptr->code, ptr->num_remain, ptr->offset, ptr->length); + ptr=ptr->next; + } } void print_markeridx( markeridx_param_t *markeridx) { - fprintf( logstream, "marker index info:\n" - "\t code: %#x\n" - "\t num_remain: %#x\n" - "\t offset: %#" PRIx64 "\n" - "\t length: %#x\n", markeridx->code, markeridx->num_remain, markeridx->offset, markeridx->length); + fprintf( logstream, "marker index info:\n" + "\t code: %#x\n" + "\t num_remain: %#x\n" + "\t offset: %#" PRIx64 "\n" + "\t length: %#x\n", markeridx->code, markeridx->num_remain, markeridx->offset, markeridx->length); } void delete_mhixbox( mhixbox_param_t **mhix) { - markeridx_param_t *mkPtr, *mkNext; - - mkPtr = (*mhix)->first; - while( mkPtr != NULL){ - mkNext=mkPtr->next; + markeridx_param_t *mkPtr, *mkNext; + + mkPtr = (*mhix)->first; + while( mkPtr != NULL) { + mkNext=mkPtr->next; #ifndef SERVER - /* fprintf( logstream, "local log: marker index %#x deleted!\n", mkPtr->code); */ + /* fprintf( logstream, "local log: marker index %#x deleted!\n", mkPtr->code); */ #endif - free(mkPtr); - mkPtr=mkNext; - } - free(*mhix); + free(mkPtr); + mkPtr=mkNext; + } + free(*mhix); } |
