cleanup logging in the GUI
This commit is contained in:
@@ -13,7 +13,7 @@ unsigned long register_notifier(gui *_g, char *notification, widget *w,
|
||||
glock(g);
|
||||
|
||||
if (g->next_notifier_id == 2UL * 1024 * 1024 * 1024)
|
||||
{ printf("%s:%d: report a bug\n", __FILE__, __LINE__); abort(); }
|
||||
ERR("%s:%d: report a bug\n", __FILE__, __LINE__);
|
||||
|
||||
g->notifiers = realloc(g->notifiers,
|
||||
(g->notifiers_count+1) * sizeof(struct notifier));
|
||||
@@ -50,11 +50,8 @@ void unregister_notifier(gui *_g, unsigned long notifier_id)
|
||||
for (i = 0; i < g->notifiers_count; i++)
|
||||
if (g->notifiers[i].id == notifier_id) break;
|
||||
|
||||
if (i == g->notifiers_count) {
|
||||
printf("%s:%d: notifier_id %ld not found\n", __FILE__, __LINE__,
|
||||
notifier_id);
|
||||
abort();
|
||||
}
|
||||
if (i == g->notifiers_count)
|
||||
ERR("%s:%d: notifier_id %ld not found\n", __FILE__,__LINE__,notifier_id);
|
||||
|
||||
free(g->notifiers[i].notification);
|
||||
|
||||
@@ -83,8 +80,7 @@ void gui_notify(struct gui *g, char *notification, widget *w,
|
||||
* for now let's crash in case of recursive call
|
||||
*/
|
||||
static int inside = 0;
|
||||
if (inside)
|
||||
{printf("%s:%d: BUG! contact the authors\n", __FILE__, __LINE__);abort();}
|
||||
if (inside) ERR("%s:%d: BUG! contact the authors\n", __FILE__, __LINE__);
|
||||
inside = 1;
|
||||
|
||||
/* clear all handlers */
|
||||
|
||||
Reference in New Issue
Block a user