From: Stefan Weil Date: Sun, 13 Aug 2017 20:57:31 +0000 (+0200) Subject: Use const qualifier for j2k_prog_order_list X-Git-Tag: v2.3.0~81^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=10e6ce2c2cfacf51fdde7e9c69bf2365840f4bb0;p=openjpeg Use const qualifier for j2k_prog_order_list This allows more compiler optimizations. Signed-off-by: Stefan Weil --- diff --git a/src/lib/openjp2/j2k.c b/src/lib/openjp2/j2k.c index 2d955f9a..a2521ebb 100644 --- a/src/lib/openjp2/j2k.c +++ b/src/lib/openjp2/j2k.c @@ -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; diff --git a/src/lib/openjp2/j2k.h b/src/lib/openjp2/j2k.h index d61c96db..c9308f7d 100644 --- a/src/lib/openjp2/j2k.h +++ b/src/lib/openjp2/j2k.h @@ -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); /* ----------------------------------------------------------------------- */ /*@}*/