Fix implicit float-to-bool conversions (#752)
[openjpeg.git] / src / bin / jp2 / index.c
index c71730fe8d2dab88ff78760dd440c50d038a3393..478f556a0a8a898ebaf90995d6a58353931fd06a 100644 (file)
@@ -1,6 +1,11 @@
 /*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
+ * The copyright in this software is being made available under the 2-clauses 
+ * BSD License, included below. This software may be subject to other third 
+ * party and contributor rights, including patent rights, and no such rights
+ * are granted under this license.
+ *
+ * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
+ * Copyright (c) 2002-2014, Professor Benoit Macq
  * Copyright (c) 2003-2007, Francois-Olivier Devaux 
  * All rights reserved.
  *
@@ -64,7 +69,7 @@ int write_index_file(opj_codestream_info_t *cstr_info, char *index) {
                return 1;
        }
        
-       if (cstr_info->tile[0].distotile)
+       if (cstr_info->tile[0].distotile > 0.0)
                disto_on = 1;
        else 
                disto_on = 0;
@@ -143,7 +148,7 @@ int write_index_file(opj_codestream_info_t *cstr_info, char *index) {
                                cstr_info->tile[tileno].tp[tilepartno].tp_end_pos
                                );
 
-               if (cstr_info->prog == LRCP) {  /* LRCP */
+               if (cstr_info->prog == OPJ_LRCP) {      /* LRCP */
                        fprintf(stream, "LRCP\npack_nb tileno layno resno compno precno start_pos end_ph_pos end_pos");
                        if (disto_on)
                                fprintf(stream, " disto");
@@ -174,7 +179,7 @@ int write_index_file(opj_codestream_info_t *cstr_info, char *index) {
                        }
                } /* LRCP */
 
-               else if (cstr_info->prog == RLCP) {     /* RLCP */                      
+               else if (cstr_info->prog == OPJ_RLCP) { /* RLCP */                      
                        fprintf(stream, "RLCP\npack_nb tileno resno layno compno precno start_pos end_ph_pos end_pos\n");
                        if (disto_on)
                                fprintf(stream, " disto");
@@ -205,7 +210,7 @@ int write_index_file(opj_codestream_info_t *cstr_info, char *index) {
                        }
                } /* RLCP */
 
-               else if (cstr_info->prog == RPCL) {     /* RPCL */
+               else if (cstr_info->prog == OPJ_RPCL) { /* RPCL */
 
                        fprintf(stream, "RPCL\npack_nb tileno resno precno compno layno start_pos end_ph_pos end_pos"); 
                        if (disto_on)
@@ -254,7 +259,7 @@ int write_index_file(opj_codestream_info_t *cstr_info, char *index) {
                        } /* resno */
                } /* RPCL */
 
-               else if (cstr_info->prog == PCRL) {     /* PCRL */
+               else if (cstr_info->prog == OPJ_PCRL) { /* PCRL */
                        /* I suppose components have same XRsiz, YRsiz */
                        int x0 = cstr_info->tile_Ox + tileno - (int)floor( (float)tileno/(float)cstr_info->tw ) * cstr_info->tw * cstr_info->tile_x;
                        int y0 = cstr_info->tile_Ox + (int)floor( (float)tileno/(float)cstr_info->tw ) * cstr_info->tile_y;