diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2013-01-10 21:21:32 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2013-01-10 21:21:32 +0000 |
commit | f6b6c37ca2a943a0a0f0407939b7633d7d62e321 (patch) | |
tree | 27ff91b5fe9663e38f4beead34fdd31e22a1076f /unittests/Support | |
parent | 197616adda994d9c3f8fe46b2f5b5b34a1f164ad (diff) | |
download | external_llvm-f6b6c37ca2a943a0a0f0407939b7633d7d62e321.zip external_llvm-f6b6c37ca2a943a0a0f0407939b7633d7d62e321.tar.gz external_llvm-f6b6c37ca2a943a0a0f0407939b7633d7d62e321.tar.bz2 |
Replace memcpys by a static_cast and an integral promotion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172108 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Support')
-rw-r--r-- | unittests/Support/YAMLIOTest.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/unittests/Support/YAMLIOTest.cpp b/unittests/Support/YAMLIOTest.cpp index f1ae33f..0993d8c 100644 --- a/unittests/Support/YAMLIOTest.cpp +++ b/unittests/Support/YAMLIOTest.cpp @@ -785,15 +785,13 @@ namespace yaml { // Type of "flags" field varies depending on "kind" field. // Use memcpy here to avoid breaking strict aliasing rules. if (kf.kind == kindA) { - AFlags aflags; - memcpy(&aflags, &kf.flags, sizeof(aflags)); + AFlags aflags = static_cast<AFlags>(kf.flags); io.mapRequired("flags", aflags); - memcpy(&kf.flags, &aflags, sizeof(kf.flags)); + kf.flags = aflags; } else { - BFlags bflags; - memcpy(&bflags, &kf.flags, sizeof(bflags)); + BFlags bflags = static_cast<BFlags>(kf.flags); io.mapRequired("flags", bflags); - memcpy(&kf.flags, &bflags, sizeof(kf.flags)); + kf.flags = bflags; } } }; |