Use const qualifier for j2k_prog_order_list

This allows more compiler optimizations.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2017-08-13 22:57:31 +02:00
parent 0b4c3ce75d
commit 10e6ce2c2c
2 changed files with 4 additions and 4 deletions

View File

@ -1305,7 +1305,7 @@ typedef struct j2k_prog_order {
char str_prog[5];
} j2k_prog_order_t;
static j2k_prog_order_t j2k_prog_order_list[] = {
static const j2k_prog_order_t j2k_prog_order_list[] = {
{OPJ_CPRL, "CPRL"},
{OPJ_LRCP, "LRCP"},
{OPJ_PCRL, "PCRL"},
@ -1602,9 +1602,9 @@ static void opj_j2k_write_float_to_float64(const void * p_src_data,
}
}
char *opj_j2k_convert_progression_order(OPJ_PROG_ORDER prg_order)
const char *opj_j2k_convert_progression_order(OPJ_PROG_ORDER prg_order)
{
j2k_prog_order_t *po;
const j2k_prog_order_t *po;
for (po = j2k_prog_order_list; po->enum_prog != -1; po++) {
if (po->enum_prog == prg_order) {
return po->str_prog;

View File

@ -617,7 +617,7 @@ OPJ_BOOL opj_j2k_setup_encoder(opj_j2k_t *p_j2k,
/**
Converts an enum type progression order to string type
*/
char *opj_j2k_convert_progression_order(OPJ_PROG_ORDER prg_order);
const char *opj_j2k_convert_progression_order(OPJ_PROG_ORDER prg_order);
/* ----------------------------------------------------------------------- */
/*@}*/