summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2004-11-15 10:31:48 +0000
committertron <tron@openttd.org>2004-11-15 10:31:48 +0000
commit57c472e093aad072d5c4113790dfafbca0f40fa6 (patch)
tree33cba4e194270ded85bd9c544bbf733f90eda205
parent01e88bb61d00c96991d9280cea6bc188cc42db33 (diff)
downloadopenttd-57c472e093aad072d5c4113790dfafbca0f40fa6.tar.xz
(svn r624) Merge r377 to trunk:
Remove the memmove special case for MSVC According to the MSDN it was just plain wrong and memmove was directly used in some places anyway
-rw-r--r--network.c2
-rw-r--r--spritecache.c2
-rw-r--r--stdafx.h6
-rw-r--r--strings.c10
-rw-r--r--texteff.c2
5 files changed, 8 insertions, 14 deletions
diff --git a/network.c b/network.c
index b8df0cb31..50ff771d5 100644
--- a/network.c
+++ b/network.c
@@ -398,7 +398,7 @@ void NetworkProcessCommands()
assert(_future_seed[0].frame >= _frame_counter);
if (_future_seed[0].frame != _frame_counter) break;
if (_future_seed[0].seed[0] != _sync_seed_1 ||_future_seed[0].seed[1] != _sync_seed_2) NetworkHandleDeSync();
- memcpy_overlapping(_future_seed, _future_seed + 1, --_num_future_seed * sizeof(FutureSeeds));
+ memmove(_future_seed, _future_seed + 1, --_num_future_seed * sizeof(FutureSeeds));
}
}
}
diff --git a/spritecache.c b/spritecache.c
index 40e544b46..4c7aeff71 100644
--- a/spritecache.c
+++ b/spritecache.c
@@ -524,7 +524,7 @@ static void CompactSpriteCache()
_sprite_ptr[i] -= size;
// Move the memory
- memcpy_overlapping(s+S_HDRSIZE, s+S_HDRSIZE+size, sizeb - S_HDRSIZE );
+ memmove(s + S_HDRSIZE, s + S_HDRSIZE + size, sizeb - S_HDRSIZE);
// What we just did had the effect of swapping the allocated block with the free block, so we need to update
// the block pointers. First update the allocated one. It is in use.
diff --git a/stdafx.h b/stdafx.h
index 1f127e02b..aa5631c07 100644
--- a/stdafx.h
+++ b/stdafx.h
@@ -95,12 +95,6 @@ typedef unsigned int uint32;
typedef unsigned int uint;
#endif
-#if defined(_MSC_VER)
-#define memcpy_overlapping memcpy
-#else
-#define memcpy_overlapping memmove
-#endif
-
#ifndef __BEOS__
typedef signed char int8;
typedef signed short int16;
diff --git a/strings.c b/strings.c
index 567ec6792..f1c44486b 100644
--- a/strings.c
+++ b/strings.c
@@ -182,14 +182,14 @@ void InjectDparam(int amount)
int32 GetParamInt32()
{
int32 result = GET_DPARAM32(0);
- memcpy_overlapping(&_decode_parameters[0], &_decode_parameters[1], sizeof(uint32) * (lengthof(_decode_parameters)-1));
+ memmove(&_decode_parameters[0], &_decode_parameters[1], sizeof(uint32) * (lengthof(_decode_parameters)-1));
return result;
}
static int64 GetParamInt64()
{
int64 result = GET_DPARAM32(0) + ((uint64)GET_DPARAM32(1) << 32);
- memcpy_overlapping(&_decode_parameters[0], &_decode_parameters[2], sizeof(uint32) * (lengthof(_decode_parameters)-2));
+ memmove(&_decode_parameters[0], &_decode_parameters[2], sizeof(uint32) * (lengthof(_decode_parameters)-2));
return result;
}
@@ -197,21 +197,21 @@ static int64 GetParamInt64()
int GetParamInt16()
{
int result = (int16)GET_DPARAM16(0);
- memcpy_overlapping(&_decode_parameters[0], &_decode_parameters[1], sizeof(uint32) * (lengthof(_decode_parameters)-1));
+ memmove(&_decode_parameters[0], &_decode_parameters[1], sizeof(uint32) * (lengthof(_decode_parameters)-1));
return result;
}
int GetParamInt8()
{
int result = (int8)GET_DPARAM8(0);
- memcpy_overlapping(&_decode_parameters[0], &_decode_parameters[1], sizeof(uint32) * (lengthof(_decode_parameters)-1));
+ memmove(&_decode_parameters[0], &_decode_parameters[1], sizeof(uint32) * (lengthof(_decode_parameters)-1));
return result;
}
int GetParamUint16()
{
int result = GET_DPARAM16(0);
- memcpy_overlapping(&_decode_parameters[0], &_decode_parameters[1], sizeof(uint32) * (lengthof(_decode_parameters)-1));
+ memmove(&_decode_parameters[0], &_decode_parameters[1], sizeof(uint32) * (lengthof(_decode_parameters)-1));
return result;
}
diff --git a/texteff.c b/texteff.c
index 9aa8488a8..707b81d63 100644
--- a/texteff.c
+++ b/texteff.c
@@ -126,7 +126,7 @@ void DeleteAnimatedTile(uint tile)
for(ti=_animated_tile_list; ti!=endof(_animated_tile_list); ti++) {
if ( (TileIndex)tile == *ti) {
/* remove the hole */
- memcpy_overlapping(ti, ti+1, endof(_animated_tile_list) - 1 - ti);
+ memmove(ti, ti+1, endof(_animated_tile_list) - 1 - ti);
/* and clear last item */
endof(_animated_tile_list)[-1] = 0;
MarkTileDirtyByTile(tile);