From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-vs1-f47.google.com (mail-vs1-f47.google.com [209.85.217.47]) by mx.groups.io with SMTP id smtpd.web10.79627.1656983862420527142 for ; Mon, 04 Jul 2022 18:17:42 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Dqf5WxQy; spf=pass (domain: gmail.com, ip: 209.85.217.47, mailfrom: pedro.falcato@gmail.com) Received: by mail-vs1-f47.google.com with SMTP id a184so1423979vsa.1 for ; Mon, 04 Jul 2022 18:17:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+8P36UvfvgTXX+6i+C3moICan1SdTOXFXyaUBS2NfKs=; b=Dqf5WxQyUIK7gDpZWLe/dc+ka0bAqNpAYE/4AGWro0ChZFOsHbTzg+bo78mWKQuqS8 BYYPRdv3dPnQQ/KVgbN23W3r+LYrJNn1JDPKF4Rc6hnkvmg+7k/jbJywjaYlNnZ1oA29 CK0a5lkCP21M87RiBvwULxjjHXh++dAh4IwHA4GMGZiueUeerG7TWoocVumeTKjH9Cj3 BxCClcWL64TnGRedEFTmZ54L746UrqP+H6hSNItkID7TdhaYThGn1fCCPZone5OJ7vkf UkYJet6gXXSl/fXq4fGB35i8vwRV+9+66duuMZ8jsimU8aJM7Cz6IWz/+Pq37W+bIKRK RQWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+8P36UvfvgTXX+6i+C3moICan1SdTOXFXyaUBS2NfKs=; b=IjO4Riag4nOejNG0X6X/gHTy6XCeU2hlHGczGZAZ/sc4Vq442BaPk+kQ+Tw0phsi7f 7uDnRLo7Mg+ngnQORIK5qo1Gc7h8JqJ+B3yFREXYYniIdgFk2T4A8wGRw1AUxWb8m/hk FLKZ0Ga3n7WSdnr/woFw1UqBEnMGMnQBrhYS8JJ2PaSGCVFdlv1okvMZhxSlJX80r84I vDmUElOZu8M0/kqO2KFAodDqxn+lcqcDOObtw1TnslPhl06A/z+kJbAWR27Vkv7DSh7X tkAcSlSgrrGhc/NuMMMHsOqS1NgM1/zzxrT7K5w1D0XfJYlfHP/fzUHUeJpuDy61RZU/ GKPA== X-Gm-Message-State: AJIora/K+hvba6lp3sedLcxv0R7VwgRdErnXgNdzT0VpPL4s9DGNQkDL YpGKgiKlnPeleWr/t4SzrmEJggXnlPn3rvz8rViPQLxsiHo= X-Google-Smtp-Source: AGRyM1uRB6LiSN/bjOD9vw8//qstFFQTbZoExRqq/+XkXhzG1PdY3SSIAl0wsSkgI6+th3BNtviSPZzZejREFnuDh7c= X-Received: by 2002:a05:6102:318a:b0:356:fabd:4d9a with SMTP id c10-20020a056102318a00b00356fabd4d9amr140405vsh.7.1656983861317; Mon, 04 Jul 2022 18:17:41 -0700 (PDT) MIME-Version: 1.0 References: <20220705000356.342723-1-pedro.falcato@gmail.com> <006301d8900a$ba906e90$2fb14bb0$@byosoft.com.cn> In-Reply-To: <006301d8900a$ba906e90$2fb14bb0$@byosoft.com.cn> From: "Pedro Falcato" Date: Tue, 5 Jul 2022 02:17:30 +0100 Message-ID: Subject: =?UTF-8?B?UmU6IFtlZGsyLWRldmVsXSDlm57lpI06IFtQQVRDSF0gTWRlUGtnL0Jhc2VQcmludExpYjogQWRkICV6IHNwZWNpZmllcg==?= To: edk2-devel-groups-io , Liming Gao Cc: Michael D Kinney , Zhiguang Liu Content-Type: multipart/alternative; boundary="00000000000073d5b105e3049e5c" --00000000000073d5b105e3049e5c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Fixed in v2. On Tue, Jul 5, 2022 at 2:01 AM gaoliming via groups.io wrote: > Pedro: > Please also add %z description in > Edk2\MdePkg\Include\Library\PrintLib.h. > > And, please also submit one BZ for this change. This is a new feature. > > Thanks > Liming > > > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > > =E5=8F=91=E4=BB=B6=E4=BA=BA: Pedro Falcato > > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2022=E5=B9=B47=E6=9C=885=E6=97=A5= 8:04 > > =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io > > =E6=8A=84=E9=80=81: Michael D Kinney ; Limi= ng Gao > > ; Zhiguang Liu > > =E4=B8=BB=E9=A2=98: [PATCH] MdePkg/BasePrintLib: Add %z specifier > > > > %z is used in standard C99 as the printf specifier for size_t types. > > Add support for it so we can portably print UINTN. > > > > Cc: Michael D Kinney > > Cc: Liming Gao > > Cc: Zhiguang Liu > > Signed-off-by: Pedro Falcato > > --- > > MdePkg/Library/BasePrintLib/PrintLibInternal.c | 9 +++++++++ > > MdePkg/Library/BasePrintLib/PrintLibInternal.h | 1 + > > 2 files changed, 10 insertions(+) > > > > diff --git a/MdePkg/Library/BasePrintLib/PrintLibInternal.c > > b/MdePkg/Library/BasePrintLib/PrintLibInternal.c > > index 42b598a432..1cd99b2213 100644 > > --- a/MdePkg/Library/BasePrintLib/PrintLibInternal.c > > +++ b/MdePkg/Library/BasePrintLib/PrintLibInternal.c > > @@ -720,6 +720,9 @@ BasePrintLibSPrintMarker ( > > case 'l': > > Flags |=3D LONG_TYPE; > > break; > > + case 'z': > > + Flags |=3D SIZET_TYPE; > > + break; > > case '*': > > if ((Flags & PRECISION) =3D=3D 0) { > > Flags |=3D PAD_TO_WIDTH; > > @@ -833,6 +836,12 @@ BasePrintLibSPrintMarker ( > > } else { > > Value =3D BASE_ARG (BaseListMarker, int); > > } > > + } else if ((Flags & SIZET_TYPE) !=3D 0) { > > + if (BaseListMarker =3D=3D NULL) { > > + Value =3D VA_ARG (VaListMarker, UINTN); > > + } else { > > + Value =3D BASE_ARG (BaseListMarker, UINTN); > > + } > > } else { > > if (BaseListMarker =3D=3D NULL) { > > Value =3D VA_ARG (VaListMarker, INT64); > > diff --git a/MdePkg/Library/BasePrintLib/PrintLibInternal.h > > b/MdePkg/Library/BasePrintLib/PrintLibInternal.h > > index 34d591c6fc..9193e6192b 100644 > > --- a/MdePkg/Library/BasePrintLib/PrintLibInternal.h > > +++ b/MdePkg/Library/BasePrintLib/PrintLibInternal.h > > @@ -29,6 +29,7 @@ > > #define ARGUMENT_REVERSED BIT12 > > #define COUNT_ONLY_NO_PRINT BIT13 > > #define UNSIGNED_TYPE BIT14 > > +#define SIZET_TYPE BIT15 > > > > // > > // Record date and time information > > -- > > 2.37.0 > > > > > >=20 > > > --=20 Pedro Falcato --00000000000073d5b105e3049e5c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Fixed in v2.

