[FFmpeg-devel] [PATCH] lavu: add av_small_strptime() in parseutils.h

Michael Niedermayer michaelni at gmx.at
Wed Sep 5 18:18:28 CEST 2012


On Wed, Sep 05, 2012 at 03:51:30PM +0200, Stefano Sabatini wrote:
> On date Tuesday 2012-09-04 20:53:31 +0200, Michael Niedermayer encoded:
> > On Sat, Sep 01, 2012 at 01:34:19PM +0200, Stefano Sabatini wrote:
> > > Allow to avoid a dependency on strptime() on systems which do not support
> > > it.
> > > 
> > > In particular, fix trac ticket #992.
> > [...]
> > > diff --git a/libavutil/parseutils.h b/libavutil/parseutils.h
> > > index 7c7a91f..fc49ca9 100644
> > > --- a/libavutil/parseutils.h
> > > +++ b/libavutil/parseutils.h
> > > @@ -133,6 +133,25 @@ int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen,
> > >  int av_parse_time(int64_t *timeval, const char *timestr, int duration);
> > >  
> > >  /**
> > > + * Parse the input string p according to the format string fmt and
> > > + * store its results in the structure dt.
> > > + * This implementation supports only a subset of the formats supported
> >                          ^
> > add "currently", so that we can add more features without breaking
> > API
> > 
> > otherwise should be ok if it works
> 
> Nit time:
> 
> should be:
> char *av_small_strptime(const char *p, const char *fmt, struct tm *dt);
> 
> like strptime, or:
> const char *av_small_strptime(const char *p, const char *fmt, struct tm *dt);
> 
> like the current small_strptime()?
> 
> I'm in favor of the first variant for consistency with strptime() (I
> can change that in a separate commit).

return should not be const, otherwise it will add warnings or cast
mess

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is what and why we do it that matters, not just one of them.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120905/76a8b1a0/attachment.asc>


More information about the ffmpeg-devel mailing list