summaryrefslogtreecommitdiff
path: root/lib/raidfile/RaidFileWrite.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/raidfile/RaidFileWrite.cpp')
-rw-r--r--lib/raidfile/RaidFileWrite.cpp10
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
{