From: Dmitri Gribenko Date: Thu, 10 Jan 2013 21:21:32 +0000 (+0000) Subject: Replace memcpys by a static_cast and an integral promotion. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=f6b6c37ca2a943a0a0f0407939b7633d7d62e321;p=oota-llvm.git 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 --- diff --git a/unittests/Support/YAMLIOTest.cpp b/unittests/Support/YAMLIOTest.cpp index f1ae33f1167..0993d8c0b55 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; } } };