From db42da38504c6c6c0083683688e53c27990d2df2 Mon Sep 17 00:00:00 2001 From: paladine Date: Sun, 8 Jun 2008 03:26:49 +0000 Subject: [PATCH] Broke out common setting strings into #defines to ensure consistency git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@210 51a99a44-fe44-0410-b1ba-c3e57ba2b86b --- unix/settings.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/unix/settings.c b/unix/settings.c index e8db86ca..e0947524 100644 --- a/unix/settings.c +++ b/unix/settings.c @@ -18,6 +18,10 @@ void DefaultSettings(LPSETTINGS pSettings) pSettings->fadedelayseconds = 0; } +#define LOOPCOUNT_NAME "loopcount" +#define FADESECOND_NAME "fadeseconds" +#define FADEDELAYSECOND_NAME "fadedelayseconds" + int LoadSettings(LPSETTINGS pSettings) { ConfigDb *cfg = GetConfigFile(); @@ -27,9 +31,9 @@ int LoadSettings(LPSETTINGS pSettings) } else { - int bRet = (aud_cfg_db_get_int(cfg,CUBE_CONFIG_TAG,"loopcount",&pSettings->loopcount) && - aud_cfg_db_get_int(cfg,CUBE_CONFIG_TAG,"fadeseconds",&pSettings->fadeseconds) && - aud_cfg_db_get_int(cfg,CUBE_CONFIG_TAG,"fadedelayseconds",&pSettings->fadedelayseconds)); + int bRet = (aud_cfg_db_get_int(cfg,CUBE_CONFIG_TAG,LOOPCOUNT_NAME,&pSettings->loopcount) && + aud_cfg_db_get_int(cfg,CUBE_CONFIG_TAG,FADESECOND_NAME,&pSettings->fadeseconds) && + aud_cfg_db_get_int(cfg,CUBE_CONFIG_TAG,FADEDELAYSECOND_NAME,&pSettings->fadedelayseconds)); aud_cfg_db_close(cfg); @@ -46,9 +50,9 @@ int SaveSettings(LPSETTINGS pSettings) if (!cfg) return 0; - aud_cfg_db_set_int(cfg,CUBE_CONFIG_TAG,"loopcount",pSettings->loopcount); - aud_cfg_db_set_int(cfg,CUBE_CONFIG_TAG,"fadeseconds",pSettings->fadeseconds); - aud_cfg_db_set_int(cfg,CUBE_CONFIG_TAG,"fadedelayseconds",pSettings->fadedelayseconds); + aud_cfg_db_set_int(cfg,CUBE_CONFIG_TAG,LOOPCOUNT_NAME,pSettings->loopcount); + aud_cfg_db_set_int(cfg,CUBE_CONFIG_TAG,FADESECOND_NAME,pSettings->fadeseconds); + aud_cfg_db_set_int(cfg,CUBE_CONFIG_TAG,FADEDELAYSECOND_NAME,pSettings->fadedelayseconds); aud_cfg_db_close(cfg); return 1;