aboutsummaryrefslogtreecommitdiff
path: root/source/clip.cpp
diff options
context:
space:
mode:
authorNebuleon Fumika2013-02-01 00:33:30 -0500
committerNebuleon Fumika2013-02-01 00:33:30 -0500
commitf385752705de73b04cbbda735a71f14c19e241a6 (patch)
tree59aca906a8c3fcbaae402d503e7c6b34643e0199 /source/clip.cpp
parentf0fab191e48f165c551980d724bba2f26a764795 (diff)
downloadsnes9x2005-f385752705de73b04cbbda735a71f14c19e241a6.tar.gz
snes9x2005-f385752705de73b04cbbda735a71f14c19e241a6.tar.bz2
snes9x2005-f385752705de73b04cbbda735a71f14c19e241a6.zip
memcpy vs memmove: memmove correctly handles overlapping source and destination memory buffers, but is slower than memcpy in many implementations. When memory buffers don't overlap, memcpy may be more efficient.
The DS2 SDK is such an implementation, so change many memmoves into memcpys.
Diffstat (limited to 'source/clip.cpp')
-rw-r--r--source/clip.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/source/clip.cpp b/source/clip.cpp
index 57204ac..7147abf 100644
--- a/source/clip.cpp
+++ b/source/clip.cpp
@@ -291,7 +291,8 @@ void ComputeClipWindows ()
if (BAND_EMPTY(Win1[0]))
{
B = Window2Enabled;
- memmove (Bands, Win2,
+ // memmove converted: Different stack allocations [Neb]
+ memcpy (Bands, Win2,
sizeof(Win2[0]) * Window2Enabled);
}
else
@@ -355,7 +356,8 @@ void ComputeClipWindows ()
// use window 1 as the clipping (which
// could also be empty).
B = Window1Enabled;
- memmove (Bands, Win1,
+ // memmove converted: Different stack allocations [Neb]
+ memcpy (Bands, Win1,
sizeof(Win1[0]) * Window1Enabled);
}
else
@@ -468,14 +470,16 @@ void ComputeClipWindows ()
if (Window1Enabled == 1 && BAND_EMPTY(Win1[0]))
{
B = Window2Enabled;
- memmove (Bands, Win2,
+ // memmove converted: Different stack allocations [Neb]
+ memcpy (Bands, Win2,
sizeof(Win2[0]) * Window2Enabled);
}
else
if (Window2Enabled == 1 && BAND_EMPTY(Win2[0]))
{
B = Window1Enabled;
- memmove (Bands, Win1,
+ // memmove converted: Different stack allocations [Neb]
+ memcpy (Bands, Win1,
sizeof(Win1[0]) * Window1Enabled);
}
else