1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-11-24 08:24:23 +03:00

src: remove use of the INT_MULTIPLY_OVERFLOW macro

The GLib g_size_checked_mul() function is not quite the
same signature, and gives compiler warnings due to not
correctly casting from gsize to guint64/32. Implementing
a replacement for INT_MULTIPLY_OVERFLOW is easy enough
to do ourselves.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé
2020-01-14 15:59:35 +00:00
parent 117353f9e5
commit f018fbac78
5 changed files with 8 additions and 25 deletions

View File

@@ -38,6 +38,8 @@
# define sa_assert(expr) /* empty */
#endif
#define VIR_INT_MULTIPLY_OVERFLOW(a,b) (G_UNLIKELY ((b) > 0 && (a) > G_MAXINT / (b)))
/* The library itself is allowed to use deprecated functions /
* variables, so effectively undefine the deprecated attribute
* which would otherwise be defined in libvirt.h.