summaryrefslogtreecommitdiffstats
path: root/m_struct.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-08-01 17:07:35 +0200
committerwm4 <wm4@nowhere>2012-08-01 17:07:35 +0200
commitc92538dfaa5eb7e9b2773f158cbb310545116abe (patch)
tree4b1ab99a17cbead6ff1b7bf9714642540cd66ce4 /m_struct.c
parent7175f178de72bb4f31cacd79b395a14beaf2f65a (diff)
downloadmpv-c92538dfaa5eb7e9b2773f158cbb310545116abe.tar.bz2
mpv-c92538dfaa5eb7e9b2773f158cbb310545116abe.tar.xz
Remove dead code
This was done with the help of callcatcher [1]. Only functions which are statically known to be unused are removed. Some unused functions are not removed yet, because they might be needed in the near future (such as open_output_stream for the encode branch). There is one user visible change: the --subcc option did nothing, and is removed with this commit. [1] http://www.skynet.ie/~caolan/Packages/callcatcher.html
Diffstat (limited to 'm_struct.c')
-rw-r--r--m_struct.c36
1 files changed, 0 insertions, 36 deletions
diff --git a/m_struct.c b/m_struct.c
index f8bec673f5..5ee932945a 100644
--- a/m_struct.c
+++ b/m_struct.c
@@ -80,27 +80,6 @@ int m_struct_set(const m_struct_t *st, void *obj, const char *field,
return 1;
}
-void
-m_struct_reset(const m_struct_t* st, void* obj, const char* field) {
- const m_option_t* f;
-
- if(!field) { // Reset all options
- int i;
- for(i = 0 ; st->fields[i].name ; i++)
- m_option_copy(&st->fields[i],M_ST_MB_P(obj,st->fields[i].p),M_ST_MB_P(st->defaults,st->fields[i].p));
- return;
- }
-
- // Only one
- f = m_struct_get_field(st,field);
- if(!f) {
- mp_msg(MSGT_CFGPARSER, MSGL_ERR,"Struct %s doesn't have any %s field\n",
- st->name,field);
- return;
- }
- m_option_copy(f,M_ST_MB_P(obj,f->p),M_ST_MB_P(st->defaults,f->p));
-}
-
/// Free an allocated struct
void
m_struct_free(const m_struct_t* st, void* obj) {
@@ -110,18 +89,3 @@ m_struct_free(const m_struct_t* st, void* obj) {
m_option_free(&st->fields[i],M_ST_MB_P(obj,st->fields[i].p));
free(obj);
}
-
-void*
-m_struct_copy(const m_struct_t* st, void* obj) {
- void* r = malloc(st->size);
- int i;
-
- memcpy(r,obj,st->size);
- for(i = 0 ; st->fields[i].name ; i++) {
- if(st->fields[i].type->flags & M_OPT_TYPE_DYNAMIC)
- memset(M_ST_MB_P(r,st->fields[i].p),0,st->fields[i].type->size);
- m_option_copy(&st->fields[i],M_ST_MB_P(r,st->fields[i].p),M_ST_MB_P(obj,st->fields[i].p));
- }
-
- return r;
-}