[vlc-devel] [vlc-commits] dbus: move static const tables in the C file

Rafaël Carré rafael.carre at gmail.com
Tue Aug 9 03:52:49 CEST 2011


Le Mon, 08 Aug 2011 08:32:28 +0200,
Rémi Denis-Courmont <remi at remlab.net> a écrit :

> On Mon,  8 Aug 2011 02:08:43 +0200 (CEST), git at videolan.org (Rafaël
> Carré) wrote:
> > +static const char* ppsz_supported_uri_schemes[] = {
> > +    "file", "http", "https", "rtsp", "realrtsp", "pnm", "ftp",
> > "mtp", "smb",
> > +    "mms", "mmsu", "mmst", "mmsh", "unsv", "itpc", "icyx", "rtmp",
> "rtp",
> > +    "dccp", "dvd", "vcd", "vcdx"
> > +};
> > +
> > +static const char* ppsz_supported_mime_types[] = {
> > +    "audio/mpeg", "audio/x-mpeg",
> > +    "video/mpeg", "video/x-mpeg",
> > +    "video/mpeg-system", "video/x-mpeg-system",
> > +    "video/mp4",
> > +    "audio/mp4",
> > +    "video/x-msvideo",
> > +    "video/quicktime",
> > +    "application/ogg", "application/x-ogg",
> > +    "video/x-ms-asf",  "video/x-ms-asf-plugin",
> > +    "application/x-mplayer2",
> > +    "video/x-ms-wmv",
> > +    "video/x-google-vlc-plugin",
> > +    "audio/wav", "audio/x-wav",
> > +    "audio/3gpp",
> > +    "video/3gpp",
> > +    "audio/3gpp2",
> > +    "video/3gpp2",
> > +    "video/divx",
> > +    "video/flv", "video/x-flv",
> > +    "video/x-matroska",
> > +    "audio/x-matroska",
> > +    "application/xspf+xml"
> > +};
> 
> Character matrices would save a number of relocations as opposed to
> arrays of character pointers.

nice trick, thanks for sharing

-- 
Rafaël Carré



More information about the vlc-devel mailing list