[RFC,6/6] cmdutils: Rename read_file to ff_read_file

Message ID 1320067723-45345-7-git-send-email-martin@martin.st
State Superseded
Headers show

Commit Message

Martin Storsjö Oct. 31, 2011, 1:28 p.m.
This symbol name clashes with a symbol in gnutls, if linking
statically to that library.
---
 avconv.c   |    2 +-
 cmdutils.c |    2 +-
 cmdutils.h |    2 +-
 ffmpeg.c   |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

Comments

Ronald Bultje Oct. 31, 2011, 1:55 p.m. | #1
Hi,

On Mon, Oct 31, 2011 at 6:28 AM, Martin Storsjö <martin@martin.st> wrote:
> This symbol name clashes with a symbol in gnutls, if linking
> statically to that library.
> ---
>  avconv.c   |    2 +-
>  cmdutils.c |    2 +-
>  cmdutils.h |    2 +-
>  ffmpeg.c   |    2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)

You can commit this separately from the rest of the patch, it's obviously OK.

Ronald
Anton Khirnov Oct. 31, 2011, 2:06 p.m. | #2
On Mon, 31 Oct 2011 06:55:21 -0700, "Ronald S. Bultje" <rsbultje@gmail.com> wrote:
> Hi,
> 
> On Mon, Oct 31, 2011 at 6:28 AM, Martin Storsjö <martin@martin.st> wrote:
> > This symbol name clashes with a symbol in gnutls, if linking
> > statically to that library.
> > ---
> >  avconv.c   |    2 +-
> >  cmdutils.c |    2 +-
> >  cmdutils.h |    2 +-
> >  ffmpeg.c   |    2 +-
> >  4 files changed, 4 insertions(+), 4 deletions(-)
> 
> You can commit this separately from the rest of the patch, it's obviously OK.
> 

While it shouldn't cause any trouble, I'd prefer you use something other
than ff_ here. ff_ is used for internal libav* functions, so using it
for a cmdutils function is confusing.

cmdutils_read_file() would be better IMO (or something shorter if you prefer)

Patch

diff --git a/avconv.c b/avconv.c
index f93c9fa..bc57208 100644
--- a/avconv.c
+++ b/avconv.c
@@ -2178,7 +2178,7 @@  static int transcode_init(OutputFile *output_files,
                 } else {
                     char  *logbuffer;
                     size_t logbuffer_size;
-                    if (read_file(logfilename, &logbuffer, &logbuffer_size) < 0) {
+                    if (ff_read_file(logfilename, &logbuffer, &logbuffer_size) < 0) {
                         av_log(NULL, AV_LOG_FATAL, "Error reading log file '%s' for pass-2 encoding\n",
                                logfilename);
                         exit_program(1);
diff --git a/cmdutils.c b/cmdutils.c
index ade3f10..370c6e6 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -785,7 +785,7 @@  int read_yesno(void)
     return yesno;
 }
 
-int read_file(const char *filename, char **bufptr, size_t *size)
+int ff_read_file(const char *filename, char **bufptr, size_t *size)
 {
     FILE *f = fopen(filename, "rb");
 
diff --git a/cmdutils.h b/cmdutils.h
index 80b20b8..e7efbb1 100644
--- a/cmdutils.h
+++ b/cmdutils.h
@@ -309,7 +309,7 @@  int read_yesno(void);
  * @return 0 in case of success, a negative value corresponding to an
  * AVERROR error code in case of failure.
  */
-int read_file(const char *filename, char **bufptr, size_t *size);
+int ff_read_file(const char *filename, char **bufptr, size_t *size);
 
 typedef struct {
     int64_t num_faulty_pts; /// Number of incorrect PTS values so far
diff --git a/ffmpeg.c b/ffmpeg.c
index 86b73b2..17d60ad 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2276,7 +2276,7 @@  static int transcode(AVFormatContext **output_files,
                 } else {
                     char  *logbuffer;
                     size_t logbuffer_size;
-                    if (read_file(logfilename, &logbuffer, &logbuffer_size) < 0) {
+                    if (ff_read_file(logfilename, &logbuffer, &logbuffer_size) < 0) {
                         fprintf(stderr, "Error reading log file '%s' for pass-2 encoding\n", logfilename);
                         exit_program(1);
                     }