changeset 37070:393b5e0d5f28

Rewrite add_vf(). Move variable to scope where it is used. Additionally, rename it.
author ib
date Thu, 24 Apr 2014 12:39:37 +0000
parents 004f226b4e4b
children c16af0693c42
files gui/interface.c
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/gui/interface.c	Thu Apr 24 12:29:30 2014 +0000
+++ b/gui/interface.c	Thu Apr 24 12:39:37 2014 +0000
@@ -277,8 +277,6 @@
 
 static void add_vf(const char *vf)
 {
-    void *p;
-
     if (vf_settings) {
         int i = 0;
 
@@ -290,12 +288,12 @@
         }
 
         if (i != -1) {
-            p = realloc(vf_settings, (i + 2) * sizeof(m_obj_settings_t));
+            void *settings = realloc(vf_settings, (i + 2) * sizeof(m_obj_settings_t));
 
-            if (!p)
+            if (!settings)
                 return;
 
-            vf_settings = p;
+            vf_settings = settings;
             vf_settings[i].name     = strdup(vf);
             vf_settings[i].attribs  = NULL;
             vf_settings[i + 1].name = NULL;