diff options
author | Jonathan Morton <chromi@chromatix.org.uk> | 2006-02-12 13:12:28 +0000 |
---|---|---|
committer | Jonathan Morton <chromi@chromatix.org.uk> | 2006-02-12 13:12:28 +0000 |
commit | 2edd0a00e3244cc4dbc369d81ed1748768a06fb8 (patch) | |
tree | 80b702f0c425f376db3f3f28604917e407a1b2d8 /lib | |
parent | 9ff0d883fcc564ad91221953049a47e0937063fa (diff) |
Change "PPC workaround" to use union instead of memcpy(). All tests now pass.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/raidfile/RaidFileWrite.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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 { |