[MPlayer-cvslog] r34664 - in trunk/gui: cfg.c win32/wincfg.c

ib subversion at mplayerhq.hu
Thu Feb 9 13:52:10 CET 2012


Author: ib
Date: Thu Feb  9 13:52:09 2012
New Revision: 34664

Log:
Replace string constants by symbolic constants.

This allows definition at one single location.

Modified:
   trunk/gui/cfg.c
   trunk/gui/win32/wincfg.c

Modified: trunk/gui/cfg.c
==============================================================================
--- trunk/gui/cfg.c	Thu Feb  9 13:43:09 2012	(r34663)
+++ trunk/gui/cfg.c	Thu Feb  9 13:52:09 2012	(r34664)
@@ -43,6 +43,11 @@
 #include "sub/font_load.h"
 #include "sub/sub.h"
 
+#define GUI_CONFIGURATION "gui.conf"
+#define GUI_HISTORY       "gui.history"
+#define GUI_PLAYLIST      "gui.pl"
+#define GUI_URLLIST       "gui.url"
+
 m_config_t *gui_conf;
 
 int gtkCacheOn;
@@ -242,7 +247,7 @@ void cfg_read(void)
 
     // configuration
 
-    cfg = get_path("gui.conf");
+    cfg = get_path(GUI_CONFIGURATION);
 
     mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[cfg] file: %s\n", cfg);
 
@@ -264,7 +269,7 @@ void cfg_read(void)
 
     // playlist
 
-    cfg = get_path("gui.pl");
+    cfg = get_path(GUI_PLAYLIST);
     f   = fopen(cfg, "rt");
 
     if (f) {
@@ -289,7 +294,7 @@ void cfg_read(void)
 
     // URL list
 
-    cfg = get_path("gui.url");
+    cfg = get_path(GUI_URLLIST);
     f   = fopen(cfg, "rt");
 
     if (f) {
@@ -312,7 +317,7 @@ void cfg_read(void)
 
     // directory history
 
-    cfg = get_path("gui.history");
+    cfg = get_path(GUI_HISTORY);
     f   = fopen(cfg, "rt+");
 
     if (f) {
@@ -341,7 +346,7 @@ void cfg_write(void)
 
     // configuration
 
-    cfg = get_path("gui.conf");
+    cfg = get_path(GUI_CONFIGURATION);
     f   = fopen(cfg, "wt+");
 
     if (f) {
@@ -366,7 +371,7 @@ void cfg_write(void)
 
     // playlist
 
-    cfg = get_path("gui.pl");
+    cfg = get_path(GUI_PLAYLIST);
     f   = fopen(cfg, "wt+");
 
     if (f) {
@@ -388,7 +393,7 @@ void cfg_write(void)
 
     // URL list
 
-    cfg = get_path("gui.url");
+    cfg = get_path(GUI_URLLIST);
     f   = fopen(cfg, "wt+");
 
     if (f) {
@@ -406,7 +411,7 @@ void cfg_write(void)
 
     // directory history
 
-    cfg = get_path("gui.history");
+    cfg = get_path(GUI_HISTORY);
     f   = fopen(cfg, "wt+");
 
     if (f) {

Modified: trunk/gui/win32/wincfg.c
==============================================================================
--- trunk/gui/win32/wincfg.c	Thu Feb  9 13:43:09 2012	(r34663)
+++ trunk/gui/win32/wincfg.c	Thu Feb  9 13:52:09 2012	(r34664)
@@ -38,6 +38,8 @@
 #include "gui/interface.h"
 #include "gui.h"
 
+#define GUI_CONFIGURATION "gui.conf"
+
 /* params */
 int   gtkAONorm = 0;
 int   gtkAOExtraStereo = 0;
@@ -95,7 +97,7 @@ int cfg_gui_include(m_option_t *conf, co
 
 void cfg_read(void)
 {
-    char *cfg = get_path("gui.conf");
+    char *cfg = get_path(GUI_CONFIGURATION);
 
     player_idle_mode = 1;   // GUI is in idle mode by default
 
@@ -110,7 +112,7 @@ void cfg_read(void)
 
 void cfg_write(void)
 {
-    char *cfg = get_path("gui.conf");
+    char *cfg = get_path(GUI_CONFIGURATION);
     FILE *f;
     int i;
 


More information about the MPlayer-cvslog mailing list