From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by mx.groups.io with SMTP id smtpd.web11.48133.1585570009439406543 for ; Mon, 30 Mar 2020 05:06:50 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=Ri8UzKct; spf=pass (domain: linaro.org, ip: 209.85.221.65, mailfrom: ard.biesheuvel@linaro.org) Received: by mail-wr1-f65.google.com with SMTP id d5so21349445wrn.2 for ; Mon, 30 Mar 2020 05:06:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xDOij/6B7rBRprx2a+Xi1xAf6U5yn9ZQxe6IrcM0Gvo=; b=Ri8UzKctrKxUHUthGuK8tqX1+gygEtwd8a5oqiwfqEBcJY3yvalJWInxtlSA/rBt// 8IDAOBUS23TKKi/8LgpfU2wAowvM+hZpko4Td5uT6nK2ds8dMgGYPRx/34uu/CRhE3mk iQrRtnkJ7HE58m318dss4WzYkIzoDrd2M4AdFb49dMxzVUljFZbT1jIeATNm92vzDoeg 3YI8sZmuHapF26j/bWXtDMECyRnoZvFdgbIooGHF89c/5Z3/cLZlPbI+SaQYTpR5ppUE 8B+KPQDBZ57q8XLR9Fh2FsSeX7s0AFB/hn+hWmaVtd3bIqHIjzzbyL3cm+7GDcdgWVq8 Zg8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xDOij/6B7rBRprx2a+Xi1xAf6U5yn9ZQxe6IrcM0Gvo=; b=Pjzs6L1ZGceqxKi0WcMc0mVD8QzrqJUOU7DX7xwdQwd3gNMD/5qpENk32E2Tm8EbHT WyYoaYILouUuLsBmHj2qfAyJnvkhyJEYanKgN1T9hdcGORiEKmPXOnnqIMBwptKn7mWa U6gcRQN9zfAJb2vrOnjbfFGvQGV0eCW7pNufwtOKZqFjZ6R6WPtWbe4Nhwwu0aHAO8BD NonOt+jSarGrH2QFEC+3OiofOHq2tdnioQG1f+N4aViIIlOv9OKfUFwE7n1TTyiz2Wo0 0qQ1SBFl9LjyVS6L0MD6dgZN6451WtrYdz4v+v8S45na8D63qcz9C5VMot0OdSQKloiV HleA== X-Gm-Message-State: ANhLgQ09jkW8G7y0h79jBARX3K1uYRCT+ysJAW8tXezzEyE65s+qXpuI tx8tE+8X7JV9W2f1BCi9F1IU68HZ7/RyPuSeVAsSpw== X-Google-Smtp-Source: ADFU+vub5fP9buWFmMvC9rYHgbqHiBfy2Gm4DjjhPPJEvuM5vfXuEqkRY+uh3e09n7FCZxCnGT9zyHRuxunWpnbqNIo= X-Received: by 2002:a5d:4fcf:: with SMTP id h15mr14510167wrw.262.1585570008037; Mon, 30 Mar 2020 05:06:48 -0700 (PDT) MIME-Version: 1.0 References: <20200329135104.6560-1-ard.biesheuvel@linaro.org> <5166f7b1-aca5-fca1-43c9-942c630198b9@redhat.com> In-Reply-To: <5166f7b1-aca5-fca1-43c9-942c630198b9@redhat.com> From: "Ard Biesheuvel" Date: Mon, 30 Mar 2020 14:06:37 +0200 Message-ID: Subject: Re: [PATCH] OvmfPkg/GenericQemuLoadImageLib: Fix VS2019 UINT32 conversion error To: Laszlo Ersek Cc: edk2-devel-groups-io Content-Type: text/plain; charset="UTF-8" On Mon, 30 Mar 2020 at 13:39, Laszlo Ersek wrote: > > On 03/29/20 15:51, Ard Biesheuvel wrote: > > Building OVMF for X64 with secure boot enabled on VS2019 results in > > the following error: > > > > d:\a\1\s\OvmfPkg\Library\GenericQemuLoadImageLib\GenericQemuLoadImageLib.c(154): > > error C2220: the following warning is treated as an error > > d:\a\1\s\OvmfPkg\Library\GenericQemuLoadImageLib\GenericQemuLoadImageLib.c(154): > > warning C4244: '=': conversion from 'UINTN' to 'UINT32', possible loss of data > > > > Suppress the error by making the cast explicit. > > > > Link: https://bugzilla.tianocore.org/show_bug.cgi?id=2636 > > Signed-off-by: Ard Biesheuvel > > --- > > OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.c b/OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.c > > index f7f9a205f99d..14c8417d43e7 100644 > > --- a/OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.c > > +++ b/OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.c > > @@ -151,7 +151,7 @@ QemuLoadKernelImage ( > > // > > // Drop the terminating NUL, convert to UTF-16. > > // > > - KernelLoadedImage->LoadOptionsSize = (CommandLineSize - 1) * 2; > > + KernelLoadedImage->LoadOptionsSize = (UINT32)((CommandLineSize - 1) * 2); > > } > > > > QemuFwCfgSelectItem (QemuFwCfgItemInitrdSize); > > > > Reviewed-by: Laszlo Ersek > Thanks. Pushed as 3000c2963db319d055f474c394b062af910bbb2f