changeset 862:058194d7ade6 libavcodec

* fixing some minor const warnings
author kabi
date Tue, 12 Nov 2002 15:00:04 +0000
parents 243cc33da3eb
children 4ba00af12589
files avcodec.h common.c common.h dsputil.h dv.c mem.c mpegvideo.c svq1.c utils.c
diffstat 9 files changed, 17 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/avcodec.h	Tue Nov 12 10:05:21 2002 +0000
+++ b/avcodec.h	Tue Nov 12 15:00:04 2002 +0000
@@ -773,7 +773,7 @@
 } AVCodecContext;
 
 typedef struct AVCodec {
-    char *name;
+    const char *name;
     int type;
     int id;
     int priv_data_size;
@@ -1021,8 +1021,8 @@
 int avcodec(void* handle, avc_cmd_t cmd, void* pin, void* pout);
 
 /* memory */
-void *av_malloc(int size);
-void *av_mallocz(int size);
+void *av_malloc(unsigned int size);
+void *av_mallocz(unsigned int size);
 void av_free(void *ptr);
 void __av_freep(void **ptr);
 #define av_freep(p) __av_freep((void **)(p))
--- a/common.c	Tue Nov 12 10:05:21 2002 +0000
+++ b/common.c	Tue Nov 12 15:00:04 2002 +0000
@@ -133,7 +133,7 @@
     if(n) skip_bits(s, n);
 }
 
-int check_marker(GetBitContext *s, char *msg)
+int check_marker(GetBitContext *s, const char *msg)
 {
     int bit= get_bits1(s);
     if(!bit) printf("Marker bit missing %s\n", msg);
@@ -147,7 +147,7 @@
 
 #define GET_DATA(v, table, i, wrap, size) \
 {\
-    UINT8 *ptr = (UINT8 *)table + i * wrap;\
+    const UINT8 *ptr = (UINT8 *)table + i * wrap;\
     switch(size) {\
     case 1:\
         v = *(UINT8 *)ptr;\
--- a/common.h	Tue Nov 12 10:05:21 2002 +0000
+++ b/common.h	Tue Nov 12 15:00:04 2002 +0000
@@ -639,7 +639,7 @@
 void init_get_bits(GetBitContext *s,
                    UINT8 *buffer, int buffer_size);
 
-int check_marker(GetBitContext *s, char *msg);
+int check_marker(GetBitContext *s, const char *msg);
 void align_get_bits(GetBitContext *s);
 int init_vlc(VLC *vlc, int nb_bits, int nb_codes,
              const void *bits, int bits_wrap, int bits_size,
--- a/dsputil.h	Tue Nov 12 10:05:21 2002 +0000
+++ b/dsputil.h	Tue Nov 12 15:00:04 2002 +0000
@@ -131,7 +131,7 @@
 
 #if defined(HAVE_MMX)
 
-#undef emms_c()
+#undef emms_c
 
 #define MM_MMX    0x0001 /* standard MMX */
 #define MM_3DNOW  0x0004 /* AMD 3DNOW */
--- a/dv.c	Tue Nov 12 10:05:21 2002 +0000
+++ b/dv.c	Tue Nov 12 15:00:04 2002 +0000
@@ -495,7 +495,8 @@
                                  UINT8 *buf, int buf_size)
 {
     DVVideoDecodeContext *s = avctx->priv_data;
-    int sct, dsf, apt, ds, nb_dif_segs, vs, size, width, height, i, packet_size;
+    int sct, dsf, apt, ds, nb_dif_segs, vs, width, height, i, packet_size;
+    unsigned size;
     UINT8 *buf_ptr;
     const UINT16 *mb_pos_ptr;
     AVPicture *picture;
--- a/mem.c	Tue Nov 12 10:05:21 2002 +0000
+++ b/mem.c	Tue Nov 12 15:00:04 2002 +0000
@@ -26,7 +26,7 @@
    linker will do it automatically */
 
 /* memory alloc */
-void *av_malloc(int size)
+void *av_malloc(unsigned int size)
 {
     void *ptr;
 #if defined (HAVE_MEMALIGN)
--- a/mpegvideo.c	Tue Nov 12 10:05:21 2002 +0000
+++ b/mpegvideo.c	Tue Nov 12 15:00:04 2002 +0000
@@ -303,7 +303,8 @@
       s->uvlinesize = s->mb_width * 8  +     EDGE_WIDTH;
 
       for(i=0;i<3;i++) {
-        int w, h, shift, pict_start, size;
+	int w, h, shift, pict_start;
+	unsigned size;
 
         w = s->linesize;
         h = s->mb_height * 16 + 2 * EDGE_WIDTH;
--- a/svq1.c	Tue Nov 12 10:05:21 2002 +0000
+++ b/svq1.c	Tue Nov 12 15:00:04 2002 +0000
@@ -591,7 +591,7 @@
       }
 
 #define SVQ1_CALC_CODEBOOK_ENTRIES(cbook)\
-      codebook = (uint32_t *) cbook[level];\
+      codebook = (const uint32_t *) cbook[level];\
       bit_cache = get_bits (bitbuf, 4*stages);\
       /* calculate codebook entries for this vector */\
       for (j=0; j < stages; j++) {\
@@ -605,11 +605,11 @@
   vlc_code_t *vlc;
   uint8_t    *list[63];
   uint32_t   *dst;
-  uint32_t   *codebook;
+  const uint32_t *codebook;
   int	      entries[6];
   int	      i, j, m, n;
   int	      mean, stages;
-  int	      x, y, width, height, level;
+  unsigned    x, y, width, height, level;
   uint32_t    n1, n2, n3, n4;
 
   /* initialize list for breadth first processing of vectors */
@@ -681,7 +681,7 @@
   vlc_code_t *vlc;
   uint8_t    *list[63];
   uint32_t   *dst;
-  uint32_t   *codebook;
+  const uint32_t *codebook;
   int	      entries[6];
   int	      i, j, m, n;
   int	      mean, stages;
--- a/utils.c	Tue Nov 12 10:05:21 2002 +0000
+++ b/utils.c	Tue Nov 12 15:00:04 2002 +0000
@@ -20,7 +20,7 @@
 #include "dsputil.h"
 #include "mpegvideo.h"
 
-void *av_mallocz(int size)
+void *av_mallocz(unsigned int size)
 {
     void *ptr;
     ptr = av_malloc(size);