summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Malaterre <mathieu.malaterre@gmail.com>2012-03-26 15:04:49 +0000
committerMathieu Malaterre <mathieu.malaterre@gmail.com>2012-03-26 15:04:49 +0000
commit569bc02649de78c686cbc1677f503bf59b5410c4 (patch)
treea8f0215d0e1f0971161adb056ba1717fda5de50d
parent178309be477d6f453f3d771ec0893b08735e932b (diff)
[trunk] another set of warnings fixes for LFS support
-rw-r--r--applications/jpip/libopenjpip/dec_clientmsg_handler.c9
-rw-r--r--applications/jpip/libopenjpip/dec_clientmsg_handler.h2
-rw-r--r--applications/jpip/libopenjpip/imgsock_manager.c4
-rw-r--r--applications/jpip/libopenjpip/imgsock_manager.h4
-rw-r--r--applications/jpip/libopenjpip/jpipstream_manager.c4
-rw-r--r--applications/jpip/libopenjpip/jpipstream_manager.h4
-rw-r--r--applications/jpip/libopenjpip/metadata_manager.c2
-rw-r--r--applications/jpip/libopenjpip/mhixbox_manager.c6
-rw-r--r--applications/jpip/libopenjpip/openjpip.c6
-rw-r--r--applications/jpip/libopenjpip/openjpip.h2
-rw-r--r--applications/jpip/libopenjpip/sock_manager.c2
-rw-r--r--applications/jpip/libopenjpip/sock_manager.h2
12 files changed, 24 insertions, 23 deletions
diff --git a/applications/jpip/libopenjpip/dec_clientmsg_handler.c b/applications/jpip/libopenjpip/dec_clientmsg_handler.c
index 8fdf3109..9b4944f9 100644
--- a/applications/jpip/libopenjpip/dec_clientmsg_handler.c
+++ b/applications/jpip/libopenjpip/dec_clientmsg_handler.c
@@ -35,19 +35,20 @@
#include "ihdrbox_manager.h"
#include "jpipstream_manager.h"
#include "jp2k_encoder.h"
+#include "opj_inttypes.h"
void handle_JPIPstreamMSG( SOCKET connected_socket, cachelist_param_t *cachelist,
- Byte_t **jpipstream, int *streamlen, msgqueue_param_t *msgqueue)
+ Byte_t **jpipstream, OPJ_SIZE_T *streamlen, msgqueue_param_t *msgqueue)
{
Byte_t *newjpipstream;
- int newstreamlen = 0;
+ OPJ_SIZE_T newstreamlen = 0;
cache_param_t *cache;
char *target, *tid, *cid;
metadatalist_param_t *metadatalist;
newjpipstream = receive_JPIPstream( connected_socket, &target, &tid, &cid, &newstreamlen);
- fprintf( stderr, "newjpipstream length: %d\n", newstreamlen);
+ fprintf( stderr, "newjpipstream length: %" PRIu64 "\n", newstreamlen);
parse_JPIPstream( newjpipstream, newstreamlen, *streamlen, msgqueue);
@@ -144,7 +145,7 @@ void handle_TIDreqMSG( SOCKET connected_socket, cachelist_param_t *cachelist)
{
char *target, *tid = NULL;
cache_param_t *cache;
- int tidlen = 0;
+ OPJ_SIZE_T tidlen = 0;
target = receive_string( connected_socket);
cache = search_cache( target, cachelist);
diff --git a/applications/jpip/libopenjpip/dec_clientmsg_handler.h b/applications/jpip/libopenjpip/dec_clientmsg_handler.h
index 58424bfd..7929207a 100644
--- a/applications/jpip/libopenjpip/dec_clientmsg_handler.h
+++ b/applications/jpip/libopenjpip/dec_clientmsg_handler.h
@@ -46,7 +46,7 @@
* @param[in,out] streamlen address of stream length
* @param[in,out] msgqueue message queue pointer
*/
-void handle_JPIPstreamMSG( SOCKET connected_socket, cachelist_param_t *cachelist, Byte_t **jpipstream, int *streamlen, msgqueue_param_t *msgqueue);
+void handle_JPIPstreamMSG( SOCKET connected_socket, cachelist_param_t *cachelist, Byte_t **jpipstream, OPJ_SIZE_T *streamlen, msgqueue_param_t *msgqueue);
/**
* handle PNM request message
diff --git a/applications/jpip/libopenjpip/imgsock_manager.c b/applications/jpip/libopenjpip/imgsock_manager.c
index 56bbea09..7c8dcd6d 100644
--- a/applications/jpip/libopenjpip/imgsock_manager.c
+++ b/applications/jpip/libopenjpip/imgsock_manager.c
@@ -63,7 +63,7 @@ msgtype_t identify_clientmsg( SOCKET connected_socket)
return MSGERROR;
}
-Byte_t * receive_JPIPstream( SOCKET connected_socket, char **target, char **tid, char **cid, int *streamlen)
+Byte_t * receive_JPIPstream( SOCKET connected_socket, char **target, char **tid, char **cid, OPJ_SIZE_T *streamlen)
{
char buf[BUF_LEN], versionstring[] = "version 1.2";
int linelen, datalen;
@@ -134,7 +134,7 @@ void send_CIDstream( SOCKET connected_socket, char *cid, int cidlen)
send_IDstream( connected_socket, cid, cidlen, "CID");
}
-void send_TIDstream( SOCKET connected_socket, char *tid, int tidlen)
+void send_TIDstream( SOCKET connected_socket, char *tid, OPJ_SIZE_T tidlen)
{
send_IDstream( connected_socket, tid, tidlen, "TID");
}
diff --git a/applications/jpip/libopenjpip/imgsock_manager.h b/applications/jpip/libopenjpip/imgsock_manager.h
index 7011c6be..44b9b958 100644
--- a/applications/jpip/libopenjpip/imgsock_manager.h
+++ b/applications/jpip/libopenjpip/imgsock_manager.h
@@ -56,7 +56,7 @@ msgtype_t identify_clientmsg( SOCKET connected_socket);
* @param [out] streamlen length of the received codestream
* @return JPT- JPP- codestream
*/
-Byte_t * receive_JPIPstream( SOCKET connected_socket, char **target, char **tid, char **cid, int *streamlen);
+Byte_t * receive_JPIPstream( SOCKET connected_socket, char **target, char **tid, char **cid, OPJ_SIZE_T *streamlen);
/**
* send PGM/PPM image stream to the client
@@ -86,7 +86,7 @@ void send_XMLstream( SOCKET connected_socket, Byte_t *xmlstream, int length);
* @param [in] tid tid string
* @param [in] tidlen legnth of the tid string
*/
-void send_TIDstream( SOCKET connected_socket, char *tid, int tidlen);
+void send_TIDstream( SOCKET connected_socket, char *tid, OPJ_SIZE_T tidlen);
/**
* send CID data stream to the client
diff --git a/applications/jpip/libopenjpip/jpipstream_manager.c b/applications/jpip/libopenjpip/jpipstream_manager.c
index 10697cf6..c557a3a0 100644
--- a/applications/jpip/libopenjpip/jpipstream_manager.c
+++ b/applications/jpip/libopenjpip/jpipstream_manager.c
@@ -38,7 +38,7 @@
#include "ihdrbox_manager.h"
#include "j2kheader_manager.h"
-Byte_t * update_JPIPstream( Byte_t *newstream, int newstreamlen, Byte_t *cache_stream, int *streamlen)
+Byte_t * update_JPIPstream( Byte_t *newstream, OPJ_SIZE_T newstreamlen, Byte_t *cache_stream, OPJ_SIZE_T *streamlen)
{
Byte_t *stream = (Byte_t *)malloc( (*streamlen)+newstreamlen);
if( *streamlen > 0)
@@ -52,7 +52,7 @@ Byte_t * update_JPIPstream( Byte_t *newstream, int newstreamlen, Byte_t *cache_s
return stream;
}
-void save_codestream( Byte_t *codestream, Byte8_t streamlen, const char *fmt)
+void save_codestream( Byte_t *codestream, OPJ_SIZE_T streamlen, const char *fmt)
{
time_t timer;
struct tm *t_st;
diff --git a/applications/jpip/libopenjpip/jpipstream_manager.h b/applications/jpip/libopenjpip/jpipstream_manager.h
index 89585a24..5328be62 100644
--- a/applications/jpip/libopenjpip/jpipstream_manager.h
+++ b/applications/jpip/libopenjpip/jpipstream_manager.h
@@ -32,9 +32,9 @@
#include "msgqueue_manager.h"
#include "ihdrbox_manager.h"
-Byte_t * update_JPIPstream( Byte_t *newstream, int newstreamlen, Byte_t *cache_stream, int *streamlen);
+Byte_t * update_JPIPstream( Byte_t *newstream, OPJ_SIZE_T newstreamlen, Byte_t *cache_stream, OPJ_SIZE_T *streamlen);
-void save_codestream( Byte_t *codestream, Byte8_t streamlen, const char *fmt);
+void save_codestream( Byte_t *codestream, OPJ_SIZE_T streamlen, const char *fmt);
Byte_t * jpipstream_to_pnm( Byte_t *jpipstream, msgqueue_param_t *msgqueue, Byte8_t csn, int fw, int fh, ihdrbox_param_t **ihdrbox);
diff --git a/applications/jpip/libopenjpip/metadata_manager.c b/applications/jpip/libopenjpip/metadata_manager.c
index 8e8e1e72..12b61efc 100644
--- a/applications/jpip/libopenjpip/metadata_manager.c
+++ b/applications/jpip/libopenjpip/metadata_manager.c
@@ -160,7 +160,7 @@ void insert_metadata_into_list( metadata_param_t *metabin, metadatalist_param_t
void print_metadata( metadata_param_t *metadata)
{
boxcontents_param_t *boxcont;
- fprintf( logstream, "metadata-bin %d info:\n", metadata->idx);
+ fprintf( logstream, "metadata-bin %" PRIu64 " info:\n", metadata->idx);
print_allbox( metadata->boxlist);
print_allplaceholder( metadata->placeholderlist);
diff --git a/applications/jpip/libopenjpip/mhixbox_manager.c b/applications/jpip/libopenjpip/mhixbox_manager.c
index 13030446..b311126b 100644
--- a/applications/jpip/libopenjpip/mhixbox_manager.c
+++ b/applications/jpip/libopenjpip/mhixbox_manager.c
@@ -48,19 +48,19 @@ mhixbox_param_t * gene_mhixbox( box_param_t *box)
{
mhixbox_param_t *mhix;
markeridx_param_t *mkridx, *lastmkidx;
- Byte8_t pos = 0;
+ 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( pos < get_DBoxlen( box)){
+ 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 = fetch_DBox8bytebigendian( box, (pos+=8)-8);
+ mkridx->offset = (OPJ_OFF_T)fetch_DBox8bytebigendian( box, (pos+=8)-8);
mkridx->length = fetch_DBox2bytebigendian( box, (pos+=2)-2);
mkridx->next = NULL;
diff --git a/applications/jpip/libopenjpip/openjpip.c b/applications/jpip/libopenjpip/openjpip.c
index b9e2fe67..ab1ad25a 100644
--- a/applications/jpip/libopenjpip/openjpip.c
+++ b/applications/jpip/libopenjpip/openjpip.c
@@ -142,7 +142,7 @@ void send_responsedata( server_record_t *rec, QR_t *qr)
add_EORmsg( fd, qr); /* needed at least for tcp and udp */
- len_of_jpipstream = get_filesize( fd);
+ len_of_jpipstream = (Byte8_t)get_filesize( fd);
jpipstream = fetch_bytes( fd, 0, len_of_jpipstream);
close( fd);
@@ -217,7 +217,7 @@ dec_server_record_t * init_dec_server( int port)
record->jpipstream = NULL;
record->jpipstreamlen = 0;
record->msgqueue = gene_msgqueue( true, NULL);
- record->listening_socket = open_listeningsocket( port);
+ record->listening_socket = open_listeningsocket( (uint16_t)port);
return record;
}
@@ -330,7 +330,7 @@ bool fread_jpip( char fname[], jpip_dec_param_t *dec)
return false;
}
- if(!(dec->jpiplen = get_filesize(infd)))
+ if(!(dec->jpiplen = (Byte8_t)get_filesize(infd)))
return false;
dec->jpipstream = (Byte_t *)malloc( dec->jpiplen);
diff --git a/applications/jpip/libopenjpip/openjpip.h b/applications/jpip/libopenjpip/openjpip.h
index 1cf48e7e..fa37929c 100644
--- a/applications/jpip/libopenjpip/openjpip.h
+++ b/applications/jpip/libopenjpip/openjpip.h
@@ -157,7 +157,7 @@ void local_log( bool query, bool messages, bool sessions, bool targets, QR_t *qr
typedef struct dec_server_record{
cachelist_param_t *cachelist; /**< cache list*/
Byte_t *jpipstream; /**< JPT/JPP stream*/
- int jpipstreamlen; /**< length of jpipstream*/
+ OPJ_SIZE_T jpipstreamlen; /**< length of jpipstream*/
msgqueue_param_t *msgqueue; /**< parsed message queue of jpipstream*/
SOCKET listening_socket; /**< listenning socket*/
} dec_server_record_t;
diff --git a/applications/jpip/libopenjpip/sock_manager.c b/applications/jpip/libopenjpip/sock_manager.c
index 9f3bd903..1460d3ba 100644
--- a/applications/jpip/libopenjpip/sock_manager.c
+++ b/applications/jpip/libopenjpip/sock_manager.c
@@ -97,7 +97,7 @@ SOCKET accept_socket( SOCKET listening_socket)
return accept( listening_socket, (struct sockaddr *)&peer_sin, &addrlen);
}
-void send_stream( SOCKET connected_socket, void *stream, OPJ_SIZE_T length)
+void send_stream( SOCKET connected_socket, const void *stream, OPJ_SIZE_T length)
{
char *ptr = (char*)stream;
OPJ_SIZE_T remlen = length;
diff --git a/applications/jpip/libopenjpip/sock_manager.h b/applications/jpip/libopenjpip/sock_manager.h
index 09b20dc6..5caeaba2 100644
--- a/applications/jpip/libopenjpip/sock_manager.h
+++ b/applications/jpip/libopenjpip/sock_manager.h
@@ -93,7 +93,7 @@ void * receive_stream( SOCKET connected_socket, OPJ_SIZE_T length);
* @param [in] stream data stream
* @param [in] length length of data stream
*/
-void send_stream( SOCKET connected_socket, void *stream, OPJ_SIZE_T length);
+void send_stream( SOCKET connected_socket, const void *stream, OPJ_SIZE_T length);
/**
* close socket