From 10e6ce2c2cfacf51fdde7e9c69bf2365840f4bb0 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sun, 13 Aug 2017 22:57:31 +0200 Subject: [PATCH] Use const qualifier for j2k_prog_order_list This allows more compiler optimizations. Signed-off-by: Stefan Weil --- src/lib/openjp2/j2k.c | 6 +++--- src/lib/openjp2/j2k.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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); /* ----------------------------------------------------------------------- */ /*@}*/