diff options
author | Martin Ebourne <martin@ebourne.me.uk> | 2006-02-12 03:16:57 +0000 |
---|---|---|
committer | Martin Ebourne <martin@ebourne.me.uk> | 2006-02-12 03:16:57 +0000 |
commit | 9ff0d883fcc564ad91221953049a47e0937063fa (patch) | |
tree | 1294b812684844684ee476d4a1023be4e2d7a579 /lib/raidfile/RaidFileWrite.cpp | |
parent | dc24ad5027955df1e3555beacf00b77e382e6d2e (diff) |
This ppc problem is clearly a common big-endian platform issue.
Remove ppc hack and configure option. Replace dubious casts with clearer use of memcpy to make this work on all platforms all of the time.
Note that there isn't really a call to memcpy, the compiler inlines it as 2 int copies which is an insignificant overhead (even true with -O0).
Diffstat (limited to 'lib/raidfile/RaidFileWrite.cpp')
-rw-r--r-- | lib/raidfile/RaidFileWrite.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/raidfile/RaidFileWrite.cpp b/lib/raidfile/RaidFileWrite.cpp index c9963f05..285dbbc3 100644 --- a/lib/raidfile/RaidFileWrite.cpp +++ b/lib/raidfile/RaidFileWrite.cpp @@ -462,10 +462,8 @@ void RaidFileWrite::TransformToRaidStorage() ASSERT(sizeof(RaidFileRead::FileSizeType) >= sizeof(off_t)); int sizePos = (blockSize/sizeof(unsigned int)) - 2; RaidFileRead::FileSizeType sw = box_hton64(writeFileStat.st_size); -#ifdef HAVE_PPC_WORKAROUND - static RaidFileRead::FileSizeType ppcWorkaround = sw; -#endif - unsigned int *psize = (unsigned int *)(&sw); + 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]; } |