[trunk] Another round of fixes for sign conversion warnings.
authorMathieu Malaterre <mathieu.malaterre@gmail.com>
Fri, 7 Mar 2014 13:31:25 +0000 (13:31 +0000)
committerMathieu Malaterre <mathieu.malaterre@gmail.com>
Fri, 7 Mar 2014 13:31:25 +0000 (13:31 +0000)
Update issue 256

src/lib/openjp2/tpix_manager.c

index 429f5089f89bdda05a656698bd13c03cc7b9712e..5e440e1eb848bb5d871d5d023c096adb25f4c134 100644 (file)
@@ -80,7 +80,7 @@ int opj_write_tpix( int coff,
   opj_stream_write_data(cio,l_data_header,4,p_manager);
   opj_stream_seek(cio, lenp+len,p_manager);
 
-  return len;
+  return (int)len;
 }
 
 int opj_write_tpixfaix( int coff,
@@ -92,15 +92,15 @@ int opj_write_tpixfaix( int coff,
 {
   OPJ_UINT32 len;
   OPJ_OFF_T lenp;
-  int i, j;
-  int Aux;
-  int num_max_tile_parts;
-  int size_of_coding; /* 4 or 8 */
+  OPJ_UINT32 i, j;
+  OPJ_UINT32 Aux;
+  OPJ_UINT32 num_max_tile_parts;
+  OPJ_UINT32 size_of_coding; /* 4 or 8 */
   opj_tp_info_t tp;
   OPJ_BYTE l_data_header [8];
-  int version;
+  OPJ_UINT32 version;
 
-  num_max_tile_parts = get_num_max_tile_parts( cstr_info);
+  num_max_tile_parts = (OPJ_UINT32)get_num_max_tile_parts( cstr_info);
 
   if( j2klen > pow( 2, 32)){
     size_of_coding =  8;
@@ -120,24 +120,24 @@ int opj_write_tpixfaix( int coff,
 
   opj_write_bytes(l_data_header,num_max_tile_parts,size_of_coding);         /* NMAX           */
   opj_stream_write_data(cio,l_data_header,size_of_coding,p_manager);
-  opj_write_bytes(l_data_header,cstr_info.tw*cstr_info.th,size_of_coding);  /* M              */
+  opj_write_bytes(l_data_header,(OPJ_UINT32)(cstr_info.tw*cstr_info.th),size_of_coding);  /* M              */
   opj_stream_write_data(cio,l_data_header,size_of_coding,p_manager);
 
-  for (i = 0; i < cstr_info.tw*cstr_info.th; i++)
+  for (i = 0; i < (OPJ_UINT32)(cstr_info.tw*cstr_info.th); i++)
     {
-    for (j = 0; j < cstr_info.tile[i].num_tps; j++)
+    for (j = 0; j < (OPJ_UINT32)cstr_info.tile[i].num_tps; j++)
       {
       tp = cstr_info.tile[i].tp[j];
 
-      opj_write_bytes(l_data_header,tp.tp_start_pos-coff,size_of_coding);            /* start position */
+      opj_write_bytes(l_data_header,(OPJ_UINT32)(tp.tp_start_pos-coff),size_of_coding);            /* start position */
       opj_stream_write_data(cio,l_data_header,size_of_coding,p_manager);
-      opj_write_bytes(l_data_header,tp.tp_end_pos-tp.tp_start_pos+1,size_of_coding); /* length         */
+      opj_write_bytes(l_data_header,(OPJ_UINT32)(tp.tp_end_pos-tp.tp_start_pos+1),size_of_coding); /* length         */
       opj_stream_write_data(cio,l_data_header,size_of_coding,p_manager);
 
       if (version & 0x02)
         {
         if( cstr_info.tile[i].num_tps == 1 && cstr_info.numdecompos[compno] > 1)
-          Aux = cstr_info.numdecompos[compno] + 1;
+          Aux = (OPJ_UINT32)(cstr_info.numdecompos[compno] + 1);
         else
           Aux = j + 1;
 
@@ -171,7 +171,7 @@ int opj_write_tpixfaix( int coff,
   opj_stream_write_data(cio,l_data_header,4,p_manager);
   opj_stream_seek(cio, lenp+len,p_manager);
 
-  return len;
+  return (int)len;
 }
 
 int get_num_max_tile_parts( opj_codestream_info_t cstr_info)