diff --git a/common/controls.c b/common/controls.c index 573c9602..6142d4a4 100644 --- a/common/controls.c +++ b/common/controls.c @@ -140,7 +140,7 @@ uiControl *uiNewControl(uint32_t type, void *initData) if (!uiprivCheckInitializedAndThread()) return NULL; if (type == controlTypeID) { - uiprivProgrammerErrorCannotCreateBaseControl(); + uiprivProgrammerErrorCannotCreateBaseControl(uiprivFunc); return NULL; } memset(&key, 0, sizeof (struct controlType)); diff --git a/common/events.c b/common/events.c index 28ce8c77..02c9cca8 100644 --- a/common/events.c +++ b/common/events.c @@ -74,12 +74,12 @@ void uiEventFree(uiEvent *e) return; checkEventNonnull(e, /* nothing */); if (e->internal) { - uiprivProgrammerErrorFreeingInternalEvent(); + uiprivProgrammerErrorFreeingInternalEvent(uiprivFunc); return; } checkEventNotFiring(e, /* nothing */); if (e->handlers.len != 0) { - uiprivProgrammerErrorFreeingEventInUse(); + uiprivProgrammerErrorFreeingEventInUse(uiprivFunc); return; } @@ -174,7 +174,7 @@ void uiEventFire(uiEvent *e, void *sender, void *args) return; checkEventNonnull(e, /* nothing */); if (e->firing) { - uiprivProgrammerErrorRecursiveEventFire(); + uiprivProgrammerErrorRecursiveEventFire(uiprivFunc); return; } if (!checkEventSender(e, sender, uiprivFunc)) @@ -227,7 +227,7 @@ void uiEventInvalidateSender(uiEvent *e, void *sender) checkEventNonnull(e, /* nothing */); checkEventNotFiring(e, /* nothing */); if (e->opts.Global) { - uiprivProgrammerErrorInvalidatingGlobalEvent(); + uiprivProgrammerErrorInvalidatingGlobalEvent(uiprivFunc); return; } if (sender == NULL) { diff --git a/common/programmererrors.h b/common/programmererrors.h index a083feb6..fc066f5e 100644 --- a/common/programmererrors.h +++ b/common/programmererrors.h @@ -38,17 +38,21 @@ uiprivProgrammerError("attempt to change a uiEvent with %s() while it is firing", \ func) -#define uiprivProgrammerErrorRecursiveEventFire() \ - uiprivProgrammerError("attempt to fire a uiEvent while it is already being fired") +#define uiprivProgrammerErrorRecursiveEventFire(func) \ + uiprivProgrammerError("atteTODOmpt to fire a uiEvent while it is already being fired in %s()", \ + func) -#define uiprivProgrammerErrorFreeingInternalEvent() \ - uiprivProgrammerError("attempt to free a libui-provided uiEvent") +#define uiprivProgrammerErrorFreeingInternalEvent(func) \ + uiprivProgrammerError("atteTODOmpt to free a libui-provided uiEvent", \ + func) -#define uiprivProgrammerErrorFreeingEventInUse() \ - uiprivProgrammerError("attempt to free a uiEvent that still has handlers registered") +#define uiprivProgrammerErrorFreeingEventInUse(func) \ + uiprivProgrammerError("atteTODOmpt to free a uiEvent that still has handlers registered", \ + func) -#define uiprivProgrammerErrorInvalidatingGlobalEvent() \ - uiprivProgrammerError("attempt to call uiEventInvalidateSender() on a global uiEvent") +#define uiprivProgrammerErrorInvalidatingGlobalEvent(func) \ + uiprivProgrammerError("atteTODOmpt to call uiEventInvalidateSender() on a global uiEvent", \ + func) // } @@ -74,8 +78,9 @@ uiprivProgrammerError("wrong type passed to %s(): got %s, want %s", \ func, got, want) -#define uiprivProgrammerErrorCannotCreateBaseControl() \ - uiprivProgrammerError("cannot create a uiControl of type uiControl; you must use a specific control type") +#define uiprivProgrammerErrorCannotCreateBaseControl(func) \ + uiprivProgrammerError("canTODOnot create a uiControl of type uiControl in %s(); you must use a specific control type", \ + func) #define uiprivProgrammerErrorInvalidControlInitData(type, func) \ uiprivProgrammerError("invalid init data for %s in %s()", \