[Libguestfs] [PATCH libnbd] common/include/checked-overflow.h: Simplify

Nir Soffer nsoffer at redhat.com
Thu Nov 11 19:15:26 UTC 2021


On Wed, Nov 10, 2021 at 10:07 PM Richard W.M. Jones <rjones at redhat.com> wrote:
>
> On Wed, Nov 10, 2021 at 12:56:26PM -0600, Eric Blake wrote:
> > On Wed, Nov 10, 2021 at 08:49:27PM +0200, Nir Soffer wrote:
> > > We don't need separate macros for size_t and uint64_t since the compiler
> > > builtins are generic. If we need to port to a complier that does not have
> > > generic builtins, it is likely that we can do this in a generic way.
> > >
> > > Signed-off-by: Nir Soffer <nsoffer at redhat.com>
> > > ---
> > >  common/include/checked-overflow.h | 18 ++++--------------
> > >  common/utils/vector.c             | 10 +++++-----
> > >  2 files changed, 9 insertions(+), 19 deletions(-)
> >
> > ACK.
>
> I'll go with what Eric says, particularly because there's an example
> of this in gnulib (under an incompatible license, so we cannot use it):
>
> https://github.com/coreutils/gnulib/blob/50d64b72f2487efcaca6a8b240bc80168e5eb3cb/lib/intprops.h#L389

Pushed to libnbd as 46fa6ecc7422e830f10d64b62c808abe6f8b49af.

I'll push same change to nbdkit.




More information about the Libguestfs mailing list