From f6b6c37ca2a943a0a0f0407939b7633d7d62e321 Mon Sep 17 00:00:00 2001 From: Dmitri Gribenko Date: Thu, 10 Jan 2013 21:21:32 +0000 Subject: 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 --- unittests/Support/YAMLIOTest.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'unittests/Support') 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(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(kf.flags); io.mapRequired("flags", bflags); - memcpy(&kf.flags, &bflags, sizeof(kf.flags)); + kf.flags = bflags; } } }; -- cgit v1.1