From: Andre Noll Date: Sun, 7 Feb 2016 22:22:52 +0000 (+0100) Subject: afh: Make ->suffixes array const. X-Git-Tag: v0.5.6~34 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=b74bb1b8dbd1fbe2bbd918ae7a77ebafba674e7c;ds=sidebyside afh: Make ->suffixes array const. Not only the individual strings are constant, but also the array itself. --- diff --git a/aac_afh.c b/aac_afh.c index d3e69454..c49f30de 100644 --- a/aac_afh.c +++ b/aac_afh.c @@ -317,7 +317,7 @@ close: return ret; } -static const char* aac_suffixes[] = {"m4a", "mp4", NULL}; +static const char * const aac_suffixes[] = {"m4a", "mp4", NULL}; /** * the init function of the aac audio format handler * diff --git a/afh.h b/afh.h index 7a30947a..dad67351 100644 --- a/afh.h +++ b/afh.h @@ -88,7 +88,7 @@ struct audio_format_handler { */ void (*init)(struct audio_format_handler*); /** Typical file endings for files that can be handled by this afh. */ - const char **suffixes; + const char * const *suffixes; /** * Check if this audio format handler can handle the file. * diff --git a/flac_afh.c b/flac_afh.c index 51c3c314..2e2842b1 100644 --- a/flac_afh.c +++ b/flac_afh.c @@ -515,7 +515,7 @@ free_pfad: return ret; } -static const char* flac_suffixes[] = {"flac", NULL}; +static const char * const flac_suffixes[] = {"flac", NULL}; /** * The init function of the flac audio format handler. diff --git a/mp3_afh.c b/mp3_afh.c index 73e744ec..74d65fff 100644 --- a/mp3_afh.c +++ b/mp3_afh.c @@ -684,7 +684,7 @@ static int mp3_get_file_info(char *map, size_t numbytes, int fd, return 1; } -static const char* mp3_suffixes[] = {"mp3", NULL}; +static const char * const mp3_suffixes[] = {"mp3", NULL}; /** * the init function of the mp3 audio format handler diff --git a/ogg_afh.c b/ogg_afh.c index 32f8bc1b..29f08965 100644 --- a/ogg_afh.c +++ b/ogg_afh.c @@ -171,8 +171,6 @@ fail: PARA_ERROR_LOG("%s\n", para_strerror(-ret)); } -static const char* ogg_suffixes[] = {"ogg", NULL}; - static int vorbis_make_meta_packet(struct taginfo *tags, ogg_packet *result) { vorbis_comment vc; @@ -206,6 +204,9 @@ static int vorbis_rewrite_tags(const char *map, size_t mapsize, free(packet.packet); return ret; } + +static const char * const ogg_suffixes[] = {"ogg", NULL}; + /** * The init function of the ogg vorbis audio format handler. * diff --git a/opus_afh.c b/opus_afh.c index e7511d36..b1469b47 100644 --- a/opus_afh.c +++ b/opus_afh.c @@ -17,7 +17,7 @@ #include "opus_common.h" #include "ogg_afh_common.h" -static const char* opus_suffixes[] = {"opus", NULL}; +static const char * const opus_suffixes[] = {"opus", NULL}; #define OPUS_COMMENT_HEADER "OpusTags" diff --git a/spx_afh.c b/spx_afh.c index 108cfaa4..b780635b 100644 --- a/spx_afh.c +++ b/spx_afh.c @@ -118,8 +118,6 @@ static int spx_get_comments(unsigned char *comments, int length, return 1; } -static const char* speex_suffixes[] = {"spx", "speex", NULL}; - static int spx_packet_callback(ogg_packet *packet, int packet_num, __a_unused int serial, struct afh_info *afhi, void *private_data) @@ -251,6 +249,8 @@ static int spx_rewrite_tags(const char *map, size_t mapsize, return ret; } +static const char * const speex_suffixes[] = {"spx", "speex", NULL}; + /** * The init function of the ogg/speex audio format handler. * diff --git a/wma_afh.c b/wma_afh.c index 0b6081cf..929e732b 100644 --- a/wma_afh.c +++ b/wma_afh.c @@ -642,7 +642,7 @@ out: return ret; } -static const char* wma_suffixes[] = {"wma", NULL}; +static const char * const wma_suffixes[] = {"wma", NULL}; /** * The init function of the wma audio format handler.