[FFmpeg-cvslog] Mark mutable static data const where appropriate.

Alex Converse git at videolan.org
Wed Feb 22 03:01:50 CET 2012


ffmpeg | branch: master | Alex Converse <alex.converse at gmail.com> | Mon Feb 20 00:42:33 2012 -0800| [b0f29db5c2b8d1b7de2ccac815e33090e8c49cff] | committer: Alex Converse

Mark mutable static data const where appropriate.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b0f29db5c2b8d1b7de2ccac815e33090e8c49cff
---

 avprobe.c                  |   12 ++++++------
 avserver.c                 |    2 +-
 libavcodec/aacdec.c        |    2 +-
 libavcodec/libvpxenc.c     |    2 +-
 libavcodec/libxvid_rc.c    |    2 +-
 libavfilter/vf_boxblur.c   |    2 +-
 libavfilter/vf_crop.c      |    2 +-
 libavfilter/vf_drawtext.c  |    6 +++---
 libavfilter/vf_lut.c       |    2 +-
 libavfilter/vf_overlay.c   |    2 +-
 libavfilter/vf_pad.c       |    2 +-
 libavfilter/vf_scale.c     |    2 +-
 libavfilter/vf_select.c    |    2 +-
 libavfilter/vf_setpts.c    |    2 +-
 libavfilter/vf_settb.c     |    2 +-
 libavfilter/vsrc_nullsrc.c |    2 +-
 libavformat/matroskadec.c  |    2 +-
 libavutil/eval.c           |    4 ++--
 18 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/avprobe.c b/avprobe.c
index 799b325..fe2b6e2 100644
--- a/avprobe.c
+++ b/avprobe.c
@@ -48,13 +48,13 @@ static const OptionDef options[];
 static const char *input_filename;
 static AVInputFormat *iformat = NULL;
 
-static const char *binary_unit_prefixes [] = { "", "Ki", "Mi", "Gi", "Ti", "Pi" };
-static const char *decimal_unit_prefixes[] = { "", "K" , "M" , "G" , "T" , "P"  };
+static const char *const binary_unit_prefixes [] = { "", "Ki", "Mi", "Gi", "Ti", "Pi" };
+static const char *const decimal_unit_prefixes[] = { "", "K" , "M" , "G" , "T" , "P"  };
 
