diff --git a/CHANGES b/CHANGES index 130090a3..215502da 100644 --- a/CHANGES +++ b/CHANGES @@ -5,6 +5,9 @@ What's New for OpenJPEG ! : changed + : added +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()). 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 a35002df..6122457c 100644 --- a/applications/jpip/opj_client/opj_dec_server/imgsock_manager.c +++ b/applications/jpip/opj_client/opj_dec_server/imgsock_manager.c @@ -207,7 +207,7 @@ void send_PNMstream( int connected_socket, Byte_t *pnmstream, unsigned int width void send_stream( int connected_socket, void *stream, int length) { - void *ptr = stream; + Byte_t *ptr = (Byte_t*)stream; int remlen = length; while( remlen > 0){ diff --git a/applications/jpip/opj_client/opj_dec_server/opj_dec_server.c b/applications/jpip/opj_client/opj_dec_server/opj_dec_server.c index a8f09724..b00e8ccc 100644 --- a/applications/jpip/opj_client/opj_dec_server/opj_dec_server.c +++ b/applications/jpip/opj_client/opj_dec_server/opj_dec_server.c @@ -130,7 +130,7 @@ int main(int argc, char *argv[]){ bool quit = false; int listening_socket = open_listeningsocket(); - int addrlen = sizeof(peer_sin); + socklen_t addrlen = sizeof(peer_sin); cachelist_param_t *cachelist = gene_cachelist(); diff --git a/applications/jpip/opj_server/query_parser.h b/applications/jpip/opj_server/query_parser.h index 705b6c49..008e56a2 100644 --- a/applications/jpip/opj_server/query_parser.h +++ b/applications/jpip/opj_server/query_parser.h @@ -31,7 +31,13 @@ #ifndef QUERY_PARSER_H_ # define QUERY_PARSER_H_ +#ifdef _WIN32 +#define bool int +#define true 1 +#define false 0 +#else #include +#endif //! maximum length of target name #define MAX_LENOFTARGET 128 diff --git a/applications/jpip/tools/indexer/index_create.c b/applications/jpip/tools/indexer/index_create.c index 991c72ba..1e90152d 100644 --- a/applications/jpip/tools/indexer/index_create.c +++ b/applications/jpip/tools/indexer/index_create.c @@ -1017,7 +1017,7 @@ void j2k_read_unk() { int j2k_index_JPIP(char *Idx_file, char *J2K_file, int len, int version){ FILE *dest; - char *index; + unsigned char *index; int pos_iptr, end_pos; int len_cidx, pos_cidx; int len_jp2c, pos_jp2c; @@ -1030,7 +1030,7 @@ int j2k_index_JPIP(char *Idx_file, char *J2K_file, int len, int version){ } /* INDEX MODE JPIP */ - index = (char*)malloc(len); + index = (unsigned char*)malloc(len); cio_init(index, len); jp2_write_jp(); jp2_write_ftyp(); @@ -1158,7 +1158,7 @@ int main(int argc, char **argv) { FILE *src; int totlen; - char *j2kfile; + unsigned char *j2kfile; j2k_image_t *imgg; j2k_cp_t *cp; int version; @@ -1180,7 +1180,7 @@ int main(int argc, char **argv) totlen = ftell(src); fseek(src, 0, SEEK_SET); - j2kfile = (char*)malloc(totlen); + j2kfile = (unsigned char*)malloc(totlen); fread(j2kfile, 1, totlen, src); fclose(src);