summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-11-05 08:24:52 +0000
committertron <tron@openttd.org>2006-11-05 08:24:52 +0000
commit2a53bcf2b01afd81f336083d16f93c6177398fa2 (patch)
tree26ad191e57d6bb585a8b08b55819a3909380140d
parent60ea083b28f5ef571243296c94b899f3038e8c03 (diff)
downloadopenttd-2a53bcf2b01afd81f336083d16f93c6177398fa2.tar.xz
(svn r7065) Use simple assignment instead of memcpy()
-rw-r--r--genworld_gui.c2
-rw-r--r--newgrf.c4
-rw-r--r--openttd.c4
-rw-r--r--settings_gui.c2
-rw-r--r--sound.c2
5 files changed, 7 insertions, 7 deletions
diff --git a/genworld_gui.c b/genworld_gui.c
index ee18fb227..807664860 100644
--- a/genworld_gui.c
+++ b/genworld_gui.c
@@ -163,7 +163,7 @@ static void StartGeneratingLandscape(glwp_modes mode)
/* Copy all XXX_newgame to XXX */
UpdatePatches();
_opt_ptr = &_opt;
- memcpy(_opt_ptr, &_opt_newgame, sizeof(GameOptions));
+ *_opt_ptr = _opt_newgame;
/* Load the right landscape stuff */
GfxLoadSprites();
diff --git a/newgrf.c b/newgrf.c
index c984d44c5..dfd05c9c5 100644
--- a/newgrf.c
+++ b/newgrf.c
@@ -1272,7 +1272,7 @@ static bool SoundEffectChangeInfo(uint sid, int numinfo, int prop, byte **bufp,
FileEntry *oldfe = GetSound(orig_sound);
/* Literally copy the data of the new sound over the original */
- memcpy(oldfe, newfe, sizeof(*oldfe));
+ *oldfe = *newfe;
}
}
break;
@@ -2939,7 +2939,7 @@ static void ImportGRFSound(byte *buf, int len)
grfmsg(GMS_NOTICE, "ImportGRFSound: Copying sound %d (%d) from file %X", sound, file->sound_offset + sound, grfid);
- memcpy(se, GetSound(file->sound_offset + sound), sizeof(*se));
+ *se = *GetSound(file->sound_offset + sound);
/* Reset volume and priority, which TTDPatch doesn't copy */
se->volume = 128;
diff --git a/openttd.c b/openttd.c
index d185237ad..fceee47d2 100644
--- a/openttd.c
+++ b/openttd.c
@@ -456,7 +456,7 @@ int ttd_main(int argc, char *argv[])
/* Make sure _patches is filled with _patches_newgame if we switch to a game directly */
if (_switch_mode != SM_NONE) {
- memcpy(&_opt, &_opt_newgame, sizeof(_opt));
+ _opt = _opt_newgame;
GfxLoadSprites();
UpdatePatches();
}
@@ -662,7 +662,7 @@ static void StartScenario(void)
}
_opt_ptr = &_opt;
- memcpy(&_opt_ptr->diff, &_opt_newgame.diff, sizeof(_opt_ptr->diff));
+ _opt_ptr->diff = _opt_newgame.diff;
_opt.diff_level = _opt_newgame.diff_level;
// Inititalize data
diff --git a/settings_gui.c b/settings_gui.c
index 57c56ea5a..88586746a 100644
--- a/settings_gui.c
+++ b/settings_gui.c
@@ -554,7 +554,7 @@ void ShowGameDifficulty(void)
DeleteWindowById(WC_GAME_OPTIONS, 0);
/* Copy current settings (ingame or in intro) to temporary holding place
* change that when setting stuff, copy back on clicking 'OK' */
- memcpy(&_opt_mod_temp, _opt_ptr, sizeof(GameOptions));
+ _opt_mod_temp = *_opt_ptr;
AllocateWindowDesc(&_game_difficulty_desc);
}
diff --git a/sound.c b/sound.c
index f8d194c97..af8c6ca53 100644
--- a/sound.c
+++ b/sound.c
@@ -186,7 +186,7 @@ void SndCopyToPool(void)
FileEntry *orig = &_files[_sound_idx[i]];
FileEntry *fe = AllocateFileEntry();
- memcpy(fe, orig, sizeof(*orig));
+ *fe = *orig;
fe->volume = _sound_base_vol[i];
fe->priority = 0;
}