Commit 224742db authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Remove module_t.psz_object_name

This is the same as module_t.pp_shortcuts[0].
parent b4f67e40
......@@ -202,7 +202,6 @@ size_t CacheLoad( vlc_object_t *p_this, const char *dir, module_cache_t **r )
module = vlc_module_create();
/* Load additional infos */
LOAD_STRING(module->object_name);
LOAD_STRING(module->psz_shortname);
LOAD_STRING(module->psz_longname);
LOAD_STRING(module->psz_help);
......@@ -210,8 +209,6 @@ size_t CacheLoad( vlc_object_t *p_this, const char *dir, module_cache_t **r )
LOAD_IMMEDIATE(module->i_shortcuts);
if (module->i_shortcuts > MODULE_SHORTCUT_MAX)
goto error;
else if (module->i_shortcuts == 0)
module->pp_shortcuts = NULL;
else
{
module->pp_shortcuts =
......@@ -237,9 +234,7 @@ size_t CacheLoad( vlc_object_t *p_this, const char *dir, module_cache_t **r )
while( i_submodules-- )
{
module_t *submodule = vlc_submodule_create (module);
free (submodule->object_name);
free (submodule->pp_shortcuts);
LOAD_STRING(submodule->object_name);
LOAD_STRING(submodule->psz_shortname);
LOAD_STRING(submodule->psz_longname);
LOAD_STRING(submodule->psz_help);
......@@ -247,8 +242,6 @@ size_t CacheLoad( vlc_object_t *p_this, const char *dir, module_cache_t **r )
LOAD_IMMEDIATE(submodule->i_shortcuts);
if (submodule->i_shortcuts > MODULE_SHORTCUT_MAX)
goto error;
else if (submodule->i_shortcuts == 0)
submodule->pp_shortcuts = NULL;
else
{
submodule->pp_shortcuts =
......@@ -497,7 +490,6 @@ static int CacheSaveBank (FILE *file, const module_cache_t *cache,
uint32_t i_submodule;
/* Save additional infos */
SAVE_STRING(module->object_name);
SAVE_STRING(module->psz_shortname);
SAVE_STRING(module->psz_longname);
SAVE_STRING(module->psz_help);
......@@ -541,7 +533,6 @@ static int CacheSaveSubmodule( FILE *file, const module_t *p_module )
if( CacheSaveSubmodule( file, p_module->next ) )
goto error;
SAVE_STRING( p_module->object_name );
SAVE_STRING( p_module->psz_shortname );
SAVE_STRING( p_module->psz_longname );
SAVE_STRING( p_module->psz_help );
......
......@@ -39,7 +39,6 @@ static void vlc_module_destruct (gc_object_t *obj)
module_t *module = vlc_priv (obj, module_t);
free (module->pp_shortcuts);
free (module->object_name);
free (module);
}
......@@ -49,7 +48,6 @@ module_t *vlc_module_create (void)
if (module == NULL)
return NULL;
module->object_name = NULL;
module->next = NULL;
module->submodule = NULL;
module->parent = NULL;
......@@ -82,8 +80,8 @@ module_t *vlc_module_create (void)
static void vlc_submodule_destruct (gc_object_t *obj)
{
module_t *module = vlc_priv (obj, module_t);
free (module->pp_shortcuts);
free (module->object_name);
free (module);
}
......@@ -107,7 +105,6 @@ module_t *vlc_submodule_create (module_t *module)
submodule->pp_shortcuts[0] = module->pp_shortcuts[0]; /* object name */
submodule->i_shortcuts = 1;
submodule->object_name = strdup (module->object_name);
submodule->psz_shortname = module->psz_shortname;
submodule->psz_longname = module->psz_longname;
submodule->psz_capability = module->psz_capability;
......@@ -222,8 +219,7 @@ int vlc_plugin_set (module_t *module, module_config_t *item, int propid, ...)
{
const char *value = va_arg (ap, const char *);
assert (module->object_name == NULL);
module->object_name = strdup (value);
assert (module->i_shortcuts == 0);
module->pp_shortcuts = malloc( sizeof( char ** ) );
module->pp_shortcuts[0] = (char*)value; /* dooh! */
module->i_shortcuts = 1;
......
......@@ -203,9 +203,9 @@ bool module_provides( const module_t *m, const char *cap )
*/
const char *module_get_object( const module_t *m )
{
if (unlikely(m->object_name == NULL))
if (unlikely(m->i_shortcuts == 0))
return "unnamed";
return m->object_name;
return m->pp_shortcuts[0];
}
/**
......@@ -680,11 +680,9 @@ module_t *module_find (const char *name)
for (size_t i = 0; (module = list[i]) != NULL; i++)
{
const char *objname = module->object_name;
if (unlikely(objname == NULL))
if (unlikely(module->i_shortcuts == 0))
continue;
if (!strcmp (objname, name))
if (!strcmp (module->pp_shortcuts[0], name))
{
module_hold (module);
break;
......
......@@ -62,7 +62,6 @@ typedef void * module_handle_t;
*/
struct module_t
{
char *object_name;
gc_object_t vlc_gc_data;
module_t *next;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment