summaryrefslogtreecommitdiff
path: root/settings.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-06-27 21:25:53 +0000
committertron <tron@openttd.org>2006-06-27 21:25:53 +0000
commit772fbda3e37488c2bf7beb96d35b2cbe001d9eda (patch)
tree1bfdb9c99b43fdc3b07ac13cbed4259a06d34f6f /settings.c
parent7fa72c5e2f224243a8c89096f0b07259e05e44cf (diff)
downloadopenttd-772fbda3e37488c2bf7beb96d35b2cbe001d9eda.tar.xz
(svn r5391) Miscellaneous, mostly bracing and whitespace, nothing spectacular
Diffstat (limited to 'settings.c')
-rw-r--r--settings.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/settings.c b/settings.c
index f38124ad1..5df857d10 100644
--- a/settings.c
+++ b/settings.c
@@ -238,10 +238,11 @@ static IniFile *ini_load(const char *filename)
// it's a group?
if (s[0] == '[') {
- if (e[-1] != ']')
+ if (e[-1] != ']') {
ShowInfoF("ini: invalid group name '%s'\n", buffer);
- else
+ } else {
e--;
+ }
s++; // skip [
group = ini_group_alloc(ini, s, e - s);
if (comment_size) {
@@ -341,8 +342,9 @@ static bool ini_save(const char *filename, IniFile *ini)
//*Don't give an equal sign to list items that don't have a parameter */
if (group->type == IGT_LIST && *item->value == '\0') {
fprintf(f, "%s\n", item->name);
- } else
+ } else {
fprintf(f, "%s = %s\n", item->name, item->value);
+ }
}
}
if (ini->comment) fputs(ini->comment, f);
@@ -609,8 +611,12 @@ static void Write_ValidateSetting(void *ptr, const SettingDesc *sd, int32 val)
{
const SettingDescBase *sdb = &sd->desc;
- if (sdb->cmd != SDT_BOOLX && sdb->cmd != SDT_NUMX &&
- sdb->cmd != SDT_ONEOFMANY && sdb->cmd != SDT_MANYOFMANY) return;
+ if (sdb->cmd != SDT_BOOLX &&
+ sdb->cmd != SDT_NUMX &&
+ sdb->cmd != SDT_ONEOFMANY &&
+ sdb->cmd != SDT_MANYOFMANY) {
+ return;
+ }
/* We cannot know the maximum value of a bitset variable, so just have faith */
if (sdb->cmd != SDT_MANYOFMANY) {
@@ -1559,8 +1565,8 @@ void SetPatchValue(uint index, const Patches *object, int32 value)
Write_ValidateSetting(var, sd, value);
if (_game_mode != GM_MENU) {
- void *var2 = ini_get_variable(&sd->save, &_patches_newgame);
- Write_ValidateSetting(var2, sd, value);
+ void* var2 = ini_get_variable(&sd->save, &_patches_newgame);
+ Write_ValidateSetting(var2, sd, value);
}
} else {
DoCommandP(0, index, value, NULL, CMD_CHANGE_PATCH_SETTING);