diff --git a/applications/jpip/CHANGES b/applications/jpip/CHANGES new file mode 100644 index 00000000..3c10897f --- /dev/null +++ b/applications/jpip/CHANGES @@ -0,0 +1,20 @@ +What's New for OpenJPIP + +* : fixed +- : removed +! : changed ++ : added + +May 9, 2011 +* [kaori] Removal of c99 from the compile option (to be compatible to win platform) and bool definition in libopenjpip/bool.h + +May 9, 2011 +* [antonin] OpenJPIP: small bug fixes to compile on win platform + +May 8, 2011 +* [antonin] OpenJPIP: fixed several bugs in opj_server (removal of strsep function, duplication of query string) + some changes to compile opj_server under windows (replacement of strcasecmp(), bzero()). + +April 14, 2011 ++ [antonin] initial commit of OpenJPIP 1.0, a JPIP client-server architecture based on OpenJPEG (see README file in jpip directory for more details) +* [antonin] fixed applications/codec/CMakeLists.txt that prevented JPWL executables to be built with JPWL functionalities. +! [antonin] changed make all behaviour : DOC target removed from ALL. diff --git a/applications/jpip/libopenjpip/bool.h b/applications/jpip/libopenjpip/bool.h new file mode 100644 index 00000000..c3adf580 --- /dev/null +++ b/applications/jpip/libopenjpip/bool.h @@ -0,0 +1,52 @@ +/* + * $Id$ + * + * Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium + * Copyright (c) 2002-2011, Professor Benoit Macq + * Copyright (c) 2010-2011, Kaori Hagihara + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef BOOL_H_ +# define BOOL_H_ + +#ifndef false +#define false 0 +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + +#ifndef true +#define true (!false) +#endif + +#ifndef TRUE +#define TRUE (!FALSE) +#endif + +typedef char bool; + +#endif /* !BOOL_H_ */ diff --git a/applications/jpip/libopenjpip/comMakefile.mk b/applications/jpip/libopenjpip/comMakefile.mk index 7485441b..de54ee0a 100644 --- a/applications/jpip/libopenjpip/comMakefile.mk +++ b/applications/jpip/libopenjpip/comMakefile.mk @@ -1,8 +1,8 @@ ifdef jpipserver -CFLAGS = -O3 -Wall -std=c99 -pedantic -m32 -DSERVER +CFLAGS = -O3 -Wall -m32 -DSERVER LIBNAME = libopenjpip_server.a else -CFLAGS = -O3 -Wall -std=c99 -pedantic +CFLAGS = -O3 -Wall LIBNAME = libopenjpip_local.a endif diff --git a/applications/jpip/libopenjpip/faixbox_manager.c b/applications/jpip/libopenjpip/faixbox_manager.c index 64e90978..c5be6413 100644 --- a/applications/jpip/libopenjpip/faixbox_manager.c +++ b/applications/jpip/libopenjpip/faixbox_manager.c @@ -1,5 +1,5 @@ /* - * $Id: faixbox_manager.c 44 2011-02-15 12:32:29Z kaori $ + * $Id: faixbox_manager.c 53 2011-05-09 16:55:39Z kaori $ * * Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium * Copyright (c) 2002-2011, Professor Benoit Macq @@ -59,6 +59,7 @@ faixbox_param_t * gene_faixbox( box_param_t *box) if( faix->version%2){ subfaixbox8_param_t *subfaixbox; + int i; faix->subfaixbox.byte8_params = (subfaixbox8_param_t *)malloc( sizeof(subfaixbox8_param_t)); @@ -73,7 +74,7 @@ faixbox_param_t * gene_faixbox( box_param_t *box) if( faix->version == 3) subfaixbox->aux = ( Byte4_t *)malloc( numOfelem*sizeof(Byte4_t)); - for( int i=0; ielem[i].off = fetch_DBox8bytebigendian( box, (pos+=8)-8); subfaixbox->elem[i].len = fetch_DBox8bytebigendian( box, (pos+=8)-8); if( faix->version == 3) @@ -82,6 +83,7 @@ faixbox_param_t * gene_faixbox( box_param_t *box) } else{ subfaixbox4_param_t *subfaixbox; + int i; faix->subfaixbox.byte4_params = (subfaixbox4_param_t *)malloc( sizeof(subfaixbox4_param_t)); @@ -96,7 +98,7 @@ faixbox_param_t * gene_faixbox( box_param_t *box) if( faix->version == 2) subfaixbox->aux = ( Byte4_t *)malloc( numOfelem*sizeof(Byte4_t)); - for( int i=0; ielem[i].off = fetch_DBox4bytebigendian( box, (pos+=4)-4); subfaixbox->elem[i].len = fetch_DBox4bytebigendian( box, (pos+=4)-4); if( faix->version == 2) @@ -108,14 +110,16 @@ faixbox_param_t * gene_faixbox( box_param_t *box) void print_faixbox( faixbox_param_t *faix) { + Byte8_t i, j; + fprintf( logstream, "faix box info\n"); fprintf( logstream, "\tversion: %d\n", faix->version); fprintf( logstream, "\t nmax: %#llx = %lld\n", get_nmax( faix), get_nmax( faix)); fprintf( logstream, "\t m: %#llx = %lld\n", get_m( faix), get_m( faix)); - for( Byte8_t i=0; iversion) fprintf( logstream, ", aux = %#x", get_elemAux( faix, j, i)); diff --git a/applications/jpip/libopenjpip/index_manager.c b/applications/jpip/libopenjpip/index_manager.c index 39cc8243..847fd528 100644 --- a/applications/jpip/libopenjpip/index_manager.c +++ b/applications/jpip/libopenjpip/index_manager.c @@ -1,5 +1,5 @@ /* - * $Id: index_manager.c 44 2011-02-15 12:32:29Z kaori $ + * $Id: index_manager.c 53 2011-05-09 16:55:39Z kaori $ * * Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium * Copyright (c) 2002-2011, Professor Benoit Macq @@ -28,14 +28,13 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include #include -#include #include #include #include #include #include + #include "index_manager.h" #include "box_manager.h" #include "manfbox_manager.h" @@ -124,6 +123,8 @@ index_param_t * parse_jp2file( int fd) void print_index( index_param_t index) { + int i; + fprintf( logstream, "index info:\n"); fprintf( logstream, "\tCodestream Offset: %#llx\n", index.offset); fprintf( logstream, "\t Length: %#llx\n", index.length); @@ -136,7 +137,7 @@ void print_index( index_param_t index) fprintf( logstream, "\t XTnum, YTnum: (%d,%d)\n", index.XTnum, index.YTnum); fprintf( logstream, "\t Num of Components: %d\n", index.Csiz); - for( int i=0; itp_model = (bool *)malloc( numOfelem*sizeof(bool)); - bzero( jp2idx->tp_model, numOfelem*sizeof(bool)); + memset( jp2idx->tp_model, 0, numOfelem*sizeof(bool)); //delete_faixbox( &faix); // currently the jp2idx element free( tpix_box); @@ -447,7 +449,8 @@ bool set_thixdata( box_param_t *cidx_box, index_param_t *jp2idx) bool set_SIZmkrdata( markeridx_param_t *sizmkidx, codestream_param_t codestream, index_param_t *jp2idx) { marker_param_t sizmkr; - + int i; + sizmkr = set_marker( codestream, sizmkidx->code, sizmkidx->offset, sizmkidx->length); if( sizmkidx->length != fetch_marker2bytebigendian( sizmkr, 0)){ @@ -469,7 +472,7 @@ bool set_SIZmkrdata( markeridx_param_t *sizmkidx, codestream_param_t codestream, jp2idx->XTnum = ( jp2idx->Xsiz-jp2idx->XTOsiz+jp2idx->XTsiz-1)/jp2idx->XTsiz; jp2idx->YTnum = ( jp2idx->Ysiz-jp2idx->YTOsiz+jp2idx->YTsiz-1)/jp2idx->YTsiz; - for( int i=0; i<(int)jp2idx->Csiz; i++){ + for( i=0; i<(int)jp2idx->Csiz; i++){ jp2idx->Ssiz[i] = fetch_marker1byte( sizmkr, 38+i*3); jp2idx->XRsiz[i] = fetch_marker1byte( sizmkr, 39+i*3); jp2idx->YRsiz[i] = fetch_marker1byte( sizmkr, 40+i*3); @@ -496,11 +499,12 @@ range_param_t get_tile_Yrange( index_param_t index, Byte4_t tile_yid, int level) range_param_t get_tile_range( Byte4_t Osiz, Byte4_t siz, Byte4_t TOsiz, Byte4_t Tsiz, Byte4_t tile_id, int level) { range_param_t range; + int n; range.minvalue = max( Osiz, TOsiz+tile_id*Tsiz); range.maxvalue = min( siz, TOsiz+(tile_id+1)*Tsiz); - for( int n=0; n -#include +#include "bool.h" #include "byte_manager.h" #include "faixbox_manager.h" #include "metadata_manager.h" diff --git a/applications/jpip/libopenjpip/metadata_manager.c b/applications/jpip/libopenjpip/metadata_manager.c index aa15e335..780a741b 100644 --- a/applications/jpip/libopenjpip/metadata_manager.c +++ b/applications/jpip/libopenjpip/metadata_manager.c @@ -1,5 +1,5 @@ /* - * $Id: metadata_manager.c 44 2011-02-15 12:32:29Z kaori $ + * $Id: metadata_manager.c 53 2011-05-09 16:55:39Z kaori $ * * Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium * Copyright (c) 2002-2011, Professor Benoit Macq @@ -218,8 +218,9 @@ metadata_param_t * search_metadata( int idx, metadatalist_param_t *list) int search_metadataidx( char boxtype[4], metadatalist_param_t *list) { metadata_param_t *ptr; + int i; - for( int i=0; i<4; i++) + for( i=0; i<4; i++) if( boxtype[i] == '_') boxtype[i] = ' '; diff --git a/applications/jpip/libopenjpip/msgqueue_manager.c b/applications/jpip/libopenjpip/msgqueue_manager.c index d45e379b..dd7f2838 100644 --- a/applications/jpip/libopenjpip/msgqueue_manager.c +++ b/applications/jpip/libopenjpip/msgqueue_manager.c @@ -1,5 +1,5 @@ /* - * $Id: msgqueue_manager.c 44 2011-02-15 12:32:29Z kaori $ + * $Id: msgqueue_manager.c 53 2011-05-09 16:55:39Z kaori $ * * Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium * Copyright (c) 2002-2011, Professor Benoit Macq @@ -154,6 +154,7 @@ void enqueue_tile( int tile_id, int level, msgqueue_param_t *msgqueue) faixbox_param_t *tilepart; message_param_t *msg; Byte8_t binOffset, binLength; + int i; target = msgqueue->target; codeidx = target->codeidx; @@ -170,7 +171,7 @@ void enqueue_tile( int tile_id, int level, msgqueue_param_t *msgqueue) tp_model = &codeidx->tp_model[ tile_id*numOftparts]; binOffset=0; - for( int i=0; i=i; j--) + for( j=segmentlen-1; j>=i; j--) putchar('0'); - for( int j=i-1, k=0; j>=0; j--, k++){ + for( j=i-1, k=0; j>=0; j--, k++){ putchar( buf[j]); if( !((k+1)%segmentlen)) printf(" "); @@ -721,6 +723,7 @@ Byte_t * recons_codestream( msgqueue_param_t *msgqueue, Byte_t *stream, Byte8_t message_param_t *ptr; Byte_t *codestream = NULL; int last_tileID; + int tileID; *codelen = 0; @@ -733,7 +736,7 @@ Byte_t * recons_codestream( msgqueue_param_t *msgqueue, Byte_t *stream, Byte8_t last_tileID = get_last_tileID( msgqueue, csn); - for( int tileID=0; tileID <= last_tileID; tileID++){ + for( tileID=0; tileID <= last_tileID; tileID++){ bool found = false; ptr = msgqueue->first; while(( ptr = search_message( TILE_MSG, tileID, csn, ptr))!=NULL){ diff --git a/applications/jpip/libopenjpip/msgqueue_manager.h b/applications/jpip/libopenjpip/msgqueue_manager.h index 50471e9c..bb305a2c 100644 --- a/applications/jpip/libopenjpip/msgqueue_manager.h +++ b/applications/jpip/libopenjpip/msgqueue_manager.h @@ -1,5 +1,5 @@ /* - * $Id: msgqueue_manager.h 44 2011-02-15 12:32:29Z kaori $ + * $Id: msgqueue_manager.h 53 2011-05-09 16:55:39Z kaori $ * * Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium * Copyright (c) 2002-2011, Professor Benoit Macq @@ -31,8 +31,8 @@ #ifndef MSGQUEUE_MANAGER_H_ # define MSGQUEUE_MANAGER_H_ -#include #include +#include "bool.h" #include "byte_manager.h" #include "target_manager.h" #include "placeholder_manager.h" diff --git a/applications/jpip/libopenjpip/placeholder_manager.c b/applications/jpip/libopenjpip/placeholder_manager.c index e511477c..803889b4 100644 --- a/applications/jpip/libopenjpip/placeholder_manager.c +++ b/applications/jpip/libopenjpip/placeholder_manager.c @@ -1,5 +1,5 @@ /* - * $Id: placeholder_manager.c 44 2011-02-15 12:32:29Z kaori $ + * $Id: placeholder_manager.c 53 2011-05-09 16:55:39Z kaori $ * * Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium * Copyright (c) 2002-2011, Professor Benoit Macq @@ -108,16 +108,20 @@ void insert_placeholder_into_list( placeholder_param_t *phld, placeholderlist_pa void print_placeholder( placeholder_param_t *phld) { + int i; + fprintf( logstream, "placeholder info:\n"); fprintf( logstream, "\t LBox: %d %#x\n", phld->LBox, phld->LBox); fprintf( logstream, "\t TBox: %.4s\n", phld->TBox); fprintf( logstream, "\t Flags: %#x %#x\n", phld->Flags, phld->Flags); fprintf( logstream, "\t OrigID: %lld\n", phld->OrigID); fprintf( logstream, "\t OrigBH: "); - for( int i=0; i< phld->OrigBHlen; i++) + + for( i=0; i< phld->OrigBHlen; i++) fprintf( logstream, "%02x ", phld->OrigBH[i]); fprintf( logstream, "\t"); - for( int i=0; i< phld->OrigBHlen; i++) + + for( i=0; i< phld->OrigBHlen; i++) fprintf( logstream, "%c", phld->OrigBH[i]); fprintf( logstream, "\n"); } diff --git a/applications/jpip/opj_client/opj_dec_server/Makefile b/applications/jpip/opj_client/opj_dec_server/Makefile index 3f0943ba..ba992545 100644 --- a/applications/jpip/opj_client/opj_dec_server/Makefile +++ b/applications/jpip/opj_client/opj_dec_server/Makefile @@ -1,6 +1,6 @@ LIBDIR = ../../libopenjpip LIBFNAME = $(LIBDIR)/libopenjpip_local.a -CFLAGS = -O3 -Wall -std=c99 -pedantic -I$(LIBDIR) +CFLAGS = -O3 -Wall -I$(LIBDIR) LDFLAGS = -L$(LIBDIR) -lm -lopenjpeg -lopenjpip_local diff --git a/applications/jpip/opj_client/opj_dec_server/cache_manager.c b/applications/jpip/opj_client/opj_dec_server/cache_manager.c index 0aea82dc..4d58f835 100644 --- a/applications/jpip/opj_client/opj_dec_server/cache_manager.c +++ b/applications/jpip/opj_client/opj_dec_server/cache_manager.c @@ -1,5 +1,5 @@ /* - * $Id: cache_manager.c 44 2011-02-15 12:32:29Z kaori $ + * $Id: cache_manager.c 53 2011-05-09 16:55:39Z kaori $ * * Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium * Copyright (c) 2002-2011, Professor Benoit Macq @@ -85,11 +85,13 @@ cache_param_t * gene_cache( char *targetname, int csn, char *cid) void delete_cache( cache_param_t **cache) { + int i; + delete_metadatalist( &(*cache)->metadatalist); if((*cache)->ihdrbox) free((*cache)->ihdrbox); - for( int i=0; i<(*cache)->numOfcid; i++) + for( i=0; i<(*cache)->numOfcid; i++) free( (*cache)->cid[i]); free( (*cache)->cid); free( *cache); @@ -138,11 +140,12 @@ cache_param_t * search_cacheBycsn( int csn, cachelist_param_t *cachelist) cache_param_t * search_cacheBycid( char cid[], cachelist_param_t *cachelist) { cache_param_t *foundcache; + int i; foundcache = cachelist->first; while( foundcache != NULL){ - for( int i=0; inumOfcid; i++) + for( i=0; inumOfcid; i++) if( strcmp( cid, foundcache->cid[i]) == 0) return foundcache; foundcache = foundcache->next; @@ -153,12 +156,13 @@ cache_param_t * search_cacheBycid( char cid[], cachelist_param_t *cachelist) void add_cachecid( char *cid, cache_param_t *cache) { char **tmp; + int i; tmp = cache->cid; cache->cid = (char **)malloc( (cache->numOfcid+1)*sizeof(char *)); - for( int i=0; inumOfcid; i++){ + for( i=0; inumOfcid; i++){ cache->cid[i] = (char *)malloc( MAX_LENOFCID); strcpy( cache->cid[i], tmp[i]); free( tmp[i]); @@ -185,8 +189,9 @@ void remove_cidInCache( char *cid, cache_param_t *cache) { int idx = -1; char **tmp; + int i, j; - for( int i=0; inumOfcid; i++) + for( i=0; inumOfcid; i++) if( strcmp( cid, cache->cid[i]) == 0){ idx = i; break; @@ -201,7 +206,7 @@ void remove_cidInCache( char *cid, cache_param_t *cache) cache->cid = (char **)malloc( (cache->numOfcid-1)*sizeof(char *)); - for( int i=0, j=0; inumOfcid; i++){ + for( i=0, j=0; inumOfcid; i++){ if( i != idx){ cache->cid[j] = (char *)malloc( MAX_LENOFCID); strcpy( cache->cid[j], tmp[i]); @@ -216,11 +221,14 @@ void remove_cidInCache( char *cid, cache_param_t *cache) void print_cache( cache_param_t *cache) { + int i; + fprintf( stdout,"cache\n"); fprintf( stdout,"\t filename: %s\n", cache->filename); fprintf( stdout,"\t csn: %d\n", cache->csn); fprintf( stdout,"\t cid:"); - for( int i=0; inumOfcid; i++) + + for( i=0; inumOfcid; i++) fprintf( stdout," %s", cache->cid[i]); fprintf( stdout,"\n"); } diff --git a/applications/jpip/opj_client/opj_dec_server/imgsock_manager.c b/applications/jpip/opj_client/opj_dec_server/imgsock_manager.c index 6122457c..e92b8745 100644 --- a/applications/jpip/opj_client/opj_dec_server/imgsock_manager.c +++ b/applications/jpip/opj_client/opj_dec_server/imgsock_manager.c @@ -1,5 +1,5 @@ /* - * $Id: imgsock_manager.c 44 2011-02-15 12:32:29Z kaori $ + * $Id: imgsock_manager.c 53 2011-05-09 16:55:39Z kaori $ * * Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium * Copyright (c) 2002-2011, Professor Benoit Macq @@ -28,9 +28,15 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#ifdef _WIN32 +#include +#define strcasecmp _stricmp +#else +#include +#endif + #include #include -#include #include #include #include @@ -86,6 +92,7 @@ msgtype_t identify_clientmsg( int connected_socket) int read_size; char buf[BUF_LEN]; char *magicid[] = { "JPT-stream", "PNM request", "XML request", "CID request", "CID destroy", "JP2 save", "QUIT"}; + int i; read_size = read_line( connected_socket, buf); @@ -94,7 +101,7 @@ msgtype_t identify_clientmsg( int connected_socket) return ERROR; } - for( int i=0; i 0){ diff --git a/applications/jpip/opj_client/opj_dec_server/imgsock_manager.h b/applications/jpip/opj_client/opj_dec_server/imgsock_manager.h index 226ab630..a4cb0d1f 100644 --- a/applications/jpip/opj_client/opj_dec_server/imgsock_manager.h +++ b/applications/jpip/opj_client/opj_dec_server/imgsock_manager.h @@ -1,5 +1,5 @@ /* - * $Id: imgsock_manager.h 44 2011-02-15 12:32:29Z kaori $ + * $Id: imgsock_manager.h 53 2011-05-09 16:55:39Z kaori $ * * Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium * Copyright (c) 2002-2011, Professor Benoit Macq @@ -31,7 +31,7 @@ #ifndef IMGSOCK_MANAGER_H_ # define IMGSOCK_MANAGER_H_ -#include +#include "bool.h" #include "byte_manager.h" /** diff --git a/applications/jpip/opj_client/opj_dec_server/jp2k_decoder.c b/applications/jpip/opj_client/opj_dec_server/jp2k_decoder.c index bab40c8d..41d1a31f 100644 --- a/applications/jpip/opj_client/opj_dec_server/jp2k_decoder.c +++ b/applications/jpip/opj_client/opj_dec_server/jp2k_decoder.c @@ -1,5 +1,5 @@ /* - * $Id: jp2k_decoder.c 44 2011-02-15 12:32:29Z kaori $ + * $Id: jp2k_decoder.c 53 2011-05-09 16:55:39Z kaori $ * * Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium * Copyright (c) 2002-2011, Professor Benoit Macq @@ -129,6 +129,7 @@ Byte_t * imagetopnm(opj_image_t *image, ihdrbox_param_t **ihdrbox) int adjustR, adjustG=0, adjustB=0; int datasize; Byte_t *pix=NULL, *ptr=NULL; + int i; if(*ihdrbox){ if( (*ihdrbox)->nc != image->numcomps) @@ -179,7 +180,7 @@ Byte_t * imagetopnm(opj_image_t *image, ihdrbox_param_t **ihdrbox) pix = (Byte_t *)malloc( datasize); ptr = pix; - for( int i = 0; i < image->comps[0].w * image->comps[0].h; i++){ + for( i = 0; i < image->comps[0].w * image->comps[0].h; i++){ int r, g, b; r = image->comps[0].data[i]; r += (image->comps[0].sgnd ? 1 << (image->comps[0].prec - 1) : 0); diff --git a/applications/jpip/opj_server/Makefile b/applications/jpip/opj_server/Makefile index aadf7dcf..f4aa97b1 100644 --- a/applications/jpip/opj_server/Makefile +++ b/applications/jpip/opj_server/Makefile @@ -1,6 +1,6 @@ LIBDIR = ../libopenjpip LIBFNAME = $(LIBDIR)/libopenjpip_server.a -CFLAGS = -O3 -Wall -std=c99 -pedantic -m32 -DSERVER -I$(LIBDIR) +CFLAGS = -O3 -Wall -m32 -DSERVER -I$(LIBDIR) LDFLAGS = -L$(LIBDIR) -lm -lfcgi -lopenjpip_server ALL = opj_server diff --git a/applications/jpip/opj_server/opj_server.c b/applications/jpip/opj_server/opj_server.c index 6f11d697..aba98ad7 100644 --- a/applications/jpip/opj_server/opj_server.c +++ b/applications/jpip/opj_server/opj_server.c @@ -1,5 +1,5 @@ /* - * $Id: opj_server.c 46 2011-02-17 14:50:55Z kaori $ + * $Id: opj_server.c 53 2011-05-09 16:55:39Z kaori $ * * Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium * Copyright (c) 2002-2011, Professor Benoit Macq @@ -373,6 +373,7 @@ void enqueue_tiles( query_param_t query_param, index_param_t *codeidx, msgqueue_ { imgreg_param_t imgreg; range_param_t tile_Xrange, tile_Yrange; + int u, v, tile_id; imgreg = map_viewin2imgreg( query_param.fx, query_param.fy, query_param.rx, query_param.ry, query_param.rw, query_param.rh, @@ -380,10 +381,10 @@ void enqueue_tiles( query_param_t query_param, index_param_t *codeidx, msgqueue_ get_nmax( codeidx->tilepart)); - for( int u=0, tile_id=0; uYTnum; u++){ + for( u=0, tile_id=0; uYTnum; u++){ tile_Yrange = get_tile_Yrange( *codeidx, u, imgreg.level); - for( int v=0; vXTnum; v++, tile_id++){ + for( v=0; vXTnum; v++, tile_id++){ tile_Xrange = get_tile_Xrange( *codeidx, v, imgreg.level); if( tile_Xrange.minvalue < tile_Xrange.maxvalue && tile_Yrange.minvalue < tile_Yrange.maxvalue){ @@ -416,7 +417,8 @@ void enqueue_tiles( query_param_t query_param, index_param_t *codeidx, msgqueue_ void enqueue_metabins( query_param_t query_param, metadatalist_param_t *metadatalist, msgqueue_param_t *msgqueue) { - for( int i=0; query_param.box_type[i][0]!=0 && i -#endif -#include -#include -#include "query_parser.h" + #ifdef _WIN32 #include #define strcasecmp _stricmp +#else +#include #endif +#include +#include +#include "query_parser.h" + #ifdef SERVER #include "fcgi_stdio.h" #define logstream FCGI_stdout @@ -205,6 +206,7 @@ void print_queryparam( query_param_t query_param) void str2cclose( char *src, char cclose[][MAX_LENOFCID]) { int i, u, v; + size_t len = strlen( src); for( i=0, u=0, v=0; i -#endif +#include "bool.h" //! maximum length of target name #define MAX_LENOFTARGET 128 diff --git a/applications/jpip/opj_server/session_manager.h b/applications/jpip/opj_server/session_manager.h index 8f1bcc80..fba62ab1 100644 --- a/applications/jpip/opj_server/session_manager.h +++ b/applications/jpip/opj_server/session_manager.h @@ -1,5 +1,5 @@ /* - * $Id: session_manager.h 44 2011-02-15 12:32:29Z kaori $ + * $Id: session_manager.h 53 2011-05-09 16:55:39Z kaori $ * * Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium * Copyright (c) 2002-2011, Professor Benoit Macq @@ -31,7 +31,7 @@ #ifndef SESSION_MANAGER_H_ # define SESSION_MANAGER_H_ -#include +#include "bool.h" #include "channel_manager.h" #include "target_manager.h" diff --git a/applications/jpip/tools/Makefile b/applications/jpip/tools/Makefile index e0b95a4e..50b83881 100644 --- a/applications/jpip/tools/Makefile +++ b/applications/jpip/tools/Makefile @@ -1,6 +1,6 @@ LIBDIR = ../libopenjpip LIBFNAME = $(LIBDIR)/libopenjpip_local.a -CFLAGS = -O3 -Wall -std=c99 -pedantic -I$(LIBDIR) +CFLAGS = -O3 -Wall -I$(LIBDIR) LDFLAGS = -L$(LIBDIR) -lm -lopenjpip_local ALL = jpt_to_jp2 jpt_to_j2k test_index addXMLinJP2