[FFmpeg-devel] [PATCH]Fix more warnings
Michael Niedermayer
michaelni
Sun Feb 28 19:26:37 CET 2010
On Sun, Feb 28, 2010 at 05:02:50AM +0100, Carl Eugen Hoyos wrote:
> Hi!
>
> I tried to fix some warnings when compiling FFmpeg, if some of my commits
> were not ok, please flame on cvslog and I'll revert.
> Attached are a few more fixes, I was surprised how many unneeded (?)
> symbols we export.
>
> Please comment, Carl Eugen
[...]
> Index: libavcodec/audioconvert.c
> ===================================================================
> --- libavcodec/audioconvert.c (revision 22095)
> +++ libavcodec/audioconvert.c (working copy)
> @@ -79,7 +79,7 @@
> [30] = "DR",
> };
>
> -const char *get_channel_name(int channel_id)
> +static const char *get_channel_name(int channel_id)
> {
> if (channel_id<0 || channel_id>=FF_ARRAY_ELEMS(channel_names))
> return NULL;
ok
[...]
> Index: libavcodec/resample2.c
> ===================================================================
> --- libavcodec/resample2.c (revision 22095)
> +++ libavcodec/resample2.c (working copy)
> @@ -95,7 +95,7 @@
> * @param scale wanted sum of coefficients for each filter
> * @param type 0->cubic, 1->blackman nuttall windowed sinc, 2..16->kaiser windowed sinc beta=2..16
> */
> -void av_build_filter(FELEM *filter, double factor, int tap_count, int phase_count, int scale, int type){
> +static void av_build_filter(FELEM *filter, double factor, int tap_count, int phase_count, int scale, int type){
> int ph, i;
> double x, y, w, tab[tap_count];
> const int center= (tap_count-1)/2;
if noone wants to use this from outside lav than ok
> Index: libavcodec/libxvidff.c
> ===================================================================
> --- libavcodec/libxvidff.c (revision 22095)
> +++ libavcodec/libxvidff.c (working copy)
> @@ -82,7 +82,7 @@
> * @param avctx AVCodecContext pointer to context
> * @return Returns 0 on success, -1 on failure
> */
> -av_cold int ff_xvid_encode_init(AVCodecContext *avctx) {
> +static av_cold int ff_xvid_encode_init(AVCodecContext *avctx) {
> int xerr, i;
> int xvid_flags = avctx->flags;
> struct xvid_context *x = avctx->priv_data;
> @@ -367,7 +367,7 @@
> * @param data Pointer to AVFrame of unencoded frame
> * @return Returns 0 on success, -1 on failure
> */
> -int ff_xvid_encode_frame(AVCodecContext *avctx,
> +static int ff_xvid_encode_frame(AVCodecContext *avctx,
> unsigned char *frame, int buf_size, void *data) {
> int xerr, i;
> char *tmp;
> @@ -475,7 +475,7 @@
> * @param avctx AVCodecContext pointer to context
> * @return Returns 0, success guaranteed
> */
> -av_cold int ff_xvid_encode_close(AVCodecContext *avctx) {
> +static av_cold int ff_xvid_encode_close(AVCodecContext *avctx) {
> struct xvid_context *x = avctx->priv_data;
>
> xvid_encore(x->encoder_handle, XVID_ENC_DESTROY, NULL, NULL);
dont need ff_ anymore
> Index: libavcodec/mpegaudiodec.c
> ===================================================================
> --- libavcodec/mpegaudiodec.c (revision 22095)
> +++ libavcodec/mpegaudiodec.c (working copy)
> @@ -101,7 +101,7 @@
> * Convert region offsets to region sizes and truncate
> * size to big_values.
> */
> -void ff_region_offset2size(GranuleDef *g){
> +static void ff_region_offset2size(GranuleDef *g){
> int i, k, j=0;
> g->region_size[2] = (576 / 2);
> for(i=0;i<3;i++) {
> @@ -111,7 +111,7 @@
> }
> }
>
> -void ff_init_short_region(MPADecodeContext *s, GranuleDef *g){
> +static void ff_init_short_region(MPADecodeContext *s, GranuleDef *g){
> if (g->block_type == 2)
> g->region_size[0] = (36 / 2);
> else {
> @@ -125,7 +125,7 @@
> g->region_size[1] = (576 / 2);
> }
>
> -void ff_init_long_region(MPADecodeContext *s, GranuleDef *g, int ra1, int ra2){
> +static void ff_init_long_region(MPADecodeContext *s, GranuleDef *g, int ra1, int ra2){
> int l;
> g->region_size[0] =
> band_index_long[s->sample_rate_index][ra1 + 1] >> 1;
> @@ -135,7 +135,7 @@
> band_index_long[s->sample_rate_index][l] >> 1;
> }
>
> -void ff_compute_band_indexes(MPADecodeContext *s, GranuleDef *g){
> +static void ff_compute_band_indexes(MPADecodeContext *s, GranuleDef *g){
> if (g->block_type == 2) {
> if (g->switch_point) {
> /* if switched mode, we handle the 36 first samples as
not ok, these are used in my mp3 encoder, well, once it is finished (which
might be never ...)
> Index: libavcodec/utils.c
> ===================================================================
> --- libavcodec/utils.c (revision 22095)
> +++ libavcodec/utils.c (working copy)
> @@ -37,6 +37,7 @@
> #include "opt.h"
> #include "imgconvert.h"
> #include "audioconvert.h"
> +#include "libxvid_internal.h"
> #include "internal.h"
> #include <stdlib.h>
> #include <stdarg.h>
> @@ -768,7 +769,7 @@
> return NULL;
> }
>
> -int av_get_bit_rate(AVCodecContext *ctx)
> +static int av_get_bit_rate(AVCodecContext *ctx)
doesnt need av_ if its static
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> ... defining _GNU_SOURCE...
For the love of all that is holy, and some that is not, don't do that.
-- Luca & Mans
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100228/4feb3940/attachment.pgp>
More information about the ffmpeg-devel
mailing list