]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
afh: Make ->suffixes array const.
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 7 Feb 2016 22:22:52 +0000 (23:22 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Tue, 3 May 2016 23:01:45 +0000 (01:01 +0200)
Not only the individual strings are constant, but also the array itself.

aac_afh.c
afh.h
flac_afh.c
mp3_afh.c
ogg_afh.c
opus_afh.c
spx_afh.c
wma_afh.c

index d3e694548a3dbfaf08e40eb5cd8ba01bc10af7cf..c49f30dea858f05c627a820685fd6538b55eb07d 100644 (file)
--- 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 7a30947a637e43fbeccc9788b30c21f917a427df..dad67351a9ec6548dd464d691d9013afee0a0d6c 100644 (file)
--- 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.
         *
index 51c3c314bf9e265110e82eabae9e94918e1bc7e3..2e2842b183c91bfbe06ec2de0616fb52872ba4f4 100644 (file)
@@ -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.
index 73e744ec44088c4d8c92c1e19c1e6bed8b5076a0..74d65fff6750355fd4a62b296e0b0d4d2d70ff2b 100644 (file)
--- 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
index 32f8bc1beda6f10376db3d3842e0e3cfcaf02e96..29f08965077be97b6015208bb16cd8e8ef2d270c 100644 (file)
--- 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.
  *
index e7511d36325b9e067e9defa10b39ac84911b4d9d..b1469b474d504e69bfe62ad95f6d1ee9043b65a5 100644 (file)
@@ -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"
 
index 108cfaa49c1acf2168858f1120357569379f9c71..b780635b383e8f95dd6f6df9f69cc09ce2c34d16 100644 (file)
--- 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.
  *
index 0b6081cfdb9ea919537532d19dadab004a5fa825..929e732b8cb03bd84d6b382e05508fc2f81cf49d 100644 (file)
--- 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.