提交 0e1054a1 编写于 作者: P Peter Krempa 提交者: Ján Tomko

util: bitmap: Tolerate NULL bitmaps in virBitmapEqual

After virBitmapEqual is able to compare NULL bitmaps few bits of code
can be cleaned up.

(cherry picked from commit 20448c2a)
Signed-off-by: NJán Tomko <jtomko@redhat.com>

Partial backport without the cleanup.
上级 1021df28
......@@ -504,6 +504,12 @@ bool virBitmapEqual(virBitmapPtr b1, virBitmapPtr b2)
virBitmapPtr tmp;
size_t i;
if (!b1 && !b2)
return true;
if (!b1 || !b2)
return false;
if (b1->max_bit > b2->max_bit) {
tmp = b1;
b1 = b2;
......
......@@ -84,8 +84,7 @@ virBitmapPtr virBitmapNewData(void *data, int len) ATTRIBUTE_NONNULL(1);
int virBitmapToData(virBitmapPtr bitmap, unsigned char **data, int *dataLen)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
bool virBitmapEqual(virBitmapPtr b1, virBitmapPtr b2)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
bool virBitmapEqual(virBitmapPtr b1, virBitmapPtr b2);
size_t virBitmapSize(virBitmapPtr bitmap)
ATTRIBUTE_NONNULL(1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册