Commit Graph

11 Commits

Author SHA1 Message Date
wm4 b707589e7e m_config: minor simplification
I think in this case, having a separate function is confusing.
2013-10-24 22:50:13 +02:00
wm4 4cd143e4d8 m_config: store m_config_options in an array instead of a list
Might reduce memory overhead, and is also less annoying.

Since pointers to m_config_options are kept around, this assumes
they're added only during initialization. Otherwise you'd get
dangling pointers.
2013-10-24 22:50:13 +02:00
wm4 a217c08b17 m_config: refactor initialization, reduce amount of malloc'ed strings
Allocate strings only if needed (when we have to prefix sub-options).
Prepare for storing m_config_options in an array instead of a list.
2013-10-24 22:50:13 +02:00
wm4 cfc72d4fff m_config: slightly simplify dynamic option initialization
We can assume memcpy is enough, because the source should be from
static data. (It wouldn't work if the data could contain pointers
back into itself.)
2013-10-24 22:50:13 +02:00
wm4 8d5f8d5a6b m_config: don't allow aliasing with string options
Minor simplification. String options are now not allowed to use the
same variable/field anymore. (Also affects other "dynamic" options
which require memory allocation.)
2013-10-24 22:50:13 +02:00
wm4 cc235d203d m_config: cosmetics: make code less verbose 2013-10-24 22:50:13 +02:00
wm4 c7dee24c8c parser-cfg: use bstr everywhere after parsing stage
Until now it used both char[] and bstr variants in the same code, which
was nasty. For example, the next commit would have additionally required
using memmove() to remove the prefix from the char[] string.
2013-10-14 23:37:58 +02:00
wm4 c613d802bc talloc: change talloc destructor signature
Change talloc destructor so that they can never signal failure, and
don't return a status code. This makes our talloc copy even more
incompatible to upstream talloc, but on the other hand this is
preparation for getting rid of talloc entirely.

(The talloc replacement in the next commit won't allow the talloc_free
equivalent to fail, and the destructor return value would be useless.
But I don't want to change any mpv code either; the idea is that the
talloc replacement commit can be reverted for some time in order to
test whether the talloc replacement introduced a regression.)
2013-10-13 01:16:30 +02:00
wm4 c5e66dde33 m_option: rename struct member named "new"
Cosmetic change to allow C++ code to include this header.

See github issue #195.
2013-08-19 13:03:08 +02:00
Stefano Pigozzi 406241005e core: move contents to mpvcore (2/2)
Followup commit. Fixes all the files references.
2013-08-06 22:52:31 +02:00
Stefano Pigozzi bc27f946c2 core: move contents to mpvcore (1/2)
core is used in many unix systems for core dumps. For that reason some tools
work under the assumption that the file is indeed a core dump (for example
autoconf does this).

This commit just renames the files. The following one will change all the
includes to fix compilation. This is done this way because git has a easier
time tracing file changes if there is a pure rename commit.
2013-08-06 22:48:47 +02:00