[FFmpeg-cvslog] r14950 - in trunk/libavformat: img2.c mmf.c oma.c utils.c

reimar subversion
Sun Aug 24 19:24:34 CEST 2008


Author: reimar
Date: Sun Aug 24 19:24:34 2008
New Revision: 14950

Log:
Mark several libavformat arrays const

Modified:
   trunk/libavformat/img2.c
   trunk/libavformat/mmf.c
   trunk/libavformat/oma.c
   trunk/libavformat/utils.c

Modified: trunk/libavformat/img2.c
==============================================================================
--- trunk/libavformat/img2.c	(original)
+++ trunk/libavformat/img2.c	Sun Aug 24 19:24:34 2008
@@ -72,7 +72,7 @@ static const IdStrMap img_tags[] = {
     { CODEC_ID_NONE      , NULL}
 };
 
-static int sizes[][2] = {
+static const int sizes[][2] = {
     { 640, 480 },
     { 720, 480 },
     { 720, 576 },

Modified: trunk/libavformat/mmf.c
==============================================================================
--- trunk/libavformat/mmf.c	(original)
+++ trunk/libavformat/mmf.c	Sun Aug 24 19:24:34 2008
@@ -27,7 +27,7 @@ typedef struct {
     offset_t data_size;
 } MMFContext;
 
-static int mmf_rates[] = { 4000, 8000, 11025, 22050, 44100 };
+static const int mmf_rates[] = { 4000, 8000, 11025, 22050, 44100 };
 
 static int mmf_rate(int code)
 {

Modified: trunk/libavformat/oma.c
==============================================================================
--- trunk/libavformat/oma.c	(original)
+++ trunk/libavformat/oma.c	Sun Aug 24 19:24:34 2008
@@ -89,7 +89,7 @@ static int oma_read_header(AVFormatConte
     if (ret != EA3_HEADER_SIZE)
         return -1;
 
-    if (memcmp(buf, (uint8_t[]){'E', 'A', '3'},3) || buf[4] != 0 || buf[5] != EA3_HEADER_SIZE) {
+    if (memcmp(buf, (const uint8_t[]){'E', 'A', '3'},3) || buf[4] != 0 || buf[5] != EA3_HEADER_SIZE) {
         av_log(s, AV_LOG_ERROR, "Couldn't find the EA3 header !\n");
         return -1;
     }
@@ -177,7 +177,7 @@ static int oma_read_packet(AVFormatConte
 
 static int oma_read_probe(AVProbeData *p)
 {
-    if (!memcmp(p->buf, (uint8_t[]){'e', 'a', '3', 3, 0},5))
+    if (!memcmp(p->buf, (const uint8_t[]){'e', 'a', '3', 3, 0},5))
         return AVPROBE_SCORE_MAX;
     else
         return 0;

Modified: trunk/libavformat/utils.c
==============================================================================
--- trunk/libavformat/utils.c	(original)
+++ trunk/libavformat/utils.c	Sun Aug 24 19:24:34 2008
@@ -1965,7 +1965,7 @@ static void compute_chapters_end(AVForma
 #define MAX_STD_TIMEBASES (60*12+5)
 static int get_std_framerate(int i){
     if(i<60*12) return i*1001;
-    else        return ((int[]){24,30,60,12,15})[i-60*12]*1000*12;
+    else        return ((const int[]){24,30,60,12,15})[i-60*12]*1000*12;
 }
 
 /*
@@ -2869,11 +2869,11 @@ int64_t parse_date(const char *datestr, 
     int64_t t;
     struct tm dt;
     int i;
-    static const char *date_fmt[] = {
+    static const char * const date_fmt[] = {
         "%Y-%m-%d",
         "%Y%m%d",
     };
-    static const char *time_fmt[] = {
+    static const char * const time_fmt[] = {
         "%H:%M:%S",
         "%H%M%S",
     };




More information about the ffmpeg-cvslog mailing list