From efc4469d646208ee5e2bf18f5089a202a9da27fd Mon Sep 17 00:00:00 2001 From: "SND\\weimingzhi_cp" Date: Wed, 12 May 2010 03:39:20 +0000 Subject: u8 instead of long git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@47873 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- gui/Config.c | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) (limited to 'gui/Config.c') 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); -- cgit v1.2.3