From 2edd0a00e3244cc4dbc369d81ed1748768a06fb8 Mon Sep 17 00:00:00 2001 From: Jonathan Morton Date: Sun, 12 Feb 2006 13:12:28 +0000 Subject: Change "PPC workaround" to use union instead of memcpy(). All tests now pass. --- lib/raidfile/RaidFileWrite.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/raidfile') diff --git a/lib/raidfile/RaidFileWrite.cpp b/lib/raidfile/RaidFileWrite.cpp index 285dbbc3..e30162fa 100644 --- a/lib/raidfile/RaidFileWrite.cpp +++ b/lib/raidfile/RaidFileWrite.cpp @@ -461,11 +461,11 @@ void RaidFileWrite::TransformToRaidStorage() ASSERT(sizeof(RaidFileRead::FileSizeType) == (2*sizeof(unsigned int))); ASSERT(sizeof(RaidFileRead::FileSizeType) >= sizeof(off_t)); int sizePos = (blockSize/sizeof(unsigned int)) - 2; - RaidFileRead::FileSizeType sw = box_hton64(writeFileStat.st_size); - unsigned int psize[2]; - ::memcpy(psize, &sw, sizeof(RaidFileRead::FileSizeType)); - pparity[sizePos+0] = pstripe1[sizePos+0] ^ psize[0]; - pparity[sizePos+1] = pstripe1[sizePos+1] ^ psize[1]; + union { RaidFileRead::FileSizeType l; unsigned int i[2]; } sw; + + sw.l = box_hton64(writeFileStat.st_size); + pparity[sizePos+0] = pstripe1[sizePos+0] ^ sw.i[0]; + pparity[sizePos+1] = pstripe1[sizePos+1] ^ sw.i[1]; } else { -- cgit v1.2.3