[FFmpeg-devel] [PATCH] Fix more of icc's warnings #188

Aurelien Jacobs aurel
Tue May 13 01:46:38 CEST 2008


Carl Eugen Hoyos wrote:

> Hi!
> 
> Attached patch silences most of icc's warnings "enumerated type mixed
> with another type".
> I don't know if all changes make actually sense, so please comment.
> 
> [...]

Changes to vp56*, electronicarts.c and avs.c are OK.

> Index: libavformat/matroskadec.c
> ===================================================================
> --- libavformat/matroskadec.c	(revision 13132)
> +++ libavformat/matroskadec.c	(working copy)
> @@ -1053,7 +1053,7 @@
>  
>              /* track type (video, audio, combined, subtitle, etc.) */
>              case MATROSKA_ID_TRACKTYPE: {
> -                uint64_t num;
> +                MatroskaTrackType num;
>                  if ((res = ebml_read_uint(matroska, &id, &num)) < 0)
>                      break;
>                  if (track->type && track->type != num) {

As Michael noticed, this is not OK (same for every uint64_t to enum).
And to be clear, "track->type = num;" is really intended to be an
implicit cast from uint64_t to int (well, to enum in fact).
Feel free to add an explicit cast if it really help.

> @@ -1075,7 +1075,7 @@
>                          av_log(matroska->ctx, AV_LOG_INFO,
>                                 "Unknown or unsupported track type
> 0x%x\n", track->type);
> -                        track->type = 0;
> +                        track->type = MATROSKA_TRACK_TYPE_NONE;
>                          break;
>                  }
>                  matroska->tracks[matroska->num_tracks - 1] = track;

This one is OK, along with the corresponding matroska.h change.

Aurel




More information about the ffmpeg-devel mailing list