diff options
| author | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2010-05-12 03:39:20 +0000 |
|---|---|---|
| committer | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2010-05-12 03:39:20 +0000 |
| commit | efc4469d646208ee5e2bf18f5089a202a9da27fd (patch) | |
| tree | 255fb03e54688b904edba2c3e1f41ffaae6a3e1b /gui/Config.c | |
| parent | dc4aa0f1e6f0afa4c78288a1fe9dd681743e758a (diff) | |
| download | pcsxr-efc4469d646208ee5e2bf18f5089a202a9da27fd.tar.gz | |
u8 instead of long
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@47873 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'gui/Config.c')
| -rw-r--r-- | gui/Config.c | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/gui/Config.c b/gui/Config.c index bb7799e0..32a07847 100644 --- a/gui/Config.c +++ b/gui/Config.c @@ -25,7 +25,7 @@ #include "Linux.h" /* TODO escaping/unescaping would be nice, as would maxchars */ -void GetValue(char *src, char *name, char *outvar) { +static void GetValue(char *src, char *name, char *outvar) { char *tmp; *outvar = 0; @@ -42,22 +42,24 @@ void GetValue(char *src, char *name, char *outvar) { return; } -void GetValuel(char *src, char *name, long *var) { +static long GetValuel(char *src, char *name) { char *tmp = strstr(src, name); if (tmp != NULL) { tmp += strlen(name); while ((*tmp == ' ') || (*tmp == '=')) tmp++; - if (*tmp != '\n') *var = atol(tmp); + if (*tmp != '\n') return atol(tmp); } + return 0; } -void GetValueb(char *src, char *name, boolean *var) { +static boolean GetValueb(char *src, char *name) { char *tmp = strstr(src, name); if (tmp != NULL) { tmp += strlen(name); while ((*tmp == ' ') || (*tmp == '=')) tmp++; - if (*tmp != '\n') *var = (atoi(tmp) != 0); + if (*tmp != '\n') return (atoi(tmp) != 0); } + return false; } #define SetValue(name, var) \ @@ -120,19 +122,19 @@ int LoadConfig(PcsxConfig *Conf) { GetValue(data, "BiosDir", Config.BiosDir); GetValue(data, "PluginsDir", Config.PluginsDir); - GetValueb(data, "Xa", &Config.Xa); - GetValueb(data, "Sio", &Config.Sio); - GetValueb(data, "Mdec", &Config.Mdec); - GetValueb(data, "PsxAuto", &Config.PsxAuto); - GetValueb(data, "Cdda", &Config.Cdda); - GetValueb(data, "Dbg", &Config.Debug); - GetValueb(data, "PsxOut", &Config.PsxOut); - GetValueb(data, "SpuIrq", &Config.SpuIrq); - GetValueb(data, "RCntFix", &Config.RCntFix); - GetValueb(data, "VSyncWA", &Config.VSyncWA); - - GetValuel(data, "Cpu", &Config.Cpu); - GetValuel(data, "PsxType", &Config.PsxType); + Config.Xa = GetValueb(data, "Xa"); + Config.Sio = GetValueb(data, "Sio"); + Config.Mdec = GetValueb(data, "Mdec"); + Config.PsxAuto = GetValueb(data, "PsxAuto"); + Config.Cdda = GetValueb(data, "Cdda"); + Config.Debug = GetValueb(data, "Dbg"); + Config.PsxOut = GetValueb(data, "PsxOut"); + Config.SpuIrq = GetValueb(data, "SpuIrq"); + Config.RCntFix = GetValueb(data, "RCntFix"); + Config.VSyncWA = GetValueb(data, "VSyncWA"); + + Config.Cpu = GetValuel(data, "Cpu"); + Config.PsxType = GetValuel(data, "PsxType"); free(data); |