-static const char *unit_second_str          = "s"    ;
-static const char *unit_hertz_str           = "Hz"   ;
-static const char *unit_byte_str            = "byte" ;
-static const char *unit_bit_per_second_str  = "bit/s";
+static const char unit_second_str[]         = "s"    ;
+static const char unit_hertz_str[]          = "Hz"   ;
+static const char unit_byte_str[]           = "byte" ;
+static const char unit_bit_per_second_str[] = "bit/s";
 
 void exit_program(int ret)
 {
diff --git a/avserver.c b/avserver.c
index f3ac319..4df8a3e 100644
--- a/avserver.c
+++ b/avserver.c
@@ -1865,7 +1865,7 @@ static int http_parse_request(HTTPContext *c)
 
 static void fmt_bytecount(AVIOContext *pb, int64_t count)
 {
-    static const char *suffix = " kMGTP";
+    static const char suffix[] = " kMGTP";
     const char *s;
 
     for (s = suffix; count >= 100000 && s[1]; count /= 1000, s++);
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index f9cfb76..dd9eefc 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -1015,7 +1015,7 @@ static int decode_scalefactors(AACContext *ac, float sf[120], GetBitContext *gb,
     int offset[3] = { global_gain, global_gain - 90, 0 };
     int clipped_offset;
     int noise_flag = 1;
-    static const char *sf_str[3] = { "Global gain", "Noise gain", "Intensity stereo position" };
+    static const char *const sf_str[3] = { "Global gain", "Noise gain", "Intensity stereo position" };
     for (g = 0; g < ics->num_window_groups; g++) {
         for (i = 0; i < ics->max_sfb;) {
             int run_end = band_type_run_end[idx];
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index 64ff2c1..bba7973 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -66,7 +66,7 @@ typedef struct VP8EncoderContext {
 } VP8Context;
 
 /** String mappings for enum vp8e_enc_control_id */
-static const char *ctlidstr[] = {
+static const char *const ctlidstr[] = {
     [VP8E_UPD_ENTROPY]           = "VP8E_UPD_ENTROPY",
     [VP8E_UPD_REFERENCE]         = "VP8E_UPD_REFERENCE",
     [VP8E_USE_REFERENCE]         = "VP8E_USE_REFERENCE",
diff --git a/libavcodec/libxvid_rc.c b/libavcodec/libxvid_rc.c
index 2386ce3..7a0e60d 100644
--- a/libavcodec/libxvid_rc.c
+++ b/libavcodec/libxvid_rc.c
@@ -47,7 +47,7 @@ int ff_xvid_rate_control_init(MpegEncContext *s){
     }
 
     for(i=0; i<s->rc_context.num_entries; i++){
-        static const char *frame_types = " ipbs";
+        static const char frame_types[] = " ipbs";
         char tmp[256];
         RateControlEntry *rce;
 
diff --git a/libavfilter/vf_boxblur.c b/libavfilter/vf_boxblur.c
index a314f5c..fa739de 100644
--- a/libavfilter/vf_boxblur.c
+++ b/libavfilter/vf_boxblur.c
@@ -30,7 +30,7 @@
 #include "libavutil/pixdesc.h"
 #include "avfilter.h"
 
-static const char *var_names[] = {
+static const char *const var_names[] = {
     "w",
     "h",
     "cw",
diff --git a/libavfilter/vf_crop.c b/libavfilter/vf_crop.c
index cb01bd4..d3b5a09 100644
--- a/libavfilter/vf_crop.c
+++ b/libavfilter/vf_crop.c
@@ -32,7 +32,7 @@
 #include "libavutil/imgutils.h"
 #include "libavutil/mathematics.h"
 
-static const char *var_names[] = {
+static const char *const var_names[] = {
     "E",
     "PHI",
     "PI",
diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index 5b794dc..4846716 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -49,7 +49,7 @@
 #include FT_FREETYPE_H
 #include FT_GLYPH_H
 
-static const char *var_names[] = {
+static const char *const var_names[] = {
     "E",
     "PHI",
     "PI",
@@ -64,8 +64,8 @@ static const char *var_names[] = {
     NULL
 };
 
-static const char *fun2_names[] = {
-    "rand",
+static const char *const fun2_names[] = {
+    "rand"
 };
 
 static double drand(void *opaque, double min, double max)
diff --git a/libavfilter/vf_lut.c b/libavfilter/vf_lut.c
index 7f3e913..b4950f4 100644
--- a/libavfilter/vf_lut.c
+++ b/libavfilter/vf_lut.c
@@ -31,7 +31,7 @@
 #include "avfilter.h"
 #include "internal.h"
 
-static const char *var_names[] = {
+static const char *const var_names[] = {
     "E",
     "PHI",
     "PI",
diff --git a/libavfilter/vf_overlay.c b/libavfilter/vf_overlay.c
index 39b2375..2115141 100644
--- a/libavfilter/vf_overlay.c
+++ b/libavfilter/vf_overlay.c
@@ -33,7 +33,7 @@
 #include "libavutil/mathematics.h"
 #include "internal.h"
 
-static const char *var_names[] = {
+static const char *const var_names[] = {
     "E",
     "PHI",
     "PI",
diff --git a/libavfilter/vf_pad.c b/libavfilter/vf_pad.c
index 9ba91ed..fdadb1a 100644
--- a/libavfilter/vf_pad.c
+++ b/libavfilter/vf_pad.c
@@ -35,7 +35,7 @@
 #include "libavutil/mathematics.h"
 #include "drawutils.h"
 
-static const char *var_names[] = {
+static const char *const var_names[] = {
     "PI",
     "PHI",
     "E",
diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
index 37a6f8e..46009a7 100644
--- a/libavfilter/vf_scale.c
+++ b/libavfilter/vf_scale.c
@@ -30,7 +30,7 @@
 #include "libavutil/pixdesc.h"
 #include "libswscale/swscale.h"
 
-static const char *var_names[] = {
+static const char *const var_names[] = {
     "PI",
     "PHI",
     "E",
diff --git a/libavfilter/vf_select.c b/libavfilter/vf_select.c
index 0ec443a..13ec040 100644
--- a/libavfilter/vf_select.c
+++ b/libavfilter/vf_select.c
@@ -28,7 +28,7 @@
 #include "libavutil/mathematics.h"
 #include "avfilter.h"
 
-static const char *var_names[] = {
+static const char *const var_names[] = {
     "E",                 ///< Euler number
     "PHI",               ///< golden ratio
     "PI",                ///< greek pi
diff --git a/libavfilter/vf_setpts.c b/libavfilter/vf_setpts.c
index f265092..b49ca5e 100644
--- a/libavfilter/vf_setpts.c
+++ b/libavfilter/vf_setpts.c
@@ -30,7 +30,7 @@
 #include "libavutil/mathematics.h"
 #include "avfilter.h"
 
-static const char *var_names[] = {
+static const char *const var_names[] = {
     "E",           ///< Euler number
     "INTERLACED",  ///< tell if the current frame is interlaced
     "N",           ///< frame number (starting at zero)
diff --git a/libavfilter/vf_settb.c b/libavfilter/vf_settb.c
index eeb4353..49f7a57 100644
--- a/libavfilter/vf_settb.c
+++ b/libavfilter/vf_settb.c
@@ -30,7 +30,7 @@
 #include "avfilter.h"
 #include "internal.h"
 
-static const char *var_names[] = {
+static const char *const var_names[] = {
     "E",
     "PHI",
     "PI",
diff --git a/libavfilter/vsrc_nullsrc.c b/libavfilter/vsrc_nullsrc.c
index dfd56fa..4f9dd79 100644
--- a/libavfilter/vsrc_nullsrc.c
+++ b/libavfilter/vsrc_nullsrc.c
@@ -27,7 +27,7 @@
 #include "libavutil/parseutils.h"
 #include "avfilter.h"
 
-static const char *var_names[] = {
+static const char *const var_names[] = {
     "E",
     "PHI",
     "PI",
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 31b40a8..4d02488 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -514,7 +514,7 @@ static EbmlSyntax matroska_clusters[] = {
     { 0 }
 };
 
-static const char *matroska_doctypes[] = { "matroska", "webm" };
+static const char *const matroska_doctypes[] = { "matroska", "webm" };
 
 /*
  * Return: Whether we reached the end of a level in the hierarchy or not.
diff --git a/libavutil/eval.c b/libavutil/eval.c
index 9941ed7..4d8ebf4 100644
--- a/libavutil/eval.c
+++ b/libavutil/eval.c
@@ -543,13 +543,13 @@ int av_expr_parse_and_eval(double *d, const char *s,
 #undef printf
 #include <string.h>
 
-static double const_values[] = {
+static const double const_values[] = {
     M_PI,
     M_E,
     0
 };
 
-static const char *const_names[] = {
+static const char *const const_names[] = {
     "PI",
     "E",
     0



More information about the ffmpeg-cvslog mailing list