On Fri, Apr 11, 2008 at 08:39:56PM +0200, Lionel Debroux wrote:
> Here's a patch that fixes a number of warnings triggered by uncommon GCC  
> switches such as -Wshadow and -Wwrite-strings.

You will likely have more luck if you split this patchset.  There are
fixes for multiple issues in it, some of which might not be acceptable.

> --- a/trunk/include/video_out.h
> +++ b/trunk/include/video_out.h
> @@ -51,7 +51,7 @@ struct vo_instance_s {
>  typedef vo_instance_t * vo_open_t (void);
>  
>  typedef struct {
> -    char * name;
> +    const char * name;
>      vo_open_t * open;
>  } vo_driver_t;

This looks OK.

> --- a/trunk/libmpeg2/alloc.c
> +++ b/trunk/libmpeg2/alloc.c
> @@ -62,9 +62,9 @@ void mpeg2_free (void * buf)
>  
> -void mpeg2_malloc_hooks (void * malloc (unsigned, mpeg2_alloc_t),
> +void mpeg2_malloc_hooks (void * _malloc (unsigned, mpeg2_alloc_t),

Identifiers starting with __ or _ and capitals are reserved for the
system. Those starting with _ are still reserved at the file level.  So
this name is not good, I would say you should try to come up with
something else.

> --- a/trunk/src/dump_state.c
> +++ b/trunk/src/dump_state.c
> @@ -209,22 +209,22 @@ static void pic_code_del (const mpeg2_picture_t * pic)
>  void dump_state (FILE * f, mpeg2_state_t state, const mpeg2_info_t * info,
>                int offset, int verbose)
>  {
> -    static char * state_name[] = {
> +    static const char * state_name[] = {
>       "BUFFER", "SEQUENCE", "SEQUENCE_REPEATED", "SEQUENCE_MODIFIED", "GOP",
>       "PICTURE", "SLICE_1ST", "PICTURE_2ND", "SLICE", "END",
>       "INVALID", "INVALID_END"
>      };
> -    static char * profile[] = { "HP", "Spatial", "SNR", "MP", "SP" };
> -    static char * level[] = { "HL", "H-14", "ML", "LL" };
> -    static char * profile2[] = { "[EMAIL PROTECTED]", NULL, NULL, "[EMAIL 
> PROTECTED]",
> +    static const char * profile[] = { "HP", "Spatial", "SNR", "MP", "SP" };
> +    static const char * level[] = { "HL", "H-14", "ML", "LL" };
> +    static const char * profile2[] = { "[EMAIL PROTECTED]", NULL, NULL, 
> "[EMAIL PROTECTED]",
>                                NULL, NULL, NULL, NULL, "[EMAIL PROTECTED]",
>                                "[EMAIL PROTECTED]", NULL, "[EMAIL 
> PROTECTED]", "[EMAIL PROTECTED]" };
> -    static char * video_fmt[] = { "COMPONENT", "PAL", "NTSC", "SECAM", 
> "MAC"};
> -    static char coding_type[] = { '0', 'I', 'P', 'B', 'D', '5', '6', '7'};
> -    static char * colour[] = { NULL, "BT.709", "UNSPECIFIED", NULL,
> +    static const char * video_fmt[] = { "COMPONENT", "PAL", "NTSC", "SECAM", 
> "MAC"};
> +    static const char coding_type[] = { '0', 'I', 'P', 'B', 'D', '5', '6', 
> '7'};
> +    static const char * colour[] = { NULL, "BT.709", "UNSPECIFIED", NULL,
>                              "BT.470-2/M", "BT.470-2/B,G",
>                              "SMPTE170M", "SMPTE240M", "LINEAR" };
> -    static char * colour3[] = { NULL, "BT.709", "UNSPEC_COLORS", NULL, NULL,
> +    static const char * colour3[] = { NULL, "BT.709", "UNSPEC_COLORS", NULL, 
> NULL,
>                               "BT.470-2/B,G", "SMPTE170M", "SMPTE240M" };
>      const mpeg2_sequence_t * seq = info->sequence;
>      const mpeg2_gop_t * gop = info->gop;

This looks good to me as well.

Diego

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Libmpeg2-devel mailing list
Libmpeg2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmpeg2-devel

Reply via email to