On Tue, Jul 5, 2022 at 2:01 AM gaoliming v= ia groups.io <gaoliming=3Dbyosoft.com.cn@groups.io> wrote:
<= /div>
Pedro:
=C2=A0 Please also add %z description in Edk2\MdePkg\Include\Library\PrintL= ib.h.

=C2=A0 And, please also submit one BZ for this change. This is a new featur= e.

Thanks
Liming

> -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6-----
> =E5=8F=91=E4=BB=B6=E4=BA=BA: Pedro Falcato <pedro.falcato@gmail.com>
> =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2022=E5=B9=B47=E6=9C=885=E6=97= =A5 8:04
> =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io
> =E6=8A=84=E9=80=81: Michael D Kinney <michael.d.kinney@intel.com>; Limi= ng Gao
> <gaol= iming@byosoft.com.cn>; Zhiguang Liu <zhiguang.liu@intel.com>
> =E4=B8=BB=E9=A2=98: [PATCH] MdePkg/BasePrintLib: Add %z specifier
>
> %z is used in standard C99 as the printf specifier for size_t types. > Add support for it so we can portably print UINTN.
>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
> ---
>=C2=A0 MdePkg/Library/BasePrintLib/PrintLibInternal.c | 9 +++++++++
>=C2=A0 MdePkg/Library/BasePrintLib/PrintLibInternal.h | 1 +
>=C2=A0 2 files changed, 10 insertions(+)
>
> diff --git a/MdePkg/Library/BasePrintLib/PrintLibInternal.c
> b/MdePkg/Library/BasePrintLib/PrintLibInternal.c
> index 42b598a432..1cd99b2213 100644
> --- a/MdePkg/Library/BasePrintLib/PrintLibInternal.c
> +++ b/MdePkg/Library/BasePrintLib/PrintLibInternal.c
> @@ -720,6 +720,9 @@ BasePrintLibSPrintMarker (
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 case 'l':
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Flags |=3D LONG= _TYPE;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 case 'z':
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Flags |=3D SIZET_TYP= E;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 case '*':
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if ((Flags &= ; PRECISION) =3D=3D 0) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Flags |= =3D PAD_TO_WIDTH;
> @@ -833,6 +836,12 @@ BasePrintLibSPrintMarker (
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 } else {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Value = =3D BASE_ARG (BaseListMarker, int);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 } else if ((Flags & SIZ= ET_TYPE) !=3D 0) {
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (BaseListMarker = =3D=3D NULL) {
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Value =3D VA_= ARG (VaListMarker, UINTN);
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 } else {
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Value =3D BAS= E_ARG (BaseListMarker, UINTN);
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 } else {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (BaseListMar= ker =3D=3D NULL) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Value = =3D VA_ARG (VaListMarker, INT64);
> diff --git a/MdePkg/Library/BasePrintLib/PrintLibInternal.h
> b/MdePkg/Library/BasePrintLib/PrintLibInternal.h
> index 34d591c6fc..9193e6192b 100644
> --- a/MdePkg/Library/BasePrintLib/PrintLibInternal.h
> +++ b/MdePkg/Library/BasePrintLib/PrintLibInternal.h
> @@ -29,6 +29,7 @@
>=C2=A0 #define ARGUMENT_REVERSED=C2=A0 =C2=A0 BIT12
>=C2=A0 #define COUNT_ONLY_NO_PRINT=C2=A0 BIT13
>=C2=A0 #define UNSIGNED_TYPE=C2=A0 =C2=A0 =C2=A0 =C2=A0 BIT14
> +#define SIZET_TYPE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0BIT15
>
>=C2=A0 //
>=C2=A0 // Record date and time information
> --
> 2.37.0










--
Pedro Falcato
--00000000000073d5b105e3049e5c--