From 7fea94ce4af2c97cbfc0a279fe7a755f9185f343 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Wed, 6 Oct 2004 08:50:46 +0000 Subject: [PATCH] * fixing a few of gcc 'clean-code' warnings Originally committed as revision 3563 to svn://svn.ffmpeg.org/ffmpeg/trunk --- ffplay.c | 2 +- libavcodec/common.h | 6 +++--- libavcodec/indeo3.c | 3 ++- libavcodec/ra144.c | 2 +- libavcodec/ra288.c | 2 +- libavformat/avformat.h | 2 +- libavformat/avienc.c | 2 +- libavformat/mov.c | 2 +- 8 files changed, 11 insertions(+), 10 deletions(-) diff --git a/ffplay.c b/ffplay.c index bc0998b226..b89e40570a 100644 --- a/ffplay.c +++ b/ffplay.c @@ -113,7 +113,7 @@ typedef struct VideoState { /* samples output by the codec. we reserve more space for avsync compensation */ uint8_t audio_buf[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2]; - int audio_buf_size; /* in bytes */ + unsigned int audio_buf_size; /* in bytes */ int audio_buf_index; /* in bytes */ AVPacket audio_pkt; uint8_t *audio_pkt_data; diff --git a/libavcodec/common.h b/libavcodec/common.h index 3ac8b4f82b..441d841d68 100644 --- a/libavcodec/common.h +++ b/libavcodec/common.h @@ -391,7 +391,7 @@ typedef struct RL_VLC_ELEM { /* used to avoid missaligned exceptions on some archs (alpha, ...) */ #ifdef ARCH_X86 -# define unaligned32(a) (*(uint32_t*)(a)) +# define unaligned32(a) (*(const uint32_t*)(a)) #else # ifdef __GNUC__ static inline uint32_t unaligned32(const void *v) { @@ -620,7 +620,7 @@ static inline int unaligned32_be(const void *v) (gb)->index= name##_index;\ # define UPDATE_CACHE(name, gb)\ - name##_cache= unaligned32_be( ((uint8_t *)(gb)->buffer)+(name##_index>>3) ) << (name##_index&0x07);\ + name##_cache= unaligned32_be( ((const uint8_t *)(gb)->buffer)+(name##_index>>3) ) << (name##_index&0x07);\ # define SKIP_CACHE(name, gb, num)\ name##_cache <<= (num);\ @@ -1253,7 +1253,7 @@ if((y)<(x)){\ #endif #ifdef ARCH_X86 -static inline long long rdtsc() +static inline long long rdtsc(void) { long long l; asm volatile( "rdtsc\n\t" diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c index a27c3ba4f2..7e4cf01206 100644 --- a/libavcodec/indeo3.c +++ b/libavcodec/indeo3.c @@ -101,7 +101,8 @@ static void iv_Decode_Chunk(Indeo3DecodeContext *s, unsigned char *cur, static void iv_alloc_frames(Indeo3DecodeContext *s) { int luma_width, luma_height, luma_pixels, chroma_width, chroma_height, - chroma_pixels, bufsize, i; + chroma_pixels, i; + unsigned int bufsize; luma_width = (s->width + 3) & (~3); luma_height = (s->height + 3) & (~3); diff --git a/libavcodec/ra144.c b/libavcodec/ra144.c index 65829b6a33..79cce2cef6 100644 --- a/libavcodec/ra144.c +++ b/libavcodec/ra144.c @@ -130,7 +130,7 @@ static void do_voice(int *a1, int *a2) /* do quarter-block output */ -static void do_output_subblock(Real144_internal *glob, int x) +static void do_output_subblock(Real144_internal *glob, unsigned int x) { int a,b,c,d,e,f,g; diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c index 09ecc7aacb..4cff3106e5 100644 --- a/libavcodec/ra288.c +++ b/libavcodec/ra288.c @@ -47,7 +47,7 @@ static void colmult(float *tgt, float *m1, const float *m2, int n); /* initial decode */ -static void unpack(unsigned short *tgt, unsigned char *src, int len) +static void unpack(unsigned short *tgt, unsigned char *src, unsigned int len) { int x,y,z; int n,temp; diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 888b8b334b..a4793a7ca7 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -251,7 +251,7 @@ typedef struct AVStream { /* format I/O context */ typedef struct AVFormatContext { - AVClass *av_class; /* set by av_alloc_format_context */ + const AVClass *av_class; /* set by av_alloc_format_context */ /* can only be iformat or oformat, not both at the same time */ struct AVInputFormat *iformat; struct AVOutputFormat *oformat; diff --git a/libavformat/avienc.c b/libavformat/avienc.c index 4d2981780c..a9d2c2dc3f 100644 --- a/libavformat/avienc.c +++ b/libavformat/avienc.c @@ -182,7 +182,7 @@ unsigned int codec_get_tag(const CodecTag *tags, int id) return 0; } -static unsigned int codec_get_asf_tag(const CodecTag *tags, int id) +static unsigned int codec_get_asf_tag(const CodecTag *tags, unsigned int id) { while (tags->id != 0) { if (!tags->invalid_asf && tags->id == id) diff --git a/libavformat/mov.c b/libavformat/mov.c index 001481e0d7..e82e2f109c 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -239,7 +239,7 @@ typedef struct MOVStreamContext { long current_sample; long left_in_chunk; /* how many samples before next chunk */ /* specific MPEG4 header which is added at the beginning of the stream */ - int header_len; + unsigned int header_len; uint8_t *header_data; MOV_esds_t esds; } MOVStreamContext;