]> xenbits.xensource.com Git - libvirt.git/commit
event: use newer array management macros
authorEric Blake <eblake@redhat.com>
Fri, 3 Jan 2014 20:31:48 +0000 (13:31 -0700)
committerEric Blake <eblake@redhat.com>
Mon, 6 Jan 2014 15:01:10 +0000 (08:01 -0700)
commit94a26c7e88136af430a7415d6d286e4dd2c1da1e
tree27dca59942492f86a28fc5b102fbb8600b0b9de5
parent22e82aa596feb4c48a216d730c8ef3473861ad52
event: use newer array management macros

We might as well take advantage of viralloc.h instead of open-coding
array management ourselves.  While at it, I simplified several
places that were doing repetitive pointer chasing to use an
intermediate variable for legibility (some other places remain,
but they will disapper in later refactoring patches).

* src/conf/object_event_private.h (_virObjectEventCallbackList):
Use size_t for count.
* src/conf/object_event.c (_virObjectEventQueue): Likewise.
(virObjectEventCallbackListRemoveID): Use VIR_DELETE_ELEMENT.
(virObjectEventQueuePush, virObjectEventCallbackListAddID): Use
VIR_APPEND_ELEMENT.
(virObjectEventCallbackListEventID)
(virObjectEventStateDispatchCallbacks): Simplify code.

Signed-off-by: Eric Blake <eblake@redhat.com>
src/conf/object_event.c
src/conf/object_event_private.h