On 6/23/15, Philip Langdale <phil...@overt.org> wrote:
> I got a bunch of warnings when I compiled it. Please fix.
>
> Thanks.
>
> ----------------------------------------------------------
>
> CC libavcodec/movtextenc.o
> libavcodec/movtextenc.c: In function ‘mov_text_style_cb’:
> libavcodec/movtextenc.c:124:17: warning: ‘return’ with a value, in
> function returning void return AVERROR(ENOMEM);
> ^
> libavcodec/movtextenc.c:138:21: warning: ‘return’ with a value, in
> function returning void return AVERROR(ENOMEM);
> ^
> libavcodec/movtextenc.c:167:13: warning: ‘return’ with a value, in
> function returning void return AVERROR(ENOMEM);

The function mov_text_style_cb() is a void function, I'll make it int
funciton to return a value.

> ^
> libavcodec/movtextenc.c: In function ‘mov_text_encode_frame’:
> libavcodec/movtextenc.c:242:47: warning: passing argument 2 of
> ‘av_bprint_append_data’ from incompatible pointer type
> av_bprint_append_data(&s->buffer, &s->tsmb_size, 4); ^
> In file included from libavcodec/ass.h:26:0,
> from libavcodec/movtextenc.c:30:
> ./libavutil/bprint.h:146:6: note: expected ‘const char *’ but argument
> is of type ‘uint32_t *’ void av_bprint_append_data(AVBPrint *buf, const
> char *data, unsigned size); ^
> libavcodec/movtextenc.c:243:47: warning: passing argument 2 of
> ‘av_bprint_append_data’ from incompatible pointer type
> av_bprint_append_data(&s->buffer, &s->tsmb_type, 4); ^
> In file included from libavcodec/ass.h:26:0,
> from libavcodec/movtextenc.c:30:
> ./libavutil/bprint.h:146:6: note: expected ‘const char *’ but argument
> is of type ‘uint32_t *’ void av_bprint_append_data(AVBPrint *buf, const
> char *data, unsigned size); ^
> libavcodec/movtextenc.c:244:47: warning: passing argument 2 of
> ‘av_bprint_append_data’ from incompatible pointer type
> av_bprint_append_data(&s->buffer, &s->style_entries, 2); ^
> In file included from libavcodec/ass.h:26:0,
> from libavcodec/movtextenc.c:30:
> ./libavutil/bprint.h:146:6: note: expected ‘const char *’ but argument
> is of type ‘uint16_t *’ void av_bprint_append_data(AVBPrint *buf, const
> char *data, unsigned size); ^
> libavcodec/movtextenc.c:246:51: warning: passing argument 2 of
> ‘av_bprint_append_data’ from incompatible pointer type
> av_bprint_append_data(&s->buffer, &s->style_attributes[j]->style_start,
> 2); ^ In file included from libavcodec/ass.h:26:0,
> from libavcodec/movtextenc.c:30:
> ./libavutil/bprint.h:146:6: note: expected ‘const char *’ but argument
> is of type ‘uint16_t *’ void av_bprint_append_data(AVBPrint *buf, const
> char *data, unsigned size); ^
> libavcodec/movtextenc.c:247:51: warning: passing argument 2 of
> ‘av_bprint_append_data’ from incompatible pointer type
> av_bprint_append_data(&s->buffer, &s->style_attributes[j]->style_end,
> 2); ^ In file included from libavcodec/ass.h:26:0,
> from libavcodec/movtextenc.c:30:
> ./libavutil/bprint.h:146:6: note: expected ‘const char *’ but argument
> is of type ‘uint16_t *’ void av_bprint_append_data(AVBPrint *buf, const
> char *data, unsigned size); ^
> libavcodec/movtextenc.c:248:51: warning: passing argument 2 of
> ‘av_bprint_append_data’ from incompatible pointer type
> av_bprint_append_data(&s->buffer, &s->style_fontID, 2); ^
> In file included from libavcodec/ass.h:26:0,
> from libavcodec/movtextenc.c:30:
> ./libavutil/bprint.h:146:6: note: expected ‘const char *’ but argument
> is of type ‘uint16_t *’ void av_bprint_append_data(AVBPrint *buf, const
> char *data, unsigned size); ^
> libavcodec/movtextenc.c:251:51: warning: passing argument 2 of
> ‘av_bprint_append_data’ from incompatible pointer type
> av_bprint_append_data(&s->buffer, &s->style_color, 4); ^
> In file included from libavcodec/ass.h:26:0,
> from libavcodec/movtextenc.c:30:
> ./libavutil/bprint.h:146:6: note: expected ‘const char *’ but argument
> is of type ‘uint32_t *’ void av_bprint_append_data(AVBPrint *buf, const
> char *data, unsigned size); ^

As for these warnings, we discussed that they were fine as long as I am
keeping check of alignment and placement into the buffer properly. Defining
all these variables as char* would make the code lengthier and less clean.
What do you suggest?

Thanks,

Niklesh
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to