]> git.sesse.net Git - vlc/blobdiff - src/modules/cache.c
Revert "Modules: use a dynamic array for the shortcuts (this save 40K of memory on...
[vlc] / src / modules / cache.c
index fd15dc991bce9cd49b4261d11cc20162a1233049..c6e314ff9ea22913f9a85a9181f2127d1c35217b 100644 (file)
@@ -253,13 +253,10 @@ void CacheLoad( vlc_object_t *p_this, module_bank_t *p_bank, const char *dir )
         LOAD_STRING( pp_cache[i]->p_module->psz_shortname );
         LOAD_STRING( pp_cache[i]->p_module->psz_longname );
         LOAD_STRING( pp_cache[i]->p_module->psz_help );
-
-        LOAD_IMMEDIATE( pp_cache[i]->p_module->i_shortcuts );
-        pp_cache[i]->p_module->pp_shortcuts =
-                malloc( sizeof( char ** ) * pp_cache[i]->p_module->i_shortcuts );
-        for( j = 0; j < pp_cache[i]->p_module->i_shortcuts; j++ )
-            LOAD_STRING( pp_cache[i]->p_module->pp_shortcuts[j] );
-
+        for( j = 0; j < MODULE_SHORTCUT_MAX; j++ )
+        {
+            LOAD_STRING( pp_cache[i]->p_module->pp_shortcuts[j] ); // FIX
+        }
         LOAD_STRING( pp_cache[i]->p_module->psz_capability );
         LOAD_IMMEDIATE( pp_cache[i]->p_module->i_score );
         LOAD_IMMEDIATE( pp_cache[i]->p_module->b_unloadable );
@@ -284,12 +281,10 @@ void CacheLoad( vlc_object_t *p_this, module_bank_t *p_bank, const char *dir )
             LOAD_STRING( p_module->psz_shortname );
             LOAD_STRING( p_module->psz_longname );
             LOAD_STRING( p_module->psz_help );
-
-            LOAD_IMMEDIATE( p_module->i_shortcuts );
-            p_module->pp_shortcuts = malloc( sizeof( char ** ) * p_module->i_shortcuts );
-            for( j = 0; j < p_module->i_shortcuts; j++ )
-                LOAD_STRING( p_module->pp_shortcuts[j] );
-
+            for( j = 0; j < MODULE_SHORTCUT_MAX; j++ )
+            {
+                LOAD_STRING( p_module->pp_shortcuts[j] ); // FIX
+            }
             LOAD_STRING( p_module->psz_capability );
             LOAD_IMMEDIATE( p_module->i_score );
             LOAD_IMMEDIATE( p_module->b_unloadable );
@@ -550,10 +545,10 @@ static int CacheSaveBank (FILE *file, module_cache_t *const *pp_cache,
         SAVE_STRING( pp_cache[i]->p_module->psz_shortname );
         SAVE_STRING( pp_cache[i]->p_module->psz_longname );
         SAVE_STRING( pp_cache[i]->p_module->psz_help );
-        SAVE_IMMEDIATE( pp_cache[i]->p_module->i_shortcuts );
-        for (unsigned j = 0; j < pp_cache[i]->p_module->i_shortcuts; j++)
-            SAVE_STRING( pp_cache[i]->p_module->pp_shortcuts[j] );
-
+        for (unsigned j = 0; j < MODULE_SHORTCUT_MAX; j++)
+        {
+            SAVE_STRING( pp_cache[i]->p_module->pp_shortcuts[j] ); // FIX
+        }
         SAVE_STRING( pp_cache[i]->p_module->psz_capability );
         SAVE_IMMEDIATE( pp_cache[i]->p_module->i_score );
         SAVE_IMMEDIATE( pp_cache[i]->p_module->b_unloadable );
@@ -595,9 +590,8 @@ static int CacheSaveSubmodule( FILE *file, const module_t *p_module )
     SAVE_STRING( p_module->psz_shortname );
     SAVE_STRING( p_module->psz_longname );
     SAVE_STRING( p_module->psz_help );
-    SAVE_IMMEDIATE( p_module->i_shortcuts );
-    for( unsigned j = 0; j < p_module->i_shortcuts; j++ )
-         SAVE_STRING( p_module->pp_shortcuts[j] );
+    for( unsigned j = 0; j < MODULE_SHORTCUT_MAX; j++ )
+         SAVE_STRING( p_module->pp_shortcuts[j] ); // FIXME
 
     SAVE_STRING( p_module->psz_capability );
     SAVE_IMMEDIATE( p_module->i_score );