summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-23 14:46:04 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-23 14:46:04 -0300
commitf5fa04cbf3ac9011f4f144cd68543f8d9536e3fd (patch)
treeac9160ef7ef5963e296144fb75845db56ba62e7c /gui
parent061dd9094a903be73e3aa7a65aafb8bcb70010b7 (diff)
downloadeeshow-f5fa04cbf3ac9011f4f144cd68543f8d9536e3fd.tar.gz
eeshow-f5fa04cbf3ac9011f4f144cd68543f8d9536e3fd.tar.bz2
eeshow-f5fa04cbf3ac9011f4f144cd68543f8d9536e3fd.zip
misc/diag.h (BUG): more useful diagnostics; replace all "abort" with it
Diffstat (limited to 'gui')
-rw-r--r--gui/gui.c4
-rw-r--r--gui/history.c5
-rw-r--r--gui/input.c12
3 files changed, 11 insertions, 10 deletions
diff --git a/gui/gui.c b/gui/gui.c
index 4f38325..5fe3cc9 100644
--- a/gui/gui.c
+++ b/gui/gui.c
@@ -99,13 +99,13 @@ static void select_subsheet(void *user)
go_to_sheet(ctx, sheet);
return;
}
- abort();
+ BUG("new sheet not found");
}
for (sheet = ctx->old_hist->sheets; sheet; sheet = sheet->next)
if (sheet->sch == obj->u.sheet.sheet)
goto found;
- abort();
+ BUG("old sheet not found");
found:
sheet = find_corresponding_sheet(ctx->new_hist->sheets,
diff --git a/gui/history.c b/gui/history.c
index 85a798d..47de575 100644
--- a/gui/history.c
+++ b/gui/history.c
@@ -18,6 +18,7 @@
#include <pango/pangocairo.h>
#include "misc/util.h"
+#include "misc/diag.h"
#include "file/git-hist.h"
#include "gui/fmt-pango.h"
#include "gui/style.h"
@@ -60,7 +61,7 @@ static void set_history_style(struct gui_hist *h, bool current)
style.frame = COLOR(FRAME_SEL_NEW);
break;
default:
- abort();
+ BUG("invalid mode %d", ctx->selecting);
}
if (ctx->new_hist == h || ctx->old_hist == h) {
@@ -170,7 +171,7 @@ static void click_history(void *user)
ctx->old_hist = h;
break;
default:
- abort();
+ BUG("invalid mode %d", ctx->selecting);
}
ctx->diff_mode = diff_delta;
diff --git a/gui/input.c b/gui/input.c
index b8d388f..f005527 100644
--- a/gui/input.c
+++ b/gui/input.c
@@ -65,7 +65,7 @@ static const char *state(void)
case input_dragging:
return "DRAGGING";
default:
- abort();
+ BUG("invalid state %d", sp->state);
}
}
@@ -133,7 +133,7 @@ static void hover_update(int x, int y)
break;
case input_dragging:
default:
- abort();
+ BUG("invalid state %d", sp->state);
}
if (sp->ops->hover_end)
@@ -164,7 +164,7 @@ void input_update(void)
case input_dragging:
break;
default:
- abort();
+ BUG("invalid state %d", sp->state);
}
}
@@ -210,7 +210,7 @@ static gboolean motion_notify_event(GtkWidget *widget, GdkEventMotion *event,
clicked_y = event->y;
break;
default:
- abort();
+ BUG("invalid state %d", sp->state);
}
return TRUE;
}
@@ -244,7 +244,7 @@ static gboolean button_press_event(GtkWidget *widget, GdkEventButton *event,
clicked_y = event->y;
break;
default:
- abort();
+ BUG("invalid state %d", sp->state);
}
return TRUE;
@@ -294,7 +294,7 @@ static gboolean button_release_event(GtkWidget *widget, GdkEventButton *event,
}
break;
default:
- abort();
+ BUG("invalid state %d", sp->state);
}
return TRUE;