全部博文(177)
分类: C/C++
2009-06-19 14:08:01
|
chinaunix网友2009-06-30 13:15:00
why not to refine it like this? that is better for no confusion. uint32* MemoryCopy_UINT32(uint32* dest, const uint32* src, const size_t len) { ASSERT(dest && src && ((uint32)dest) & 0x3 == 0 && ((uint32)src) & 0x3 == 0 ); uint32* pD = dest; const uint32* pS = src; const uint32* pEnd = pS + len; if (pS < pD) { pD += len; while (pEnd > pS) *--pD = *--pEnd; } else if (pS > pD) { while (pS < pEnd) *p