Bah C99
This commit is contained in:
parent
96c346c2dd
commit
56156f549b
|
@ -55,13 +55,13 @@ uiEvent *uiNewEvent(const uiEventOptions *options)
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define checkEventNonnull(e, ...) if ((e) == NULL) { \
|
#define checkEventNonnull(e, ret) if ((e) == NULL) { \
|
||||||
uiprivProgrammerError(uiprivProgrammerErrorNullPointer, "uiEvent", __func__); \
|
uiprivProgrammerError(uiprivProgrammerErrorNullPointer, "uiEvent", __func__); \
|
||||||
return __VA_ARGS__; \
|
return ret; \
|
||||||
}
|
}
|
||||||
#define checkEventNotFiring(e, ...) if ((e)->firing) { \
|
#define checkEventNotFiring(e, ret) if ((e)->firing) { \
|
||||||
uiprivProgrammerError(uiprivProgrammerErrorChangingEventDuringFire, __func__); \
|
uiprivProgrammerError(uiprivProgrammerErrorChangingEventDuringFire, __func__); \
|
||||||
return __VA_ARGS__; \
|
return ret; \
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool checkEventSender(const uiEvent *e, void *sender, const char *func)
|
static bool checkEventSender(const uiEvent *e, void *sender, const char *func)
|
||||||
|
@ -111,8 +111,8 @@ void uiEventDeleteHandler(uiEvent *e, int id)
|
||||||
{
|
{
|
||||||
struct handler *h;
|
struct handler *h;
|
||||||
|
|
||||||
checkEventNonnull(e);
|
checkEventNonnull(e, /* nothing */);
|
||||||
checkEventNotFiring(e);
|
checkEventNotFiring(e, /* nothing */);
|
||||||
h = findHandler(e, id, __func__);
|
h = findHandler(e, id, __func__);
|
||||||
if (h == NULL)
|
if (h == NULL)
|
||||||
return;
|
return;
|
||||||
|
@ -125,7 +125,7 @@ void uiEventFire(uiEvent *e, void *sender, void *args)
|
||||||
struct handler *h;
|
struct handler *h;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
checkEventNonnull(e);
|
checkEventNonnull(e, /* nothing */);
|
||||||
if (e->firing) {
|
if (e->firing) {
|
||||||
uiprivProgrammerError(uiprivProgrammerErrorRecursiveEventFire);
|
uiprivProgrammerError(uiprivProgrammerErrorRecursiveEventFire);
|
||||||
return;
|
return;
|
||||||
|
@ -158,8 +158,8 @@ void uiEventSetHandlerBlocked(uiEvent *e, int id, bool blocked)
|
||||||
{
|
{
|
||||||
struct handler *h;
|
struct handler *h;
|
||||||
|
|
||||||
checkEventNonnull(e);
|
checkEventNonnull(e, /* nothing */);
|
||||||
checkEventNotFiring(e);
|
checkEventNotFiring(e, /* nothing */);
|
||||||
h = findHandler(e, id, __func__);
|
h = findHandler(e, id, __func__);
|
||||||
if (h == NULL)
|
if (h == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue